@mxenabled/connect-widget 2.17.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1125 -306
- package/dist/index.es.js.map +1 -1
- package/dist/lastBuild.txt +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1872,7 +1872,7 @@ var errors = process.env.NODE_ENV !== "production" ? [
|
|
|
1872
1872
|
function die(error, ...args) {
|
|
1873
1873
|
if (process.env.NODE_ENV !== "production") {
|
|
1874
1874
|
const e = errors[error];
|
|
1875
|
-
const msg =
|
|
1875
|
+
const msg = isFunction$4(e) ? e.apply(null, args) : e;
|
|
1876
1876
|
throw new Error(`[Immer] ${msg}`);
|
|
1877
1877
|
}
|
|
1878
1878
|
throw new Error(
|
|
@@ -1881,31 +1881,44 @@ function die(error, ...args) {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
1883
|
// src/utils/common.ts
|
|
1884
|
-
var
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1884
|
+
var O$2 = Object;
|
|
1885
|
+
var getPrototypeOf$1 = O$2.getPrototypeOf;
|
|
1886
|
+
var CONSTRUCTOR = "constructor";
|
|
1887
|
+
var PROTOTYPE = "prototype";
|
|
1888
|
+
var CONFIGURABLE = "configurable";
|
|
1889
|
+
var ENUMERABLE = "enumerable";
|
|
1890
|
+
var WRITABLE = "writable";
|
|
1891
|
+
var VALUE = "value";
|
|
1892
|
+
var isDraft = (value) => !!value && !!value[DRAFT_STATE];
|
|
1888
1893
|
function isDraftable(value) {
|
|
1889
1894
|
if (!value)
|
|
1890
1895
|
return false;
|
|
1891
|
-
return isPlainObject$7(value) ||
|
|
1896
|
+
return isPlainObject$7(value) || isArray$j(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap$2(value) || isSet$2(value);
|
|
1892
1897
|
}
|
|
1893
|
-
var objectCtorString$1 =
|
|
1898
|
+
var objectCtorString$1 = O$2[PROTOTYPE][CONSTRUCTOR].toString();
|
|
1899
|
+
var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
|
|
1894
1900
|
function isPlainObject$7(value) {
|
|
1895
|
-
if (!value ||
|
|
1901
|
+
if (!value || !isObjectish(value))
|
|
1896
1902
|
return false;
|
|
1897
1903
|
const proto = getPrototypeOf$1(value);
|
|
1898
|
-
if (proto === null)
|
|
1904
|
+
if (proto === null || proto === O$2[PROTOTYPE])
|
|
1899
1905
|
return true;
|
|
1900
|
-
|
|
1901
|
-
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
1906
|
+
const Ctor = O$2.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];
|
|
1902
1907
|
if (Ctor === Object)
|
|
1903
1908
|
return true;
|
|
1904
|
-
|
|
1909
|
+
if (!isFunction$4(Ctor))
|
|
1910
|
+
return false;
|
|
1911
|
+
let ctorString = cachedCtorStrings.get(Ctor);
|
|
1912
|
+
if (ctorString === void 0) {
|
|
1913
|
+
ctorString = Function.toString.call(Ctor);
|
|
1914
|
+
cachedCtorStrings.set(Ctor, ctorString);
|
|
1915
|
+
}
|
|
1916
|
+
return ctorString === objectCtorString$1;
|
|
1905
1917
|
}
|
|
1906
|
-
function each$1(obj, iter) {
|
|
1918
|
+
function each$1(obj, iter, strict = true) {
|
|
1907
1919
|
if (getArchtype(obj) === 0 /* Object */) {
|
|
1908
|
-
Reflect.ownKeys(obj).
|
|
1920
|
+
const keys = strict ? Reflect.ownKeys(obj) : O$2.keys(obj);
|
|
1921
|
+
keys.forEach((key) => {
|
|
1909
1922
|
iter(key, obj[key], obj);
|
|
1910
1923
|
});
|
|
1911
1924
|
} else {
|
|
@@ -1914,20 +1927,21 @@ function each$1(obj, iter) {
|
|
|
1914
1927
|
}
|
|
1915
1928
|
function getArchtype(thing) {
|
|
1916
1929
|
const state = thing[DRAFT_STATE];
|
|
1917
|
-
return state ? state.type_ :
|
|
1930
|
+
return state ? state.type_ : isArray$j(thing) ? 1 /* Array */ : isMap$2(thing) ? 2 /* Map */ : isSet$2(thing) ? 3 /* Set */ : 0 /* Object */;
|
|
1918
1931
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1932
|
+
var has$2 = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O$2[PROTOTYPE].hasOwnProperty.call(thing, prop);
|
|
1933
|
+
var get$2 = (thing, prop, type = getArchtype(thing)) => (
|
|
1934
|
+
// @ts-ignore
|
|
1935
|
+
type === 2 /* Map */ ? thing.get(prop) : thing[prop]
|
|
1936
|
+
);
|
|
1937
|
+
var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {
|
|
1938
|
+
if (type === 2 /* Map */)
|
|
1925
1939
|
thing.set(propOrOldValue, value);
|
|
1926
|
-
else if (
|
|
1940
|
+
else if (type === 3 /* Set */) {
|
|
1927
1941
|
thing.add(value);
|
|
1928
1942
|
} else
|
|
1929
1943
|
thing[propOrOldValue] = value;
|
|
1930
|
-
}
|
|
1944
|
+
};
|
|
1931
1945
|
function is(x, y) {
|
|
1932
1946
|
if (x === y) {
|
|
1933
1947
|
return x !== 0 || 1 / x === 1 / y;
|
|
@@ -1935,15 +1949,18 @@ function is(x, y) {
|
|
|
1935
1949
|
return x !== x && y !== y;
|
|
1936
1950
|
}
|
|
1937
1951
|
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
function
|
|
1945
|
-
|
|
1952
|
+
var isArray$j = Array.isArray;
|
|
1953
|
+
var isMap$2 = (target) => target instanceof Map;
|
|
1954
|
+
var isSet$2 = (target) => target instanceof Set;
|
|
1955
|
+
var isObjectish = (target) => typeof target === "object";
|
|
1956
|
+
var isFunction$4 = (target) => typeof target === "function";
|
|
1957
|
+
var isBoolean$1 = (target) => typeof target === "boolean";
|
|
1958
|
+
function isArrayIndex(value) {
|
|
1959
|
+
const n = +value;
|
|
1960
|
+
return Number.isInteger(n) && String(n) === value;
|
|
1946
1961
|
}
|
|
1962
|
+
var latest = (state) => state.copy_ || state.base_;
|
|
1963
|
+
var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;
|
|
1947
1964
|
function shallowCopy(base, strict) {
|
|
1948
1965
|
if (isMap$2(base)) {
|
|
1949
1966
|
return new Map(base);
|
|
@@ -1951,63 +1968,77 @@ function shallowCopy(base, strict) {
|
|
|
1951
1968
|
if (isSet$2(base)) {
|
|
1952
1969
|
return new Set(base);
|
|
1953
1970
|
}
|
|
1954
|
-
if (
|
|
1955
|
-
return Array.
|
|
1971
|
+
if (isArray$j(base))
|
|
1972
|
+
return Array[PROTOTYPE].slice.call(base);
|
|
1956
1973
|
const isPlain = isPlainObject$7(base);
|
|
1957
1974
|
if (strict === true || strict === "class_only" && !isPlain) {
|
|
1958
|
-
const descriptors =
|
|
1975
|
+
const descriptors = O$2.getOwnPropertyDescriptors(base);
|
|
1959
1976
|
delete descriptors[DRAFT_STATE];
|
|
1960
1977
|
let keys = Reflect.ownKeys(descriptors);
|
|
1961
1978
|
for (let i = 0; i < keys.length; i++) {
|
|
1962
1979
|
const key = keys[i];
|
|
1963
1980
|
const desc = descriptors[key];
|
|
1964
|
-
if (desc
|
|
1965
|
-
desc
|
|
1966
|
-
desc
|
|
1981
|
+
if (desc[WRITABLE] === false) {
|
|
1982
|
+
desc[WRITABLE] = true;
|
|
1983
|
+
desc[CONFIGURABLE] = true;
|
|
1967
1984
|
}
|
|
1968
1985
|
if (desc.get || desc.set)
|
|
1969
1986
|
descriptors[key] = {
|
|
1970
|
-
|
|
1971
|
-
|
|
1987
|
+
[CONFIGURABLE]: true,
|
|
1988
|
+
[WRITABLE]: true,
|
|
1972
1989
|
// could live with !!desc.set as well here...
|
|
1973
|
-
|
|
1974
|
-
|
|
1990
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
1991
|
+
[VALUE]: base[key]
|
|
1975
1992
|
};
|
|
1976
1993
|
}
|
|
1977
|
-
return
|
|
1994
|
+
return O$2.create(getPrototypeOf$1(base), descriptors);
|
|
1978
1995
|
} else {
|
|
1979
1996
|
const proto = getPrototypeOf$1(base);
|
|
1980
1997
|
if (proto !== null && isPlain) {
|
|
1981
1998
|
return { ...base };
|
|
1982
1999
|
}
|
|
1983
|
-
const obj =
|
|
1984
|
-
return
|
|
2000
|
+
const obj = O$2.create(proto);
|
|
2001
|
+
return O$2.assign(obj, base);
|
|
1985
2002
|
}
|
|
1986
2003
|
}
|
|
1987
2004
|
function freeze$1(obj, deep = false) {
|
|
1988
2005
|
if (isFrozen$1(obj) || isDraft(obj) || !isDraftable(obj))
|
|
1989
2006
|
return obj;
|
|
1990
2007
|
if (getArchtype(obj) > 1) {
|
|
1991
|
-
|
|
1992
|
-
set:
|
|
1993
|
-
add:
|
|
1994
|
-
clear:
|
|
1995
|
-
delete:
|
|
2008
|
+
O$2.defineProperties(obj, {
|
|
2009
|
+
set: dontMutateMethodOverride,
|
|
2010
|
+
add: dontMutateMethodOverride,
|
|
2011
|
+
clear: dontMutateMethodOverride,
|
|
2012
|
+
delete: dontMutateMethodOverride
|
|
1996
2013
|
});
|
|
1997
2014
|
}
|
|
1998
|
-
|
|
2015
|
+
O$2.freeze(obj);
|
|
1999
2016
|
if (deep)
|
|
2000
|
-
|
|
2017
|
+
each$1(
|
|
2018
|
+
obj,
|
|
2019
|
+
(_key, value) => {
|
|
2020
|
+
freeze$1(value, true);
|
|
2021
|
+
},
|
|
2022
|
+
false
|
|
2023
|
+
);
|
|
2001
2024
|
return obj;
|
|
2002
2025
|
}
|
|
2003
2026
|
function dontMutateFrozenCollections() {
|
|
2004
2027
|
die(2);
|
|
2005
2028
|
}
|
|
2029
|
+
var dontMutateMethodOverride = {
|
|
2030
|
+
[VALUE]: dontMutateFrozenCollections
|
|
2031
|
+
};
|
|
2006
2032
|
function isFrozen$1(obj) {
|
|
2007
|
-
|
|
2033
|
+
if (obj === null || !isObjectish(obj))
|
|
2034
|
+
return true;
|
|
2035
|
+
return O$2.isFrozen(obj);
|
|
2008
2036
|
}
|
|
2009
2037
|
|
|
2010
2038
|
// src/utils/plugins.ts
|
|
2039
|
+
var PluginMapSet = "MapSet";
|
|
2040
|
+
var PluginPatches = "Patches";
|
|
2041
|
+
var PluginArrayMethods = "ArrayMethods";
|
|
2011
2042
|
var plugins = {};
|
|
2012
2043
|
function getPlugin(pluginKey) {
|
|
2013
2044
|
const plugin = plugins[pluginKey];
|
|
@@ -2016,26 +2047,27 @@ function getPlugin(pluginKey) {
|
|
|
2016
2047
|
}
|
|
2017
2048
|
return plugin;
|
|
2018
2049
|
}
|
|
2050
|
+
var isPluginLoaded = (pluginKey) => !!plugins[pluginKey];
|
|
2019
2051
|
|
|
2020
2052
|
// src/core/scope.ts
|
|
2021
2053
|
var currentScope;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
}
|
|
2054
|
+
var getCurrentScope = () => currentScope;
|
|
2055
|
+
var createScope = (parent_, immer_) => ({
|
|
2056
|
+
drafts_: [],
|
|
2057
|
+
parent_,
|
|
2058
|
+
immer_,
|
|
2059
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
2060
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
2061
|
+
canAutoFreeze_: true,
|
|
2062
|
+
unfinalizedDrafts_: 0,
|
|
2063
|
+
handledSet_: /* @__PURE__ */ new Set(),
|
|
2064
|
+
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
2065
|
+
mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,
|
|
2066
|
+
arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0
|
|
2067
|
+
});
|
|
2036
2068
|
function usePatchesInScope(scope, patchListener) {
|
|
2037
2069
|
if (patchListener) {
|
|
2038
|
-
getPlugin(
|
|
2070
|
+
scope.patchPlugin_ = getPlugin(PluginPatches);
|
|
2039
2071
|
scope.patches_ = [];
|
|
2040
2072
|
scope.inversePatches_ = [];
|
|
2041
2073
|
scope.patchListener_ = patchListener;
|
|
@@ -2051,9 +2083,7 @@ function leaveScope(scope) {
|
|
|
2051
2083
|
currentScope = scope.parent_;
|
|
2052
2084
|
}
|
|
2053
2085
|
}
|
|
2054
|
-
|
|
2055
|
-
return currentScope = createScope(currentScope, immer2);
|
|
2056
|
-
}
|
|
2086
|
+
var enterScope = (immer2) => currentScope = createScope(currentScope, immer2);
|
|
2057
2087
|
function revokeDraft(draft) {
|
|
2058
2088
|
const state = draft[DRAFT_STATE];
|
|
2059
2089
|
if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
|
|
@@ -2074,105 +2104,172 @@ function processResult(result, scope) {
|
|
|
2074
2104
|
}
|
|
2075
2105
|
if (isDraftable(result)) {
|
|
2076
2106
|
result = finalize(scope, result);
|
|
2077
|
-
if (!scope.parent_)
|
|
2078
|
-
maybeFreeze(scope, result);
|
|
2079
2107
|
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2108
|
+
const { patchPlugin_ } = scope;
|
|
2109
|
+
if (patchPlugin_) {
|
|
2110
|
+
patchPlugin_.generateReplacementPatches_(
|
|
2082
2111
|
baseDraft[DRAFT_STATE].base_,
|
|
2083
2112
|
result,
|
|
2084
|
-
scope
|
|
2085
|
-
scope.inversePatches_
|
|
2113
|
+
scope
|
|
2086
2114
|
);
|
|
2087
2115
|
}
|
|
2088
2116
|
} else {
|
|
2089
|
-
result = finalize(scope, baseDraft
|
|
2117
|
+
result = finalize(scope, baseDraft);
|
|
2090
2118
|
}
|
|
2119
|
+
maybeFreeze(scope, result, true);
|
|
2091
2120
|
revokeScope(scope);
|
|
2092
2121
|
if (scope.patches_) {
|
|
2093
2122
|
scope.patchListener_(scope.patches_, scope.inversePatches_);
|
|
2094
2123
|
}
|
|
2095
2124
|
return result !== NOTHING ? result : void 0;
|
|
2096
2125
|
}
|
|
2097
|
-
function finalize(rootScope, value
|
|
2126
|
+
function finalize(rootScope, value) {
|
|
2098
2127
|
if (isFrozen$1(value))
|
|
2099
2128
|
return value;
|
|
2100
2129
|
const state = value[DRAFT_STATE];
|
|
2101
2130
|
if (!state) {
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
(key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)
|
|
2105
|
-
);
|
|
2106
|
-
return value;
|
|
2131
|
+
const finalValue = handleValue(value, rootScope.handledSet_, rootScope);
|
|
2132
|
+
return finalValue;
|
|
2107
2133
|
}
|
|
2108
|
-
if (state
|
|
2134
|
+
if (!isSameScope(state, rootScope)) {
|
|
2109
2135
|
return value;
|
|
2136
|
+
}
|
|
2110
2137
|
if (!state.modified_) {
|
|
2111
|
-
maybeFreeze(rootScope, state.base_, true);
|
|
2112
2138
|
return state.base_;
|
|
2113
2139
|
}
|
|
2114
2140
|
if (!state.finalized_) {
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
resultEach = new Set(result);
|
|
2122
|
-
result.clear();
|
|
2123
|
-
isSet2 = true;
|
|
2124
|
-
}
|
|
2125
|
-
each$1(
|
|
2126
|
-
resultEach,
|
|
2127
|
-
(key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)
|
|
2128
|
-
);
|
|
2129
|
-
maybeFreeze(rootScope, result, false);
|
|
2130
|
-
if (path && rootScope.patches_) {
|
|
2131
|
-
getPlugin("Patches").generatePatches_(
|
|
2132
|
-
state,
|
|
2133
|
-
path,
|
|
2134
|
-
rootScope.patches_,
|
|
2135
|
-
rootScope.inversePatches_
|
|
2136
|
-
);
|
|
2141
|
+
const { callbacks_ } = state;
|
|
2142
|
+
if (callbacks_) {
|
|
2143
|
+
while (callbacks_.length > 0) {
|
|
2144
|
+
const callback = callbacks_.pop();
|
|
2145
|
+
callback(rootScope);
|
|
2146
|
+
}
|
|
2137
2147
|
}
|
|
2148
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
2138
2149
|
}
|
|
2139
2150
|
return state.copy_;
|
|
2140
2151
|
}
|
|
2141
|
-
function
|
|
2142
|
-
if (
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
+
function maybeFreeze(scope, value, deep = false) {
|
|
2153
|
+
if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
|
|
2154
|
+
freeze$1(value, deep);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function markStateFinalized(state) {
|
|
2158
|
+
state.finalized_ = true;
|
|
2159
|
+
state.scope_.unfinalizedDrafts_--;
|
|
2160
|
+
}
|
|
2161
|
+
var isSameScope = (state, rootScope) => state.scope_ === rootScope;
|
|
2162
|
+
var EMPTY_LOCATIONS_RESULT = [];
|
|
2163
|
+
function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {
|
|
2164
|
+
const parentCopy = latest(parent);
|
|
2165
|
+
const parentType = parent.type_;
|
|
2166
|
+
if (originalKey !== void 0) {
|
|
2167
|
+
const currentValue = get$2(parentCopy, originalKey, parentType);
|
|
2168
|
+
if (currentValue === draftValue) {
|
|
2169
|
+
set(parentCopy, originalKey, finalizedValue, parentType);
|
|
2152
2170
|
return;
|
|
2153
|
-
|
|
2154
|
-
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
if (!parent.draftLocations_) {
|
|
2174
|
+
const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();
|
|
2175
|
+
each$1(parentCopy, (key, value) => {
|
|
2176
|
+
if (isDraft(value)) {
|
|
2177
|
+
const keys = draftLocations.get(value) || [];
|
|
2178
|
+
keys.push(key);
|
|
2179
|
+
draftLocations.set(value, keys);
|
|
2180
|
+
}
|
|
2181
|
+
});
|
|
2155
2182
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2183
|
+
const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;
|
|
2184
|
+
for (const location of locations) {
|
|
2185
|
+
set(parentCopy, location, finalizedValue, parentType);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function registerChildFinalizationCallback(parent, child, key) {
|
|
2189
|
+
parent.callbacks_.push(function childCleanup(rootScope) {
|
|
2190
|
+
const state = child;
|
|
2191
|
+
if (!state || !isSameScope(state, rootScope)) {
|
|
2158
2192
|
return;
|
|
2159
2193
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2194
|
+
rootScope.mapSetPlugin_?.fixSetContents(state);
|
|
2195
|
+
const finalizedValue = getFinalValue(state);
|
|
2196
|
+
updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);
|
|
2197
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
function generatePatchesAndFinalize(state, rootScope) {
|
|
2201
|
+
const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || state.type_ === 1 /* Array */ && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0);
|
|
2202
|
+
if (shouldFinalize) {
|
|
2203
|
+
const { patchPlugin_ } = rootScope;
|
|
2204
|
+
if (patchPlugin_) {
|
|
2205
|
+
const basePath = patchPlugin_.getPath(state);
|
|
2206
|
+
if (basePath) {
|
|
2207
|
+
patchPlugin_.generatePatches_(state, basePath, rootScope);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
markStateFinalized(state);
|
|
2163
2211
|
}
|
|
2164
2212
|
}
|
|
2165
|
-
function
|
|
2166
|
-
|
|
2167
|
-
|
|
2213
|
+
function handleCrossReference(target, key, value) {
|
|
2214
|
+
const { scope_ } = target;
|
|
2215
|
+
if (isDraft(value)) {
|
|
2216
|
+
const state = value[DRAFT_STATE];
|
|
2217
|
+
if (isSameScope(state, scope_)) {
|
|
2218
|
+
state.callbacks_.push(function crossReferenceCleanup() {
|
|
2219
|
+
prepareCopy(target);
|
|
2220
|
+
const finalizedValue = getFinalValue(state);
|
|
2221
|
+
updateDraftInParent(target, value, finalizedValue, key);
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
} else if (isDraftable(value)) {
|
|
2225
|
+
target.callbacks_.push(function nestedDraftCleanup() {
|
|
2226
|
+
const targetCopy = latest(target);
|
|
2227
|
+
if (target.type_ === 3 /* Set */) {
|
|
2228
|
+
if (targetCopy.has(value)) {
|
|
2229
|
+
handleValue(value, scope_.handledSet_, scope_);
|
|
2230
|
+
}
|
|
2231
|
+
} else {
|
|
2232
|
+
if (get$2(targetCopy, key, target.type_) === value) {
|
|
2233
|
+
if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {
|
|
2234
|
+
handleValue(
|
|
2235
|
+
get$2(target.copy_, key, target.type_),
|
|
2236
|
+
scope_.handledSet_,
|
|
2237
|
+
scope_
|
|
2238
|
+
);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
function handleValue(target, handledSet, rootScope) {
|
|
2246
|
+
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
|
|
2247
|
+
return target;
|
|
2248
|
+
}
|
|
2249
|
+
if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen$1(target)) {
|
|
2250
|
+
return target;
|
|
2168
2251
|
}
|
|
2252
|
+
handledSet.add(target);
|
|
2253
|
+
each$1(target, (key, value) => {
|
|
2254
|
+
if (isDraft(value)) {
|
|
2255
|
+
const state = value[DRAFT_STATE];
|
|
2256
|
+
if (isSameScope(state, rootScope)) {
|
|
2257
|
+
const updatedValue = getFinalValue(state);
|
|
2258
|
+
set(target, key, updatedValue, target.type_);
|
|
2259
|
+
markStateFinalized(state);
|
|
2260
|
+
}
|
|
2261
|
+
} else if (isDraftable(value)) {
|
|
2262
|
+
handleValue(value, handledSet, rootScope);
|
|
2263
|
+
}
|
|
2264
|
+
});
|
|
2265
|
+
return target;
|
|
2169
2266
|
}
|
|
2170
2267
|
|
|
2171
2268
|
// src/core/proxy.ts
|
|
2172
2269
|
function createProxyProxy(base, parent) {
|
|
2173
|
-
const
|
|
2270
|
+
const baseIsArray = isArray$j(base);
|
|
2174
2271
|
const state = {
|
|
2175
|
-
type_:
|
|
2272
|
+
type_: baseIsArray ? 1 /* Array */ : 0 /* Object */,
|
|
2176
2273
|
// Track which produce call this is associated with.
|
|
2177
2274
|
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
2178
2275
|
// True for both shallow and deep changes.
|
|
@@ -2180,7 +2277,8 @@ function createProxyProxy(base, parent) {
|
|
|
2180
2277
|
// Used during finalization.
|
|
2181
2278
|
finalized_: false,
|
|
2182
2279
|
// Track which properties have been assigned (true) or deleted (false).
|
|
2183
|
-
|
|
2280
|
+
// actually instantiated in `prepareCopy()`
|
|
2281
|
+
assigned_: void 0,
|
|
2184
2282
|
// The parent draft state.
|
|
2185
2283
|
parent_: parent,
|
|
2186
2284
|
// The base state.
|
|
@@ -2192,34 +2290,50 @@ function createProxyProxy(base, parent) {
|
|
|
2192
2290
|
copy_: null,
|
|
2193
2291
|
// Called by the `produce` function.
|
|
2194
2292
|
revoke_: null,
|
|
2195
|
-
isManual_: false
|
|
2293
|
+
isManual_: false,
|
|
2294
|
+
// `callbacks` actually gets assigned in `createProxy`
|
|
2295
|
+
callbacks_: void 0
|
|
2196
2296
|
};
|
|
2197
2297
|
let target = state;
|
|
2198
2298
|
let traps = objectTraps;
|
|
2199
|
-
if (
|
|
2299
|
+
if (baseIsArray) {
|
|
2200
2300
|
target = [state];
|
|
2201
2301
|
traps = arrayTraps;
|
|
2202
2302
|
}
|
|
2203
2303
|
const { revoke, proxy } = Proxy.revocable(target, traps);
|
|
2204
2304
|
state.draft_ = proxy;
|
|
2205
2305
|
state.revoke_ = revoke;
|
|
2206
|
-
return proxy;
|
|
2306
|
+
return [proxy, state];
|
|
2207
2307
|
}
|
|
2208
2308
|
var objectTraps = {
|
|
2209
2309
|
get(state, prop) {
|
|
2210
2310
|
if (prop === DRAFT_STATE)
|
|
2211
2311
|
return state;
|
|
2312
|
+
let arrayPlugin = state.scope_.arrayMethodsPlugin_;
|
|
2313
|
+
const isArrayWithStringProp = state.type_ === 1 /* Array */ && typeof prop === "string";
|
|
2314
|
+
if (isArrayWithStringProp) {
|
|
2315
|
+
if (arrayPlugin?.isArrayOperationMethod(prop)) {
|
|
2316
|
+
return arrayPlugin.createMethodInterceptor(state, prop);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2212
2319
|
const source = latest(state);
|
|
2213
|
-
if (!has$2(source, prop)) {
|
|
2320
|
+
if (!has$2(source, prop, state.type_)) {
|
|
2214
2321
|
return readPropFromProto(state, source, prop);
|
|
2215
2322
|
}
|
|
2216
2323
|
const value = source[prop];
|
|
2217
2324
|
if (state.finalized_ || !isDraftable(value)) {
|
|
2218
2325
|
return value;
|
|
2219
2326
|
}
|
|
2327
|
+
if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(
|
|
2328
|
+
state.operationMethod
|
|
2329
|
+
) && isArrayIndex(prop)) {
|
|
2330
|
+
return value;
|
|
2331
|
+
}
|
|
2220
2332
|
if (value === peek$1(state.base_, prop)) {
|
|
2221
2333
|
prepareCopy(state);
|
|
2222
|
-
|
|
2334
|
+
const childKey = state.type_ === 1 /* Array */ ? +prop : prop;
|
|
2335
|
+
const childDraft = createProxy(state.scope_, value, state, childKey);
|
|
2336
|
+
return state.copy_[childKey] = childDraft;
|
|
2223
2337
|
}
|
|
2224
2338
|
return value;
|
|
2225
2339
|
},
|
|
@@ -2240,10 +2354,10 @@ var objectTraps = {
|
|
|
2240
2354
|
const currentState = current2?.[DRAFT_STATE];
|
|
2241
2355
|
if (currentState && currentState.base_ === value) {
|
|
2242
2356
|
state.copy_[prop] = value;
|
|
2243
|
-
state.assigned_
|
|
2357
|
+
state.assigned_.set(prop, false);
|
|
2244
2358
|
return true;
|
|
2245
2359
|
}
|
|
2246
|
-
if (is(value, current2) && (value !== void 0 || has$2(state.base_, prop)))
|
|
2360
|
+
if (is(value, current2) && (value !== void 0 || has$2(state.base_, prop, state.type_)))
|
|
2247
2361
|
return true;
|
|
2248
2362
|
prepareCopy(state);
|
|
2249
2363
|
markChanged(state);
|
|
@@ -2253,16 +2367,17 @@ var objectTraps = {
|
|
|
2253
2367
|
Number.isNaN(value) && Number.isNaN(state.copy_[prop]))
|
|
2254
2368
|
return true;
|
|
2255
2369
|
state.copy_[prop] = value;
|
|
2256
|
-
state.assigned_
|
|
2370
|
+
state.assigned_.set(prop, true);
|
|
2371
|
+
handleCrossReference(state, prop, value);
|
|
2257
2372
|
return true;
|
|
2258
2373
|
},
|
|
2259
2374
|
deleteProperty(state, prop) {
|
|
2375
|
+
prepareCopy(state);
|
|
2260
2376
|
if (peek$1(state.base_, prop) !== void 0 || prop in state.base_) {
|
|
2261
|
-
state.assigned_
|
|
2262
|
-
prepareCopy(state);
|
|
2377
|
+
state.assigned_.set(prop, false);
|
|
2263
2378
|
markChanged(state);
|
|
2264
2379
|
} else {
|
|
2265
|
-
|
|
2380
|
+
state.assigned_.delete(prop);
|
|
2266
2381
|
}
|
|
2267
2382
|
if (state.copy_) {
|
|
2268
2383
|
delete state.copy_[prop];
|
|
@@ -2277,10 +2392,10 @@ var objectTraps = {
|
|
|
2277
2392
|
if (!desc)
|
|
2278
2393
|
return desc;
|
|
2279
2394
|
return {
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2395
|
+
[WRITABLE]: true,
|
|
2396
|
+
[CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== "length",
|
|
2397
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
2398
|
+
[VALUE]: owner[prop]
|
|
2284
2399
|
};
|
|
2285
2400
|
},
|
|
2286
2401
|
defineProperty() {
|
|
@@ -2294,12 +2409,14 @@ var objectTraps = {
|
|
|
2294
2409
|
}
|
|
2295
2410
|
};
|
|
2296
2411
|
var arrayTraps = {};
|
|
2297
|
-
|
|
2412
|
+
for (let key in objectTraps) {
|
|
2413
|
+
let fn = objectTraps[key];
|
|
2298
2414
|
arrayTraps[key] = function() {
|
|
2299
|
-
|
|
2300
|
-
|
|
2415
|
+
const args = arguments;
|
|
2416
|
+
args[0] = args[0][0];
|
|
2417
|
+
return fn.apply(this, args);
|
|
2301
2418
|
};
|
|
2302
|
-
}
|
|
2419
|
+
}
|
|
2303
2420
|
arrayTraps.deleteProperty = function(state, prop) {
|
|
2304
2421
|
if (process.env.NODE_ENV !== "production" && isNaN(parseInt(prop)))
|
|
2305
2422
|
die(13);
|
|
@@ -2317,7 +2434,7 @@ function peek$1(draft, prop) {
|
|
|
2317
2434
|
}
|
|
2318
2435
|
function readPropFromProto(state, source, prop) {
|
|
2319
2436
|
const desc = getDescriptorFromProto(source, prop);
|
|
2320
|
-
return desc ?
|
|
2437
|
+
return desc ? VALUE in desc ? desc[VALUE] : (
|
|
2321
2438
|
// This is a very special case, if the prop is a getter defined by the
|
|
2322
2439
|
// prototype, we should invoke it with the draft as context!
|
|
2323
2440
|
desc.get?.call(state.draft_)
|
|
@@ -2345,6 +2462,7 @@ function markChanged(state) {
|
|
|
2345
2462
|
}
|
|
2346
2463
|
function prepareCopy(state) {
|
|
2347
2464
|
if (!state.copy_) {
|
|
2465
|
+
state.assigned_ = /* @__PURE__ */ new Map();
|
|
2348
2466
|
state.copy_ = shallowCopy(
|
|
2349
2467
|
state.base_,
|
|
2350
2468
|
state.scope_.immer_.useStrictShallowCopy_
|
|
@@ -2357,6 +2475,7 @@ var Immer2 = class {
|
|
|
2357
2475
|
constructor(config) {
|
|
2358
2476
|
this.autoFreeze_ = true;
|
|
2359
2477
|
this.useStrictShallowCopy_ = false;
|
|
2478
|
+
this.useStrictIteration_ = false;
|
|
2360
2479
|
/**
|
|
2361
2480
|
* The `produce` function takes a value and a "recipe function" (whose
|
|
2362
2481
|
* return value often depends on the base state). The recipe function is
|
|
@@ -2377,7 +2496,7 @@ var Immer2 = class {
|
|
|
2377
2496
|
* @returns {any} a new state, or the initial state if nothing was modified
|
|
2378
2497
|
*/
|
|
2379
2498
|
this.produce = (base, recipe, patchListener) => {
|
|
2380
|
-
if (
|
|
2499
|
+
if (isFunction$4(base) && !isFunction$4(recipe)) {
|
|
2381
2500
|
const defaultBase = recipe;
|
|
2382
2501
|
recipe = base;
|
|
2383
2502
|
const self = this;
|
|
@@ -2385,14 +2504,14 @@ var Immer2 = class {
|
|
|
2385
2504
|
return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
|
|
2386
2505
|
};
|
|
2387
2506
|
}
|
|
2388
|
-
if (
|
|
2507
|
+
if (!isFunction$4(recipe))
|
|
2389
2508
|
die(6);
|
|
2390
|
-
if (patchListener !== void 0 &&
|
|
2509
|
+
if (patchListener !== void 0 && !isFunction$4(patchListener))
|
|
2391
2510
|
die(7);
|
|
2392
2511
|
let result;
|
|
2393
2512
|
if (isDraftable(base)) {
|
|
2394
2513
|
const scope = enterScope(this);
|
|
2395
|
-
const proxy = createProxy(base, void 0);
|
|
2514
|
+
const proxy = createProxy(scope, base, void 0);
|
|
2396
2515
|
let hasError = true;
|
|
2397
2516
|
try {
|
|
2398
2517
|
result = recipe(proxy);
|
|
@@ -2405,7 +2524,7 @@ var Immer2 = class {
|
|
|
2405
2524
|
}
|
|
2406
2525
|
usePatchesInScope(scope, patchListener);
|
|
2407
2526
|
return processResult(result, scope);
|
|
2408
|
-
} else if (!base ||
|
|
2527
|
+
} else if (!base || !isObjectish(base)) {
|
|
2409
2528
|
result = recipe(base);
|
|
2410
2529
|
if (result === void 0)
|
|
2411
2530
|
result = base;
|
|
@@ -2416,7 +2535,10 @@ var Immer2 = class {
|
|
|
2416
2535
|
if (patchListener) {
|
|
2417
2536
|
const p = [];
|
|
2418
2537
|
const ip = [];
|
|
2419
|
-
getPlugin(
|
|
2538
|
+
getPlugin(PluginPatches).generateReplacementPatches_(base, result, {
|
|
2539
|
+
patches_: p,
|
|
2540
|
+
inversePatches_: ip
|
|
2541
|
+
});
|
|
2420
2542
|
patchListener(p, ip);
|
|
2421
2543
|
}
|
|
2422
2544
|
return result;
|
|
@@ -2424,7 +2546,7 @@ var Immer2 = class {
|
|
|
2424
2546
|
die(1, base);
|
|
2425
2547
|
};
|
|
2426
2548
|
this.produceWithPatches = (base, recipe) => {
|
|
2427
|
-
if (
|
|
2549
|
+
if (isFunction$4(base)) {
|
|
2428
2550
|
return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
|
|
2429
2551
|
}
|
|
2430
2552
|
let patches, inversePatches;
|
|
@@ -2434,10 +2556,12 @@ var Immer2 = class {
|
|
|
2434
2556
|
});
|
|
2435
2557
|
return [result, patches, inversePatches];
|
|
2436
2558
|
};
|
|
2437
|
-
if (
|
|
2559
|
+
if (isBoolean$1(config?.autoFreeze))
|
|
2438
2560
|
this.setAutoFreeze(config.autoFreeze);
|
|
2439
|
-
if (
|
|
2561
|
+
if (isBoolean$1(config?.useStrictShallowCopy))
|
|
2440
2562
|
this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
2563
|
+
if (isBoolean$1(config?.useStrictIteration))
|
|
2564
|
+
this.setUseStrictIteration(config.useStrictIteration);
|
|
2441
2565
|
}
|
|
2442
2566
|
createDraft(base) {
|
|
2443
2567
|
if (!isDraftable(base))
|
|
@@ -2445,7 +2569,7 @@ var Immer2 = class {
|
|
|
2445
2569
|
if (isDraft(base))
|
|
2446
2570
|
base = current(base);
|
|
2447
2571
|
const scope = enterScope(this);
|
|
2448
|
-
const proxy = createProxy(base, void 0);
|
|
2572
|
+
const proxy = createProxy(scope, base, void 0);
|
|
2449
2573
|
proxy[DRAFT_STATE].isManual_ = true;
|
|
2450
2574
|
leaveScope(scope);
|
|
2451
2575
|
return proxy;
|
|
@@ -2474,6 +2598,18 @@ var Immer2 = class {
|
|
|
2474
2598
|
setUseStrictShallowCopy(value) {
|
|
2475
2599
|
this.useStrictShallowCopy_ = value;
|
|
2476
2600
|
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Pass false to use faster iteration that skips non-enumerable properties
|
|
2603
|
+
* but still handles symbols for compatibility.
|
|
2604
|
+
*
|
|
2605
|
+
* By default, strict iteration is enabled (includes all own properties).
|
|
2606
|
+
*/
|
|
2607
|
+
setUseStrictIteration(value) {
|
|
2608
|
+
this.useStrictIteration_ = value;
|
|
2609
|
+
}
|
|
2610
|
+
shouldUseStrictIteration() {
|
|
2611
|
+
return this.useStrictIteration_;
|
|
2612
|
+
}
|
|
2477
2613
|
applyPatches(base, patches) {
|
|
2478
2614
|
let i;
|
|
2479
2615
|
for (i = patches.length - 1; i >= 0; i--) {
|
|
@@ -2486,7 +2622,7 @@ var Immer2 = class {
|
|
|
2486
2622
|
if (i > -1) {
|
|
2487
2623
|
patches = patches.slice(i + 1);
|
|
2488
2624
|
}
|
|
2489
|
-
const applyPatchesImpl = getPlugin(
|
|
2625
|
+
const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;
|
|
2490
2626
|
if (isDraft(base)) {
|
|
2491
2627
|
return applyPatchesImpl(base, patches);
|
|
2492
2628
|
}
|
|
@@ -2496,10 +2632,23 @@ var Immer2 = class {
|
|
|
2496
2632
|
);
|
|
2497
2633
|
}
|
|
2498
2634
|
};
|
|
2499
|
-
function createProxy(value, parent) {
|
|
2500
|
-
const draft = isMap$2(value) ? getPlugin(
|
|
2501
|
-
const scope = parent
|
|
2635
|
+
function createProxy(rootScope, value, parent, key) {
|
|
2636
|
+
const [draft, state] = isMap$2(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet$2(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);
|
|
2637
|
+
const scope = parent?.scope_ ?? getCurrentScope();
|
|
2502
2638
|
scope.drafts_.push(draft);
|
|
2639
|
+
state.callbacks_ = parent?.callbacks_ ?? [];
|
|
2640
|
+
state.key_ = key;
|
|
2641
|
+
if (parent && key !== void 0) {
|
|
2642
|
+
registerChildFinalizationCallback(parent, state, key);
|
|
2643
|
+
} else {
|
|
2644
|
+
state.callbacks_.push(function rootDraftCleanup(rootScope2) {
|
|
2645
|
+
rootScope2.mapSetPlugin_?.fixSetContents(state);
|
|
2646
|
+
const { patchPlugin_ } = rootScope2;
|
|
2647
|
+
if (state.modified_ && patchPlugin_) {
|
|
2648
|
+
patchPlugin_.generatePatches_(state, [], rootScope2);
|
|
2649
|
+
}
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2503
2652
|
return draft;
|
|
2504
2653
|
}
|
|
2505
2654
|
|
|
@@ -2514,17 +2663,23 @@ function currentImpl(value) {
|
|
|
2514
2663
|
return value;
|
|
2515
2664
|
const state = value[DRAFT_STATE];
|
|
2516
2665
|
let copy;
|
|
2666
|
+
let strict = true;
|
|
2517
2667
|
if (state) {
|
|
2518
2668
|
if (!state.modified_)
|
|
2519
2669
|
return state.base_;
|
|
2520
2670
|
state.finalized_ = true;
|
|
2521
2671
|
copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
|
|
2672
|
+
strict = state.scope_.immer_.shouldUseStrictIteration();
|
|
2522
2673
|
} else {
|
|
2523
2674
|
copy = shallowCopy(value, true);
|
|
2524
2675
|
}
|
|
2525
|
-
each$1(
|
|
2526
|
-
|
|
2527
|
-
|
|
2676
|
+
each$1(
|
|
2677
|
+
copy,
|
|
2678
|
+
(key, childValue) => {
|
|
2679
|
+
set(copy, key, currentImpl(childValue));
|
|
2680
|
+
},
|
|
2681
|
+
strict
|
|
2682
|
+
);
|
|
2528
2683
|
if (state) {
|
|
2529
2684
|
state.finalized_ = false;
|
|
2530
2685
|
}
|
|
@@ -2869,6 +3024,8 @@ var thunk = createThunkMiddleware();
|
|
|
2869
3024
|
var withExtraArgument = createThunkMiddleware;
|
|
2870
3025
|
|
|
2871
3026
|
// src/index.ts
|
|
3027
|
+
|
|
3028
|
+
// src/devtoolsExtension.ts
|
|
2872
3029
|
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
|
|
2873
3030
|
if (arguments.length === 0) return void 0;
|
|
2874
3031
|
if (typeof arguments[0] === "object") return compose$4;
|
|
@@ -2935,6 +3092,8 @@ function createActionCreatorInvariantMiddleware(options = {}) {
|
|
|
2935
3092
|
return next(action);
|
|
2936
3093
|
};
|
|
2937
3094
|
}
|
|
3095
|
+
|
|
3096
|
+
// src/utils.ts
|
|
2938
3097
|
function getTimeMeasureUtils(maxDelay, fnName) {
|
|
2939
3098
|
let elapsed = 0;
|
|
2940
3099
|
return {
|
|
@@ -2987,27 +3146,36 @@ function getOrInsertComputed(map, key, compute) {
|
|
|
2987
3146
|
function isImmutableDefault(value) {
|
|
2988
3147
|
return typeof value !== "object" || value == null || Object.isFrozen(value);
|
|
2989
3148
|
}
|
|
2990
|
-
function trackForMutations(isImmutable,
|
|
2991
|
-
const trackedProperties = trackProperties(isImmutable,
|
|
3149
|
+
function trackForMutations(isImmutable, ignoredPaths, obj) {
|
|
3150
|
+
const trackedProperties = trackProperties(isImmutable, ignoredPaths, obj);
|
|
2992
3151
|
return {
|
|
2993
3152
|
detectMutations() {
|
|
2994
|
-
return detectMutations(isImmutable,
|
|
3153
|
+
return detectMutations(isImmutable, ignoredPaths, trackedProperties, obj);
|
|
2995
3154
|
}
|
|
2996
3155
|
};
|
|
2997
3156
|
}
|
|
2998
|
-
function trackProperties(isImmutable,
|
|
3157
|
+
function trackProperties(isImmutable, ignoredPaths = [], obj, path = "", checkedObjects = /* @__PURE__ */ new Set()) {
|
|
2999
3158
|
const tracked = {
|
|
3000
3159
|
value: obj
|
|
3001
3160
|
};
|
|
3002
3161
|
if (!isImmutable(obj) && !checkedObjects.has(obj)) {
|
|
3003
3162
|
checkedObjects.add(obj);
|
|
3004
3163
|
tracked.children = {};
|
|
3164
|
+
const hasIgnoredPaths = ignoredPaths.length > 0;
|
|
3005
3165
|
for (const key in obj) {
|
|
3006
|
-
const
|
|
3007
|
-
if (
|
|
3008
|
-
|
|
3166
|
+
const nestedPath = path ? path + "." + key : key;
|
|
3167
|
+
if (hasIgnoredPaths) {
|
|
3168
|
+
const hasMatches = ignoredPaths.some((ignored) => {
|
|
3169
|
+
if (ignored instanceof RegExp) {
|
|
3170
|
+
return ignored.test(nestedPath);
|
|
3171
|
+
}
|
|
3172
|
+
return nestedPath === ignored;
|
|
3173
|
+
});
|
|
3174
|
+
if (hasMatches) {
|
|
3175
|
+
continue;
|
|
3176
|
+
}
|
|
3009
3177
|
}
|
|
3010
|
-
tracked.children[key] = trackProperties(isImmutable,
|
|
3178
|
+
tracked.children[key] = trackProperties(isImmutable, ignoredPaths, obj[key], nestedPath);
|
|
3011
3179
|
}
|
|
3012
3180
|
}
|
|
3013
3181
|
return tracked;
|
|
@@ -3115,6 +3283,8 @@ function createImmutableStateInvariantMiddleware(options = {}) {
|
|
|
3115
3283
|
};
|
|
3116
3284
|
}
|
|
3117
3285
|
}
|
|
3286
|
+
|
|
3287
|
+
// src/serializableStateInvariantMiddleware.ts
|
|
3118
3288
|
function isPlain(val) {
|
|
3119
3289
|
const type = typeof val;
|
|
3120
3290
|
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject$8(val);
|
|
@@ -4481,9 +4651,9 @@ var stubFalse_1 = stubFalse;
|
|
|
4481
4651
|
|
|
4482
4652
|
isBuffer$4.exports;
|
|
4483
4653
|
|
|
4484
|
-
(function (module, exports) {
|
|
4654
|
+
(function (module, exports$1) {
|
|
4485
4655
|
var root = _root, stubFalse = stubFalse_1;
|
|
4486
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
4656
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
4487
4657
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
4488
4658
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
4489
4659
|
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
@@ -4531,9 +4701,9 @@ var _nodeUtil = {exports: {}};
|
|
|
4531
4701
|
|
|
4532
4702
|
_nodeUtil.exports;
|
|
4533
4703
|
|
|
4534
|
-
(function (module, exports) {
|
|
4704
|
+
(function (module, exports$1) {
|
|
4535
4705
|
var freeGlobal = _freeGlobal;
|
|
4536
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
4706
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
4537
4707
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
4538
4708
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
4539
4709
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
@@ -6453,8 +6623,8 @@ const PropTypes$1 = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
|
6453
6623
|
|
|
6454
6624
|
var _mapping = {};
|
|
6455
6625
|
|
|
6456
|
-
(function (exports) {
|
|
6457
|
-
exports.aliasToReal = {
|
|
6626
|
+
(function (exports$1) {
|
|
6627
|
+
exports$1.aliasToReal = {
|
|
6458
6628
|
// Lodash aliases.
|
|
6459
6629
|
"each": "forEach",
|
|
6460
6630
|
"eachRight": "forEachRight",
|
|
@@ -6519,7 +6689,7 @@ var _mapping = {};
|
|
|
6519
6689
|
"whereEq": "isMatch",
|
|
6520
6690
|
"zipObj": "zipObject"
|
|
6521
6691
|
};
|
|
6522
|
-
exports.aryMethod = {
|
|
6692
|
+
exports$1.aryMethod = {
|
|
6523
6693
|
"1": [
|
|
6524
6694
|
"assignAll",
|
|
6525
6695
|
"assignInAll",
|
|
@@ -6754,12 +6924,12 @@ var _mapping = {};
|
|
|
6754
6924
|
"updateWith"
|
|
6755
6925
|
]
|
|
6756
6926
|
};
|
|
6757
|
-
exports.aryRearg = {
|
|
6927
|
+
exports$1.aryRearg = {
|
|
6758
6928
|
"2": [1, 0],
|
|
6759
6929
|
"3": [2, 0, 1],
|
|
6760
6930
|
"4": [3, 2, 0, 1]
|
|
6761
6931
|
};
|
|
6762
|
-
exports.iterateeAry = {
|
|
6932
|
+
exports$1.iterateeAry = {
|
|
6763
6933
|
"dropRightWhile": 1,
|
|
6764
6934
|
"dropWhile": 1,
|
|
6765
6935
|
"every": 1,
|
|
@@ -6797,11 +6967,11 @@ var _mapping = {};
|
|
|
6797
6967
|
"times": 1,
|
|
6798
6968
|
"transform": 2
|
|
6799
6969
|
};
|
|
6800
|
-
exports.iterateeRearg = {
|
|
6970
|
+
exports$1.iterateeRearg = {
|
|
6801
6971
|
"mapKeys": [1],
|
|
6802
6972
|
"reduceRight": [1, 0]
|
|
6803
6973
|
};
|
|
6804
|
-
exports.methodRearg = {
|
|
6974
|
+
exports$1.methodRearg = {
|
|
6805
6975
|
"assignInAllWith": [1, 0],
|
|
6806
6976
|
"assignInWith": [1, 2, 0],
|
|
6807
6977
|
"assignAllWith": [1, 0],
|
|
@@ -6832,7 +7002,7 @@ var _mapping = {};
|
|
|
6832
7002
|
"xorWith": [1, 2, 0],
|
|
6833
7003
|
"zipWith": [1, 2, 0]
|
|
6834
7004
|
};
|
|
6835
|
-
exports.methodSpread = {
|
|
7005
|
+
exports$1.methodSpread = {
|
|
6836
7006
|
"assignAll": { "start": 0 },
|
|
6837
7007
|
"assignAllWith": { "start": 0 },
|
|
6838
7008
|
"assignInAll": { "start": 0 },
|
|
@@ -6848,7 +7018,7 @@ var _mapping = {};
|
|
|
6848
7018
|
"without": { "start": 1 },
|
|
6849
7019
|
"zipAll": { "start": 0 }
|
|
6850
7020
|
};
|
|
6851
|
-
exports.mutate = {
|
|
7021
|
+
exports$1.mutate = {
|
|
6852
7022
|
"array": {
|
|
6853
7023
|
"fill": true,
|
|
6854
7024
|
"pull": true,
|
|
@@ -6885,8 +7055,8 @@ var _mapping = {};
|
|
|
6885
7055
|
"updateWith": true
|
|
6886
7056
|
}
|
|
6887
7057
|
};
|
|
6888
|
-
exports.realToAlias = function() {
|
|
6889
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports.aliasToReal, result = {};
|
|
7058
|
+
exports$1.realToAlias = function() {
|
|
7059
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports$1.aliasToReal, result = {};
|
|
6890
7060
|
for (var key in object) {
|
|
6891
7061
|
var value = object[key];
|
|
6892
7062
|
if (hasOwnProperty.call(result, value)) {
|
|
@@ -6897,7 +7067,7 @@ var _mapping = {};
|
|
|
6897
7067
|
}
|
|
6898
7068
|
return result;
|
|
6899
7069
|
}();
|
|
6900
|
-
exports.remap = {
|
|
7070
|
+
exports$1.remap = {
|
|
6901
7071
|
"assignAll": "assign",
|
|
6902
7072
|
"assignAllWith": "assignWith",
|
|
6903
7073
|
"assignInAll": "assignIn",
|
|
@@ -6931,7 +7101,7 @@ var _mapping = {};
|
|
|
6931
7101
|
"trimCharsStart": "trimStart",
|
|
6932
7102
|
"zipAll": "zip"
|
|
6933
7103
|
};
|
|
6934
|
-
exports.skipFixed = {
|
|
7104
|
+
exports$1.skipFixed = {
|
|
6935
7105
|
"castArray": true,
|
|
6936
7106
|
"flow": true,
|
|
6937
7107
|
"flowRight": true,
|
|
@@ -6940,7 +7110,7 @@ var _mapping = {};
|
|
|
6940
7110
|
"rearg": true,
|
|
6941
7111
|
"runInContext": true
|
|
6942
7112
|
};
|
|
6943
|
-
exports.skipRearg = {
|
|
7113
|
+
exports$1.skipRearg = {
|
|
6944
7114
|
"add": true,
|
|
6945
7115
|
"assign": true,
|
|
6946
7116
|
"assignIn": true,
|
|
@@ -8053,9 +8223,9 @@ var _cloneBuffer = {exports: {}};
|
|
|
8053
8223
|
|
|
8054
8224
|
_cloneBuffer.exports;
|
|
8055
8225
|
|
|
8056
|
-
(function (module, exports) {
|
|
8226
|
+
(function (module, exports$1) {
|
|
8057
8227
|
var root = _root;
|
|
8058
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
8228
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
8059
8229
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
8060
8230
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
8061
8231
|
var Buffer = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
@@ -9968,116 +10138,166 @@ const app = (state = defaultState, action) => {
|
|
|
9968
10138
|
};
|
|
9969
10139
|
|
|
9970
10140
|
const BROWSER_ALIASES_MAP = {
|
|
10141
|
+
AmazonBot: "amazonbot",
|
|
9971
10142
|
"Amazon Silk": "amazon_silk",
|
|
9972
10143
|
"Android Browser": "android",
|
|
10144
|
+
BaiduSpider: "baiduspider",
|
|
9973
10145
|
Bada: "bada",
|
|
10146
|
+
BingCrawler: "bingcrawler",
|
|
9974
10147
|
BlackBerry: "blackberry",
|
|
10148
|
+
"ChatGPT-User": "chatgpt_user",
|
|
9975
10149
|
Chrome: "chrome",
|
|
10150
|
+
ClaudeBot: "claudebot",
|
|
9976
10151
|
Chromium: "chromium",
|
|
10152
|
+
Diffbot: "diffbot",
|
|
10153
|
+
DuckDuckBot: "duckduckbot",
|
|
9977
10154
|
Electron: "electron",
|
|
9978
10155
|
Epiphany: "epiphany",
|
|
10156
|
+
FacebookExternalHit: "facebookexternalhit",
|
|
9979
10157
|
Firefox: "firefox",
|
|
9980
10158
|
Focus: "focus",
|
|
9981
10159
|
Generic: "generic",
|
|
9982
10160
|
"Google Search": "google_search",
|
|
9983
10161
|
Googlebot: "googlebot",
|
|
10162
|
+
GPTBot: "gptbot",
|
|
9984
10163
|
"Internet Explorer": "ie",
|
|
10164
|
+
InternetArchiveCrawler: "internetarchivecrawler",
|
|
9985
10165
|
"K-Meleon": "k_meleon",
|
|
10166
|
+
LibreWolf: "librewolf",
|
|
9986
10167
|
Maxthon: "maxthon",
|
|
10168
|
+
"Meta-ExternalAds": "meta_externalads",
|
|
10169
|
+
"Meta-ExternalAgent": "meta_externalagent",
|
|
10170
|
+
"Meta-ExternalFetcher": "meta_externalfetcher",
|
|
10171
|
+
"Meta-WebIndexer": "meta_webindexer",
|
|
9987
10172
|
"Microsoft Edge": "edge",
|
|
9988
10173
|
"MZ Browser": "mz",
|
|
9989
10174
|
"NAVER Whale Browser": "naver",
|
|
10175
|
+
"OAI-SearchBot": "oai_searchbot",
|
|
10176
|
+
Omgilibot: "omgilibot",
|
|
9990
10177
|
Opera: "opera",
|
|
9991
10178
|
"Opera Coast": "opera_coast",
|
|
9992
10179
|
"Pale Moon": "pale_moon",
|
|
10180
|
+
PerplexityBot: "perplexitybot",
|
|
10181
|
+
"Perplexity-User": "perplexity_user",
|
|
9993
10182
|
PhantomJS: "phantomjs",
|
|
10183
|
+
PingdomBot: "pingdombot",
|
|
9994
10184
|
Puffin: "puffin",
|
|
9995
|
-
QupZilla: "qupzilla",
|
|
9996
10185
|
QQ: "qq",
|
|
9997
10186
|
QQLite: "qqlite",
|
|
10187
|
+
QupZilla: "qupzilla",
|
|
10188
|
+
Roku: "roku",
|
|
9998
10189
|
Safari: "safari",
|
|
9999
10190
|
Sailfish: "sailfish",
|
|
10000
10191
|
"Samsung Internet for Android": "samsung_internet",
|
|
10001
10192
|
SeaMonkey: "seamonkey",
|
|
10002
10193
|
Sleipnir: "sleipnir",
|
|
10194
|
+
"Sogou Browser": "sogou",
|
|
10003
10195
|
Swing: "swing",
|
|
10004
10196
|
Tizen: "tizen",
|
|
10005
10197
|
"UC Browser": "uc",
|
|
10006
10198
|
Vivaldi: "vivaldi",
|
|
10007
10199
|
"WebOS Browser": "webos",
|
|
10008
10200
|
WeChat: "wechat",
|
|
10201
|
+
YahooSlurp: "yahooslurp",
|
|
10009
10202
|
"Yandex Browser": "yandex",
|
|
10010
|
-
|
|
10203
|
+
YandexBot: "yandexbot",
|
|
10204
|
+
YouBot: "youbot"
|
|
10011
10205
|
};
|
|
10012
10206
|
const BROWSER_MAP = {
|
|
10207
|
+
amazonbot: "AmazonBot",
|
|
10013
10208
|
amazon_silk: "Amazon Silk",
|
|
10014
10209
|
android: "Android Browser",
|
|
10210
|
+
baiduspider: "BaiduSpider",
|
|
10015
10211
|
bada: "Bada",
|
|
10212
|
+
bingcrawler: "BingCrawler",
|
|
10016
10213
|
blackberry: "BlackBerry",
|
|
10214
|
+
chatgpt_user: "ChatGPT-User",
|
|
10017
10215
|
chrome: "Chrome",
|
|
10216
|
+
claudebot: "ClaudeBot",
|
|
10018
10217
|
chromium: "Chromium",
|
|
10218
|
+
diffbot: "Diffbot",
|
|
10219
|
+
duckduckbot: "DuckDuckBot",
|
|
10220
|
+
edge: "Microsoft Edge",
|
|
10019
10221
|
electron: "Electron",
|
|
10020
10222
|
epiphany: "Epiphany",
|
|
10223
|
+
facebookexternalhit: "FacebookExternalHit",
|
|
10021
10224
|
firefox: "Firefox",
|
|
10022
10225
|
focus: "Focus",
|
|
10023
10226
|
generic: "Generic",
|
|
10024
|
-
googlebot: "Googlebot",
|
|
10025
10227
|
google_search: "Google Search",
|
|
10228
|
+
googlebot: "Googlebot",
|
|
10229
|
+
gptbot: "GPTBot",
|
|
10026
10230
|
ie: "Internet Explorer",
|
|
10231
|
+
internetarchivecrawler: "InternetArchiveCrawler",
|
|
10027
10232
|
k_meleon: "K-Meleon",
|
|
10233
|
+
librewolf: "LibreWolf",
|
|
10028
10234
|
maxthon: "Maxthon",
|
|
10029
|
-
|
|
10235
|
+
meta_externalads: "Meta-ExternalAds",
|
|
10236
|
+
meta_externalagent: "Meta-ExternalAgent",
|
|
10237
|
+
meta_externalfetcher: "Meta-ExternalFetcher",
|
|
10238
|
+
meta_webindexer: "Meta-WebIndexer",
|
|
10030
10239
|
mz: "MZ Browser",
|
|
10031
10240
|
naver: "NAVER Whale Browser",
|
|
10241
|
+
oai_searchbot: "OAI-SearchBot",
|
|
10242
|
+
omgilibot: "Omgilibot",
|
|
10032
10243
|
opera: "Opera",
|
|
10033
10244
|
opera_coast: "Opera Coast",
|
|
10034
10245
|
pale_moon: "Pale Moon",
|
|
10246
|
+
perplexitybot: "PerplexityBot",
|
|
10247
|
+
perplexity_user: "Perplexity-User",
|
|
10035
10248
|
phantomjs: "PhantomJS",
|
|
10249
|
+
pingdombot: "PingdomBot",
|
|
10036
10250
|
puffin: "Puffin",
|
|
10037
|
-
qupzilla: "QupZilla",
|
|
10038
10251
|
qq: "QQ Browser",
|
|
10039
10252
|
qqlite: "QQ Browser Lite",
|
|
10253
|
+
qupzilla: "QupZilla",
|
|
10254
|
+
roku: "Roku",
|
|
10040
10255
|
safari: "Safari",
|
|
10041
10256
|
sailfish: "Sailfish",
|
|
10042
10257
|
samsung_internet: "Samsung Internet for Android",
|
|
10043
10258
|
seamonkey: "SeaMonkey",
|
|
10044
10259
|
sleipnir: "Sleipnir",
|
|
10260
|
+
sogou: "Sogou Browser",
|
|
10045
10261
|
swing: "Swing",
|
|
10046
10262
|
tizen: "Tizen",
|
|
10047
10263
|
uc: "UC Browser",
|
|
10048
10264
|
vivaldi: "Vivaldi",
|
|
10049
10265
|
webos: "WebOS Browser",
|
|
10050
10266
|
wechat: "WeChat",
|
|
10051
|
-
|
|
10267
|
+
yahooslurp: "YahooSlurp",
|
|
10268
|
+
yandex: "Yandex Browser",
|
|
10269
|
+
yandexbot: "YandexBot",
|
|
10270
|
+
youbot: "YouBot"
|
|
10052
10271
|
};
|
|
10053
10272
|
const PLATFORMS_MAP = {
|
|
10054
|
-
|
|
10055
|
-
mobile: "mobile",
|
|
10273
|
+
bot: "bot",
|
|
10056
10274
|
desktop: "desktop",
|
|
10057
|
-
|
|
10058
|
-
|
|
10275
|
+
mobile: "mobile",
|
|
10276
|
+
tablet: "tablet",
|
|
10277
|
+
tv: "tv"
|
|
10059
10278
|
};
|
|
10060
10279
|
const OS_MAP = {
|
|
10061
|
-
WindowsPhone: "Windows Phone",
|
|
10062
|
-
Windows: "Windows",
|
|
10063
|
-
MacOS: "macOS",
|
|
10064
|
-
iOS: "iOS",
|
|
10065
10280
|
Android: "Android",
|
|
10066
|
-
WebOS: "WebOS",
|
|
10067
|
-
BlackBerry: "BlackBerry",
|
|
10068
10281
|
Bada: "Bada",
|
|
10069
|
-
|
|
10070
|
-
Linux: "Linux",
|
|
10282
|
+
BlackBerry: "BlackBerry",
|
|
10071
10283
|
ChromeOS: "Chrome OS",
|
|
10284
|
+
HarmonyOS: "HarmonyOS",
|
|
10285
|
+
iOS: "iOS",
|
|
10286
|
+
Linux: "Linux",
|
|
10287
|
+
MacOS: "macOS",
|
|
10072
10288
|
PlayStation4: "PlayStation 4",
|
|
10073
|
-
Roku: "Roku"
|
|
10289
|
+
Roku: "Roku",
|
|
10290
|
+
Tizen: "Tizen",
|
|
10291
|
+
WebOS: "WebOS",
|
|
10292
|
+
Windows: "Windows",
|
|
10293
|
+
WindowsPhone: "Windows Phone"
|
|
10074
10294
|
};
|
|
10075
10295
|
const ENGINE_MAP = {
|
|
10076
|
-
EdgeHTML: "EdgeHTML",
|
|
10077
10296
|
Blink: "Blink",
|
|
10078
|
-
|
|
10079
|
-
Presto: "Presto",
|
|
10297
|
+
EdgeHTML: "EdgeHTML",
|
|
10080
10298
|
Gecko: "Gecko",
|
|
10299
|
+
Presto: "Presto",
|
|
10300
|
+
Trident: "Trident",
|
|
10081
10301
|
WebKit: "WebKit"
|
|
10082
10302
|
};
|
|
10083
10303
|
|
|
@@ -10154,6 +10374,11 @@ class Utils {
|
|
|
10154
10374
|
* 10.13 - High Sierra
|
|
10155
10375
|
* 10.14 - Mojave
|
|
10156
10376
|
* 10.15 - Catalina
|
|
10377
|
+
* 11 - Big Sur
|
|
10378
|
+
* 12 - Monterey
|
|
10379
|
+
* 13 - Ventura
|
|
10380
|
+
* 14 - Sonoma
|
|
10381
|
+
* 15 - Sequoia
|
|
10157
10382
|
*
|
|
10158
10383
|
* @example
|
|
10159
10384
|
* getMacOSVersionName("10.14") // 'Mojave'
|
|
@@ -10164,30 +10389,47 @@ class Utils {
|
|
|
10164
10389
|
static getMacOSVersionName(version) {
|
|
10165
10390
|
const v = version.split(".").splice(0, 2).map((s) => parseInt(s, 10) || 0);
|
|
10166
10391
|
v.push(0);
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10392
|
+
const major = v[0];
|
|
10393
|
+
const minor = v[1];
|
|
10394
|
+
if (major === 10) {
|
|
10395
|
+
switch (minor) {
|
|
10396
|
+
case 5:
|
|
10397
|
+
return "Leopard";
|
|
10398
|
+
case 6:
|
|
10399
|
+
return "Snow Leopard";
|
|
10400
|
+
case 7:
|
|
10401
|
+
return "Lion";
|
|
10402
|
+
case 8:
|
|
10403
|
+
return "Mountain Lion";
|
|
10404
|
+
case 9:
|
|
10405
|
+
return "Mavericks";
|
|
10406
|
+
case 10:
|
|
10407
|
+
return "Yosemite";
|
|
10408
|
+
case 11:
|
|
10409
|
+
return "El Capitan";
|
|
10410
|
+
case 12:
|
|
10411
|
+
return "Sierra";
|
|
10412
|
+
case 13:
|
|
10413
|
+
return "High Sierra";
|
|
10414
|
+
case 14:
|
|
10415
|
+
return "Mojave";
|
|
10416
|
+
case 15:
|
|
10417
|
+
return "Catalina";
|
|
10418
|
+
default:
|
|
10419
|
+
return void 0;
|
|
10420
|
+
}
|
|
10421
|
+
}
|
|
10422
|
+
switch (major) {
|
|
10181
10423
|
case 11:
|
|
10182
|
-
return "
|
|
10424
|
+
return "Big Sur";
|
|
10183
10425
|
case 12:
|
|
10184
|
-
return "
|
|
10426
|
+
return "Monterey";
|
|
10185
10427
|
case 13:
|
|
10186
|
-
return "
|
|
10428
|
+
return "Ventura";
|
|
10187
10429
|
case 14:
|
|
10188
|
-
return "
|
|
10430
|
+
return "Sonoma";
|
|
10189
10431
|
case 15:
|
|
10190
|
-
return "
|
|
10432
|
+
return "Sequoia";
|
|
10191
10433
|
default:
|
|
10192
10434
|
return void 0;
|
|
10193
10435
|
}
|
|
@@ -10386,6 +10628,188 @@ class Utils {
|
|
|
10386
10628
|
|
|
10387
10629
|
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
10388
10630
|
const browsersList = [
|
|
10631
|
+
/* GPTBot */
|
|
10632
|
+
{
|
|
10633
|
+
test: [/gptbot/i],
|
|
10634
|
+
describe(ua) {
|
|
10635
|
+
const browser = {
|
|
10636
|
+
name: "GPTBot"
|
|
10637
|
+
};
|
|
10638
|
+
const version = Utils.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10639
|
+
if (version) {
|
|
10640
|
+
browser.version = version;
|
|
10641
|
+
}
|
|
10642
|
+
return browser;
|
|
10643
|
+
}
|
|
10644
|
+
},
|
|
10645
|
+
/* ChatGPT-User */
|
|
10646
|
+
{
|
|
10647
|
+
test: [/chatgpt-user/i],
|
|
10648
|
+
describe(ua) {
|
|
10649
|
+
const browser = {
|
|
10650
|
+
name: "ChatGPT-User"
|
|
10651
|
+
};
|
|
10652
|
+
const version = Utils.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10653
|
+
if (version) {
|
|
10654
|
+
browser.version = version;
|
|
10655
|
+
}
|
|
10656
|
+
return browser;
|
|
10657
|
+
}
|
|
10658
|
+
},
|
|
10659
|
+
/* OAI-SearchBot */
|
|
10660
|
+
{
|
|
10661
|
+
test: [/oai-searchbot/i],
|
|
10662
|
+
describe(ua) {
|
|
10663
|
+
const browser = {
|
|
10664
|
+
name: "OAI-SearchBot"
|
|
10665
|
+
};
|
|
10666
|
+
const version = Utils.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10667
|
+
if (version) {
|
|
10668
|
+
browser.version = version;
|
|
10669
|
+
}
|
|
10670
|
+
return browser;
|
|
10671
|
+
}
|
|
10672
|
+
},
|
|
10673
|
+
/* ClaudeBot */
|
|
10674
|
+
{
|
|
10675
|
+
test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
|
|
10676
|
+
describe(ua) {
|
|
10677
|
+
const browser = {
|
|
10678
|
+
name: "ClaudeBot"
|
|
10679
|
+
};
|
|
10680
|
+
const version = Utils.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10681
|
+
if (version) {
|
|
10682
|
+
browser.version = version;
|
|
10683
|
+
}
|
|
10684
|
+
return browser;
|
|
10685
|
+
}
|
|
10686
|
+
},
|
|
10687
|
+
/* Omgilibot */
|
|
10688
|
+
{
|
|
10689
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
10690
|
+
describe(ua) {
|
|
10691
|
+
const browser = {
|
|
10692
|
+
name: "Omgilibot"
|
|
10693
|
+
};
|
|
10694
|
+
const version = Utils.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10695
|
+
if (version) {
|
|
10696
|
+
browser.version = version;
|
|
10697
|
+
}
|
|
10698
|
+
return browser;
|
|
10699
|
+
}
|
|
10700
|
+
},
|
|
10701
|
+
/* Diffbot */
|
|
10702
|
+
{
|
|
10703
|
+
test: [/diffbot/i],
|
|
10704
|
+
describe(ua) {
|
|
10705
|
+
const browser = {
|
|
10706
|
+
name: "Diffbot"
|
|
10707
|
+
};
|
|
10708
|
+
const version = Utils.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10709
|
+
if (version) {
|
|
10710
|
+
browser.version = version;
|
|
10711
|
+
}
|
|
10712
|
+
return browser;
|
|
10713
|
+
}
|
|
10714
|
+
},
|
|
10715
|
+
/* PerplexityBot */
|
|
10716
|
+
{
|
|
10717
|
+
test: [/perplexitybot/i],
|
|
10718
|
+
describe(ua) {
|
|
10719
|
+
const browser = {
|
|
10720
|
+
name: "PerplexityBot"
|
|
10721
|
+
};
|
|
10722
|
+
const version = Utils.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10723
|
+
if (version) {
|
|
10724
|
+
browser.version = version;
|
|
10725
|
+
}
|
|
10726
|
+
return browser;
|
|
10727
|
+
}
|
|
10728
|
+
},
|
|
10729
|
+
/* Perplexity-User */
|
|
10730
|
+
{
|
|
10731
|
+
test: [/perplexity-user/i],
|
|
10732
|
+
describe(ua) {
|
|
10733
|
+
const browser = {
|
|
10734
|
+
name: "Perplexity-User"
|
|
10735
|
+
};
|
|
10736
|
+
const version = Utils.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10737
|
+
if (version) {
|
|
10738
|
+
browser.version = version;
|
|
10739
|
+
}
|
|
10740
|
+
return browser;
|
|
10741
|
+
}
|
|
10742
|
+
},
|
|
10743
|
+
/* YouBot */
|
|
10744
|
+
{
|
|
10745
|
+
test: [/youbot/i],
|
|
10746
|
+
describe(ua) {
|
|
10747
|
+
const browser = {
|
|
10748
|
+
name: "YouBot"
|
|
10749
|
+
};
|
|
10750
|
+
const version = Utils.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10751
|
+
if (version) {
|
|
10752
|
+
browser.version = version;
|
|
10753
|
+
}
|
|
10754
|
+
return browser;
|
|
10755
|
+
}
|
|
10756
|
+
},
|
|
10757
|
+
/* Meta-WebIndexer */
|
|
10758
|
+
{
|
|
10759
|
+
test: [/meta-webindexer/i],
|
|
10760
|
+
describe(ua) {
|
|
10761
|
+
const browser = {
|
|
10762
|
+
name: "Meta-WebIndexer"
|
|
10763
|
+
};
|
|
10764
|
+
const version = Utils.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10765
|
+
if (version) {
|
|
10766
|
+
browser.version = version;
|
|
10767
|
+
}
|
|
10768
|
+
return browser;
|
|
10769
|
+
}
|
|
10770
|
+
},
|
|
10771
|
+
/* Meta-ExternalAds */
|
|
10772
|
+
{
|
|
10773
|
+
test: [/meta-externalads/i],
|
|
10774
|
+
describe(ua) {
|
|
10775
|
+
const browser = {
|
|
10776
|
+
name: "Meta-ExternalAds"
|
|
10777
|
+
};
|
|
10778
|
+
const version = Utils.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10779
|
+
if (version) {
|
|
10780
|
+
browser.version = version;
|
|
10781
|
+
}
|
|
10782
|
+
return browser;
|
|
10783
|
+
}
|
|
10784
|
+
},
|
|
10785
|
+
/* Meta-ExternalAgent */
|
|
10786
|
+
{
|
|
10787
|
+
test: [/meta-externalagent/i],
|
|
10788
|
+
describe(ua) {
|
|
10789
|
+
const browser = {
|
|
10790
|
+
name: "Meta-ExternalAgent"
|
|
10791
|
+
};
|
|
10792
|
+
const version = Utils.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10793
|
+
if (version) {
|
|
10794
|
+
browser.version = version;
|
|
10795
|
+
}
|
|
10796
|
+
return browser;
|
|
10797
|
+
}
|
|
10798
|
+
},
|
|
10799
|
+
/* Meta-ExternalFetcher */
|
|
10800
|
+
{
|
|
10801
|
+
test: [/meta-externalfetcher/i],
|
|
10802
|
+
describe(ua) {
|
|
10803
|
+
const browser = {
|
|
10804
|
+
name: "Meta-ExternalFetcher"
|
|
10805
|
+
};
|
|
10806
|
+
const version = Utils.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10807
|
+
if (version) {
|
|
10808
|
+
browser.version = version;
|
|
10809
|
+
}
|
|
10810
|
+
return browser;
|
|
10811
|
+
}
|
|
10812
|
+
},
|
|
10389
10813
|
/* Googlebot */
|
|
10390
10814
|
{
|
|
10391
10815
|
test: [/googlebot/i],
|
|
@@ -10400,6 +10824,112 @@ const browsersList = [
|
|
|
10400
10824
|
return browser;
|
|
10401
10825
|
}
|
|
10402
10826
|
},
|
|
10827
|
+
/* AmazonBot */
|
|
10828
|
+
{
|
|
10829
|
+
test: [/amazonbot/i],
|
|
10830
|
+
describe(ua) {
|
|
10831
|
+
const browser = {
|
|
10832
|
+
name: "AmazonBot"
|
|
10833
|
+
};
|
|
10834
|
+
const version = Utils.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10835
|
+
if (version) {
|
|
10836
|
+
browser.version = version;
|
|
10837
|
+
}
|
|
10838
|
+
return browser;
|
|
10839
|
+
}
|
|
10840
|
+
},
|
|
10841
|
+
/* BingCrawler */
|
|
10842
|
+
{
|
|
10843
|
+
test: [/bingbot/i],
|
|
10844
|
+
describe(ua) {
|
|
10845
|
+
const browser = {
|
|
10846
|
+
name: "BingCrawler"
|
|
10847
|
+
};
|
|
10848
|
+
const version = Utils.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10849
|
+
if (version) {
|
|
10850
|
+
browser.version = version;
|
|
10851
|
+
}
|
|
10852
|
+
return browser;
|
|
10853
|
+
}
|
|
10854
|
+
},
|
|
10855
|
+
/* BaiduSpider */
|
|
10856
|
+
{
|
|
10857
|
+
test: [/baiduspider/i],
|
|
10858
|
+
describe(ua) {
|
|
10859
|
+
const browser = {
|
|
10860
|
+
name: "BaiduSpider"
|
|
10861
|
+
};
|
|
10862
|
+
const version = Utils.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10863
|
+
if (version) {
|
|
10864
|
+
browser.version = version;
|
|
10865
|
+
}
|
|
10866
|
+
return browser;
|
|
10867
|
+
}
|
|
10868
|
+
},
|
|
10869
|
+
/* DuckDuckBot */
|
|
10870
|
+
{
|
|
10871
|
+
test: [/duckduckbot/i],
|
|
10872
|
+
describe(ua) {
|
|
10873
|
+
const browser = {
|
|
10874
|
+
name: "DuckDuckBot"
|
|
10875
|
+
};
|
|
10876
|
+
const version = Utils.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10877
|
+
if (version) {
|
|
10878
|
+
browser.version = version;
|
|
10879
|
+
}
|
|
10880
|
+
return browser;
|
|
10881
|
+
}
|
|
10882
|
+
},
|
|
10883
|
+
/* InternetArchiveCrawler */
|
|
10884
|
+
{
|
|
10885
|
+
test: [/ia_archiver/i],
|
|
10886
|
+
describe(ua) {
|
|
10887
|
+
const browser = {
|
|
10888
|
+
name: "InternetArchiveCrawler"
|
|
10889
|
+
};
|
|
10890
|
+
const version = Utils.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10891
|
+
if (version) {
|
|
10892
|
+
browser.version = version;
|
|
10893
|
+
}
|
|
10894
|
+
return browser;
|
|
10895
|
+
}
|
|
10896
|
+
},
|
|
10897
|
+
/* FacebookExternalHit */
|
|
10898
|
+
{
|
|
10899
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
10900
|
+
describe() {
|
|
10901
|
+
return {
|
|
10902
|
+
name: "FacebookExternalHit"
|
|
10903
|
+
};
|
|
10904
|
+
}
|
|
10905
|
+
},
|
|
10906
|
+
/* YahooSlurp */
|
|
10907
|
+
{
|
|
10908
|
+
test: [/yahoo!?[\s/]*slurp/i],
|
|
10909
|
+
describe() {
|
|
10910
|
+
return {
|
|
10911
|
+
name: "YahooSlurp"
|
|
10912
|
+
};
|
|
10913
|
+
}
|
|
10914
|
+
},
|
|
10915
|
+
/* YandexBot */
|
|
10916
|
+
{
|
|
10917
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
10918
|
+
describe() {
|
|
10919
|
+
return {
|
|
10920
|
+
name: "YandexBot"
|
|
10921
|
+
};
|
|
10922
|
+
}
|
|
10923
|
+
},
|
|
10924
|
+
/* PingdomBot */
|
|
10925
|
+
{
|
|
10926
|
+
test: [/pingdom/i],
|
|
10927
|
+
describe() {
|
|
10928
|
+
return {
|
|
10929
|
+
name: "PingdomBot"
|
|
10930
|
+
};
|
|
10931
|
+
}
|
|
10932
|
+
},
|
|
10403
10933
|
/* Opera < 13.0 */
|
|
10404
10934
|
{
|
|
10405
10935
|
test: [/opera/i],
|
|
@@ -10831,6 +11361,19 @@ const browsersList = [
|
|
|
10831
11361
|
return browser;
|
|
10832
11362
|
}
|
|
10833
11363
|
},
|
|
11364
|
+
{
|
|
11365
|
+
test: [/librewolf/i],
|
|
11366
|
+
describe(ua) {
|
|
11367
|
+
const browser = {
|
|
11368
|
+
name: "LibreWolf"
|
|
11369
|
+
};
|
|
11370
|
+
const version = Utils.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
11371
|
+
if (version) {
|
|
11372
|
+
browser.version = version;
|
|
11373
|
+
}
|
|
11374
|
+
return browser;
|
|
11375
|
+
}
|
|
11376
|
+
},
|
|
10834
11377
|
{
|
|
10835
11378
|
test: [/firefox|iceweasel|fxios/i],
|
|
10836
11379
|
describe(ua) {
|
|
@@ -10857,6 +11400,22 @@ const browsersList = [
|
|
|
10857
11400
|
return browser;
|
|
10858
11401
|
}
|
|
10859
11402
|
},
|
|
11403
|
+
{
|
|
11404
|
+
test: [/sogoumobilebrowser/i, /metasr/i, /se 2\.[x]/i],
|
|
11405
|
+
describe(ua) {
|
|
11406
|
+
const browser = {
|
|
11407
|
+
name: "Sogou Browser"
|
|
11408
|
+
};
|
|
11409
|
+
const sogouMobileVersion = Utils.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
11410
|
+
const chromiumVersion = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
11411
|
+
const seVersion = Utils.getFirstMatch(/se ([\d.]+)x/i, ua);
|
|
11412
|
+
const version = sogouMobileVersion || chromiumVersion || seVersion;
|
|
11413
|
+
if (version) {
|
|
11414
|
+
browser.version = version;
|
|
11415
|
+
}
|
|
11416
|
+
return browser;
|
|
11417
|
+
}
|
|
11418
|
+
},
|
|
10860
11419
|
{
|
|
10861
11420
|
test: [/MiuiBrowser/i],
|
|
10862
11421
|
describe(ua) {
|
|
@@ -11048,6 +11607,17 @@ const osParsersList = [
|
|
|
11048
11607
|
};
|
|
11049
11608
|
}
|
|
11050
11609
|
},
|
|
11610
|
+
/* HarmonyOS */
|
|
11611
|
+
{
|
|
11612
|
+
test: [/OpenHarmony/i],
|
|
11613
|
+
describe(ua) {
|
|
11614
|
+
const version = Utils.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i, ua);
|
|
11615
|
+
return {
|
|
11616
|
+
name: OS_MAP.HarmonyOS,
|
|
11617
|
+
version
|
|
11618
|
+
};
|
|
11619
|
+
}
|
|
11620
|
+
},
|
|
11051
11621
|
/* Android */
|
|
11052
11622
|
{
|
|
11053
11623
|
test(parser) {
|
|
@@ -11157,6 +11727,226 @@ const platformParsersList = [
|
|
|
11157
11727
|
};
|
|
11158
11728
|
}
|
|
11159
11729
|
},
|
|
11730
|
+
/* AmazonBot */
|
|
11731
|
+
{
|
|
11732
|
+
test: [/amazonbot/i],
|
|
11733
|
+
describe() {
|
|
11734
|
+
return {
|
|
11735
|
+
type: PLATFORMS_MAP.bot,
|
|
11736
|
+
vendor: "Amazon"
|
|
11737
|
+
};
|
|
11738
|
+
}
|
|
11739
|
+
},
|
|
11740
|
+
/* GPTBot */
|
|
11741
|
+
{
|
|
11742
|
+
test: [/gptbot/i],
|
|
11743
|
+
describe() {
|
|
11744
|
+
return {
|
|
11745
|
+
type: PLATFORMS_MAP.bot,
|
|
11746
|
+
vendor: "OpenAI"
|
|
11747
|
+
};
|
|
11748
|
+
}
|
|
11749
|
+
},
|
|
11750
|
+
/* ChatGPT-User */
|
|
11751
|
+
{
|
|
11752
|
+
test: [/chatgpt-user/i],
|
|
11753
|
+
describe() {
|
|
11754
|
+
return {
|
|
11755
|
+
type: PLATFORMS_MAP.bot,
|
|
11756
|
+
vendor: "OpenAI"
|
|
11757
|
+
};
|
|
11758
|
+
}
|
|
11759
|
+
},
|
|
11760
|
+
/* OAI-SearchBot */
|
|
11761
|
+
{
|
|
11762
|
+
test: [/oai-searchbot/i],
|
|
11763
|
+
describe() {
|
|
11764
|
+
return {
|
|
11765
|
+
type: PLATFORMS_MAP.bot,
|
|
11766
|
+
vendor: "OpenAI"
|
|
11767
|
+
};
|
|
11768
|
+
}
|
|
11769
|
+
},
|
|
11770
|
+
/* Baidu */
|
|
11771
|
+
{
|
|
11772
|
+
test: [/baiduspider/i],
|
|
11773
|
+
describe() {
|
|
11774
|
+
return {
|
|
11775
|
+
type: PLATFORMS_MAP.bot,
|
|
11776
|
+
vendor: "Baidu"
|
|
11777
|
+
};
|
|
11778
|
+
}
|
|
11779
|
+
},
|
|
11780
|
+
/* Bingbot */
|
|
11781
|
+
{
|
|
11782
|
+
test: [/bingbot/i],
|
|
11783
|
+
describe() {
|
|
11784
|
+
return {
|
|
11785
|
+
type: PLATFORMS_MAP.bot,
|
|
11786
|
+
vendor: "Bing"
|
|
11787
|
+
};
|
|
11788
|
+
}
|
|
11789
|
+
},
|
|
11790
|
+
/* DuckDuckBot */
|
|
11791
|
+
{
|
|
11792
|
+
test: [/duckduckbot/i],
|
|
11793
|
+
describe() {
|
|
11794
|
+
return {
|
|
11795
|
+
type: PLATFORMS_MAP.bot,
|
|
11796
|
+
vendor: "DuckDuckGo"
|
|
11797
|
+
};
|
|
11798
|
+
}
|
|
11799
|
+
},
|
|
11800
|
+
/* ClaudeBot */
|
|
11801
|
+
{
|
|
11802
|
+
test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
|
|
11803
|
+
describe() {
|
|
11804
|
+
return {
|
|
11805
|
+
type: PLATFORMS_MAP.bot,
|
|
11806
|
+
vendor: "Anthropic"
|
|
11807
|
+
};
|
|
11808
|
+
}
|
|
11809
|
+
},
|
|
11810
|
+
/* Omgilibot */
|
|
11811
|
+
{
|
|
11812
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
11813
|
+
describe() {
|
|
11814
|
+
return {
|
|
11815
|
+
type: PLATFORMS_MAP.bot,
|
|
11816
|
+
vendor: "Webz.io"
|
|
11817
|
+
};
|
|
11818
|
+
}
|
|
11819
|
+
},
|
|
11820
|
+
/* Diffbot */
|
|
11821
|
+
{
|
|
11822
|
+
test: [/diffbot/i],
|
|
11823
|
+
describe() {
|
|
11824
|
+
return {
|
|
11825
|
+
type: PLATFORMS_MAP.bot,
|
|
11826
|
+
vendor: "Diffbot"
|
|
11827
|
+
};
|
|
11828
|
+
}
|
|
11829
|
+
},
|
|
11830
|
+
/* PerplexityBot */
|
|
11831
|
+
{
|
|
11832
|
+
test: [/perplexitybot/i],
|
|
11833
|
+
describe() {
|
|
11834
|
+
return {
|
|
11835
|
+
type: PLATFORMS_MAP.bot,
|
|
11836
|
+
vendor: "Perplexity AI"
|
|
11837
|
+
};
|
|
11838
|
+
}
|
|
11839
|
+
},
|
|
11840
|
+
/* Perplexity-User */
|
|
11841
|
+
{
|
|
11842
|
+
test: [/perplexity-user/i],
|
|
11843
|
+
describe() {
|
|
11844
|
+
return {
|
|
11845
|
+
type: PLATFORMS_MAP.bot,
|
|
11846
|
+
vendor: "Perplexity AI"
|
|
11847
|
+
};
|
|
11848
|
+
}
|
|
11849
|
+
},
|
|
11850
|
+
/* YouBot */
|
|
11851
|
+
{
|
|
11852
|
+
test: [/youbot/i],
|
|
11853
|
+
describe() {
|
|
11854
|
+
return {
|
|
11855
|
+
type: PLATFORMS_MAP.bot,
|
|
11856
|
+
vendor: "You.com"
|
|
11857
|
+
};
|
|
11858
|
+
}
|
|
11859
|
+
},
|
|
11860
|
+
/* Internet Archive Crawler */
|
|
11861
|
+
{
|
|
11862
|
+
test: [/ia_archiver/i],
|
|
11863
|
+
describe() {
|
|
11864
|
+
return {
|
|
11865
|
+
type: PLATFORMS_MAP.bot,
|
|
11866
|
+
vendor: "Internet Archive"
|
|
11867
|
+
};
|
|
11868
|
+
}
|
|
11869
|
+
},
|
|
11870
|
+
/* Meta-WebIndexer */
|
|
11871
|
+
{
|
|
11872
|
+
test: [/meta-webindexer/i],
|
|
11873
|
+
describe() {
|
|
11874
|
+
return {
|
|
11875
|
+
type: PLATFORMS_MAP.bot,
|
|
11876
|
+
vendor: "Meta"
|
|
11877
|
+
};
|
|
11878
|
+
}
|
|
11879
|
+
},
|
|
11880
|
+
/* Meta-ExternalAds */
|
|
11881
|
+
{
|
|
11882
|
+
test: [/meta-externalads/i],
|
|
11883
|
+
describe() {
|
|
11884
|
+
return {
|
|
11885
|
+
type: PLATFORMS_MAP.bot,
|
|
11886
|
+
vendor: "Meta"
|
|
11887
|
+
};
|
|
11888
|
+
}
|
|
11889
|
+
},
|
|
11890
|
+
/* Meta-ExternalAgent */
|
|
11891
|
+
{
|
|
11892
|
+
test: [/meta-externalagent/i],
|
|
11893
|
+
describe() {
|
|
11894
|
+
return {
|
|
11895
|
+
type: PLATFORMS_MAP.bot,
|
|
11896
|
+
vendor: "Meta"
|
|
11897
|
+
};
|
|
11898
|
+
}
|
|
11899
|
+
},
|
|
11900
|
+
/* Meta-ExternalFetcher */
|
|
11901
|
+
{
|
|
11902
|
+
test: [/meta-externalfetcher/i],
|
|
11903
|
+
describe() {
|
|
11904
|
+
return {
|
|
11905
|
+
type: PLATFORMS_MAP.bot,
|
|
11906
|
+
vendor: "Meta"
|
|
11907
|
+
};
|
|
11908
|
+
}
|
|
11909
|
+
},
|
|
11910
|
+
/* Meta Web Crawler */
|
|
11911
|
+
{
|
|
11912
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
11913
|
+
describe() {
|
|
11914
|
+
return {
|
|
11915
|
+
type: PLATFORMS_MAP.bot,
|
|
11916
|
+
vendor: "Meta"
|
|
11917
|
+
};
|
|
11918
|
+
}
|
|
11919
|
+
},
|
|
11920
|
+
/* Yahoo! Slurp */
|
|
11921
|
+
{
|
|
11922
|
+
test: [/yahoo/i],
|
|
11923
|
+
describe() {
|
|
11924
|
+
return {
|
|
11925
|
+
type: PLATFORMS_MAP.bot,
|
|
11926
|
+
vendor: "Yahoo"
|
|
11927
|
+
};
|
|
11928
|
+
}
|
|
11929
|
+
},
|
|
11930
|
+
/* Yandex */
|
|
11931
|
+
{
|
|
11932
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
11933
|
+
describe() {
|
|
11934
|
+
return {
|
|
11935
|
+
type: PLATFORMS_MAP.bot,
|
|
11936
|
+
vendor: "Yandex"
|
|
11937
|
+
};
|
|
11938
|
+
}
|
|
11939
|
+
},
|
|
11940
|
+
/* Pingdom */
|
|
11941
|
+
{
|
|
11942
|
+
test: [/pingdom/i],
|
|
11943
|
+
describe() {
|
|
11944
|
+
return {
|
|
11945
|
+
type: PLATFORMS_MAP.bot,
|
|
11946
|
+
vendor: "Pingdom"
|
|
11947
|
+
};
|
|
11948
|
+
}
|
|
11949
|
+
},
|
|
11160
11950
|
/* Huawei */
|
|
11161
11951
|
{
|
|
11162
11952
|
test: [/huawei/i],
|
|
@@ -12139,20 +12929,20 @@ var mods = {};
|
|
|
12139
12929
|
|
|
12140
12930
|
var utils = {};
|
|
12141
12931
|
|
|
12142
|
-
(function (exports) {
|
|
12143
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12144
|
-
exports.updateValues = exports.removeSuffix = exports.addSuffix = exports.splitTokens = exports.collapseTokens = exports.expandTokens = exports.getTokenType = exports.deepMerge = exports.isObject = void 0;
|
|
12932
|
+
(function (exports$1) {
|
|
12933
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
12934
|
+
exports$1.updateValues = exports$1.removeSuffix = exports$1.addSuffix = exports$1.splitTokens = exports$1.collapseTokens = exports$1.expandTokens = exports$1.getTokenType = exports$1.deepMerge = exports$1.isObject = void 0;
|
|
12145
12935
|
const isObject = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
12146
|
-
exports.isObject = isObject;
|
|
12936
|
+
exports$1.isObject = isObject;
|
|
12147
12937
|
const deepMerge = (target, source) => {
|
|
12148
12938
|
let retValues = Object.assign({}, target);
|
|
12149
|
-
if ((0, exports.isObject)(target) && (0, exports.isObject)(source)) {
|
|
12939
|
+
if ((0, exports$1.isObject)(target) && (0, exports$1.isObject)(source)) {
|
|
12150
12940
|
Object.keys(source).forEach((key) => {
|
|
12151
|
-
if ((0, exports.isObject)(source[key])) {
|
|
12941
|
+
if ((0, exports$1.isObject)(source[key])) {
|
|
12152
12942
|
if (!(key in target)) {
|
|
12153
12943
|
Object.assign(retValues, { [key]: source[key] });
|
|
12154
12944
|
} else {
|
|
12155
|
-
retValues[key] = (0, exports.deepMerge)(target[key], source[key]);
|
|
12945
|
+
retValues[key] = (0, exports$1.deepMerge)(target[key], source[key]);
|
|
12156
12946
|
}
|
|
12157
12947
|
} else {
|
|
12158
12948
|
Object.assign(retValues, { [key]: source[key] });
|
|
@@ -12161,7 +12951,7 @@ var utils = {};
|
|
|
12161
12951
|
}
|
|
12162
12952
|
return retValues;
|
|
12163
12953
|
};
|
|
12164
|
-
exports.deepMerge = deepMerge;
|
|
12954
|
+
exports$1.deepMerge = deepMerge;
|
|
12165
12955
|
const getTokenType = (token, core, leaf) => {
|
|
12166
12956
|
let tokenType = "new";
|
|
12167
12957
|
const coreKeys = Object.keys(core);
|
|
@@ -12188,7 +12978,7 @@ var utils = {};
|
|
|
12188
12978
|
});
|
|
12189
12979
|
return tokenType;
|
|
12190
12980
|
};
|
|
12191
|
-
exports.getTokenType = getTokenType;
|
|
12981
|
+
exports$1.getTokenType = getTokenType;
|
|
12192
12982
|
const expandTokens = (tokens) => {
|
|
12193
12983
|
let tokenList = [];
|
|
12194
12984
|
const rootEntries = Object.entries(tokens);
|
|
@@ -12201,13 +12991,13 @@ var utils = {};
|
|
|
12201
12991
|
});
|
|
12202
12992
|
return tokenList;
|
|
12203
12993
|
};
|
|
12204
|
-
exports.expandTokens = expandTokens;
|
|
12994
|
+
exports$1.expandTokens = expandTokens;
|
|
12205
12995
|
const collapseTokens = (tokenList) => {
|
|
12206
12996
|
let retToken = {};
|
|
12207
|
-
tokenList.map((token) => retToken = Object.assign({}, (0, exports.deepMerge)(retToken, token)));
|
|
12997
|
+
tokenList.map((token) => retToken = Object.assign({}, (0, exports$1.deepMerge)(retToken, token)));
|
|
12208
12998
|
return retToken;
|
|
12209
12999
|
};
|
|
12210
|
-
exports.collapseTokens = collapseTokens;
|
|
13000
|
+
exports$1.collapseTokens = collapseTokens;
|
|
12211
13001
|
const splitTokens = (tokens, core, leaf) => {
|
|
12212
13002
|
const partitionedLists = {
|
|
12213
13003
|
defaultTokens: {
|
|
@@ -12220,9 +13010,9 @@ var utils = {};
|
|
|
12220
13010
|
new: []
|
|
12221
13011
|
}
|
|
12222
13012
|
};
|
|
12223
|
-
const tokenList = (0, exports.expandTokens)(tokens);
|
|
13013
|
+
const tokenList = (0, exports$1.expandTokens)(tokens);
|
|
12224
13014
|
tokenList.map((token) => {
|
|
12225
|
-
const tokenType = (0, exports.getTokenType)(token, core, leaf);
|
|
13015
|
+
const tokenType = (0, exports$1.getTokenType)(token, core, leaf);
|
|
12226
13016
|
if (tokenType === "core-default") {
|
|
12227
13017
|
partitionedLists.defaultTokens.core.push(token);
|
|
12228
13018
|
} else if (tokenType === "core-updated") {
|
|
@@ -12237,7 +13027,7 @@ var utils = {};
|
|
|
12237
13027
|
});
|
|
12238
13028
|
return partitionedLists;
|
|
12239
13029
|
};
|
|
12240
|
-
exports.splitTokens = splitTokens;
|
|
13030
|
+
exports$1.splitTokens = splitTokens;
|
|
12241
13031
|
const addSuffix = (json, suffix = "px") => {
|
|
12242
13032
|
let retValues = {};
|
|
12243
13033
|
Object.keys(json).forEach(function(key) {
|
|
@@ -12245,7 +13035,7 @@ var utils = {};
|
|
|
12245
13035
|
});
|
|
12246
13036
|
return Object.assign({}, json, retValues);
|
|
12247
13037
|
};
|
|
12248
|
-
exports.addSuffix = addSuffix;
|
|
13038
|
+
exports$1.addSuffix = addSuffix;
|
|
12249
13039
|
const removeSuffix = (json, suffix = "px") => {
|
|
12250
13040
|
let retValues = {};
|
|
12251
13041
|
Object.keys(json).forEach((key) => {
|
|
@@ -12257,15 +13047,15 @@ var utils = {};
|
|
|
12257
13047
|
});
|
|
12258
13048
|
return Object.assign({}, json, retValues);
|
|
12259
13049
|
};
|
|
12260
|
-
exports.removeSuffix = removeSuffix;
|
|
13050
|
+
exports$1.removeSuffix = removeSuffix;
|
|
12261
13051
|
const updateValues = (json, value = "") => {
|
|
12262
13052
|
let retValues = {};
|
|
12263
13053
|
Object.keys(json).forEach(function(key) {
|
|
12264
|
-
retValues[key] = (0, exports.isObject)(value) ? Object.assign({}, retValues, value) : value;
|
|
13054
|
+
retValues[key] = (0, exports$1.isObject)(value) ? Object.assign({}, retValues, value) : value;
|
|
12265
13055
|
});
|
|
12266
13056
|
return Object.assign({}, json, retValues);
|
|
12267
13057
|
};
|
|
12268
|
-
exports.updateValues = updateValues;
|
|
13058
|
+
exports$1.updateValues = updateValues;
|
|
12269
13059
|
} (utils));
|
|
12270
13060
|
|
|
12271
13061
|
var hasRequiredMods;
|
|
@@ -12996,12 +13786,12 @@ var hasRequiredDist;
|
|
|
12996
13786
|
function requireDist () {
|
|
12997
13787
|
if (hasRequiredDist) return dist$1;
|
|
12998
13788
|
hasRequiredDist = 1;
|
|
12999
|
-
(function (exports) {
|
|
13789
|
+
(function (exports$1) {
|
|
13000
13790
|
var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
|
13001
13791
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
13002
13792
|
};
|
|
13003
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13004
|
-
exports.dark = exports.light = exports.buildTheme = exports.themes = exports.targets = void 0;
|
|
13793
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
13794
|
+
exports$1.dark = exports$1.light = exports$1.buildTheme = exports$1.themes = exports$1.targets = void 0;
|
|
13005
13795
|
const core_1 = __importDefault(core);
|
|
13006
13796
|
const mods_1 = requireMods();
|
|
13007
13797
|
const utils_1 = utils;
|
|
@@ -13013,26 +13803,26 @@ function requireDist () {
|
|
|
13013
13803
|
const spacing_1 = __importDefault(spacing);
|
|
13014
13804
|
const textColor_1 = __importDefault(textColor);
|
|
13015
13805
|
const zIndex_1 = __importDefault(zIndex$3);
|
|
13016
|
-
exports.targets = {
|
|
13806
|
+
exports$1.targets = {
|
|
13017
13807
|
REACT: "react",
|
|
13018
13808
|
REACT_NATIVE: "react_native",
|
|
13019
13809
|
NATIVE: "native"
|
|
13020
13810
|
};
|
|
13021
|
-
exports.themes = {
|
|
13811
|
+
exports$1.themes = {
|
|
13022
13812
|
LIGHT: "light",
|
|
13023
13813
|
DARK: "dark"
|
|
13024
13814
|
};
|
|
13025
|
-
const getSectionTokens = (theme = exports.themes.LIGHT, base = core_1.default) => ({
|
|
13026
|
-
BackgroundColor: theme === exports.themes.LIGHT ? backgroundColor_1.default.light(base) : backgroundColor_1.default.dark(base),
|
|
13027
|
-
BorderColor: theme === exports.themes.LIGHT ? borderColor_1.default.light(base) : borderColor_1.default.dark(base),
|
|
13028
|
-
BorderRadius: theme === exports.themes.LIGHT ? borderRadius_1.default.light(base) : borderRadius_1.default.dark(base),
|
|
13029
|
-
BoxShadow: theme === exports.themes.LIGHT ? boxShadow_1.default.light(base) : boxShadow_1.default.dark(base),
|
|
13030
|
-
FontSize: theme === exports.themes.LIGHT ? fontSize_1.default.light(base) : fontSize_1.default.dark(base),
|
|
13031
|
-
Spacing: theme === exports.themes.LIGHT ? spacing_1.default.light(base) : spacing_1.default.dark(base),
|
|
13032
|
-
TextColor: theme === exports.themes.LIGHT ? textColor_1.default.light(base) : textColor_1.default.dark(base),
|
|
13033
|
-
ZIndex: theme === exports.themes.LIGHT ? zIndex_1.default.light(base) : zIndex_1.default.dark(base)
|
|
13815
|
+
const getSectionTokens = (theme = exports$1.themes.LIGHT, base = core_1.default) => ({
|
|
13816
|
+
BackgroundColor: theme === exports$1.themes.LIGHT ? backgroundColor_1.default.light(base) : backgroundColor_1.default.dark(base),
|
|
13817
|
+
BorderColor: theme === exports$1.themes.LIGHT ? borderColor_1.default.light(base) : borderColor_1.default.dark(base),
|
|
13818
|
+
BorderRadius: theme === exports$1.themes.LIGHT ? borderRadius_1.default.light(base) : borderRadius_1.default.dark(base),
|
|
13819
|
+
BoxShadow: theme === exports$1.themes.LIGHT ? boxShadow_1.default.light(base) : boxShadow_1.default.dark(base),
|
|
13820
|
+
FontSize: theme === exports$1.themes.LIGHT ? fontSize_1.default.light(base) : fontSize_1.default.dark(base),
|
|
13821
|
+
Spacing: theme === exports$1.themes.LIGHT ? spacing_1.default.light(base) : spacing_1.default.dark(base),
|
|
13822
|
+
TextColor: theme === exports$1.themes.LIGHT ? textColor_1.default.light(base) : textColor_1.default.dark(base),
|
|
13823
|
+
ZIndex: theme === exports$1.themes.LIGHT ? zIndex_1.default.light(base) : zIndex_1.default.dark(base)
|
|
13034
13824
|
});
|
|
13035
|
-
const buildTheme = (theme = exports.themes.LIGHT, target = exports.targets.REACT, tokenOverrides = {}) => {
|
|
13825
|
+
const buildTheme = (theme = exports$1.themes.LIGHT, target = exports$1.targets.REACT, tokenOverrides = {}) => {
|
|
13036
13826
|
const baseCore = Object.assign({}, core_1.default);
|
|
13037
13827
|
const baseLeaf = getSectionTokens(theme);
|
|
13038
13828
|
const baseParts = (0, utils_1.splitTokens)(tokenOverrides, baseCore, baseLeaf);
|
|
@@ -13052,9 +13842,9 @@ function requireDist () {
|
|
|
13052
13842
|
});
|
|
13053
13843
|
return (0, utils_1.deepMerge)(customBoth, mergedLeaf);
|
|
13054
13844
|
};
|
|
13055
|
-
exports.buildTheme = buildTheme;
|
|
13056
|
-
exports.light = (0, exports.buildTheme)(exports.themes.LIGHT);
|
|
13057
|
-
exports.dark = (0, exports.buildTheme)(exports.themes.DARK);
|
|
13845
|
+
exports$1.buildTheme = buildTheme;
|
|
13846
|
+
exports$1.light = (0, exports$1.buildTheme)(exports$1.themes.LIGHT);
|
|
13847
|
+
exports$1.dark = (0, exports$1.buildTheme)(exports$1.themes.DARK);
|
|
13058
13848
|
} (dist$1));
|
|
13059
13849
|
return dist$1;
|
|
13060
13850
|
}
|
|
@@ -13873,16 +14663,16 @@ const require$$1$3 = /*@__PURE__*/getAugmentedNamespace(__viteBrowserExternal$1)
|
|
|
13873
14663
|
Sha256.prototype.finalize.call(this);
|
|
13874
14664
|
}
|
|
13875
14665
|
};
|
|
13876
|
-
var exports = createMethod();
|
|
13877
|
-
exports.sha256 = exports;
|
|
13878
|
-
exports.sha224 = createMethod(true);
|
|
13879
|
-
exports.sha256.hmac = createHmacMethod();
|
|
13880
|
-
exports.sha224.hmac = createHmacMethod(true);
|
|
14666
|
+
var exports$1 = createMethod();
|
|
14667
|
+
exports$1.sha256 = exports$1;
|
|
14668
|
+
exports$1.sha224 = createMethod(true);
|
|
14669
|
+
exports$1.sha256.hmac = createHmacMethod();
|
|
14670
|
+
exports$1.sha224.hmac = createHmacMethod(true);
|
|
13881
14671
|
if (COMMON_JS) {
|
|
13882
|
-
module.exports = exports;
|
|
14672
|
+
module.exports = exports$1;
|
|
13883
14673
|
} else {
|
|
13884
|
-
root.sha256 = exports.sha256;
|
|
13885
|
-
root.sha224 = exports.sha224;
|
|
14674
|
+
root.sha256 = exports$1.sha256;
|
|
14675
|
+
root.sha224 = exports$1.sha224;
|
|
13886
14676
|
}
|
|
13887
14677
|
})();
|
|
13888
14678
|
} (sha256));
|
|
@@ -14386,7 +15176,7 @@ function create$1(changes) {
|
|
|
14386
15176
|
}
|
|
14387
15177
|
dist_es5.create = create$1;
|
|
14388
15178
|
|
|
14389
|
-
(function (exports) {
|
|
15179
|
+
(function (exports$1) {
|
|
14390
15180
|
var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
|
|
14391
15181
|
__assign = Object.assign || function(t) {
|
|
14392
15182
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -14398,8 +15188,8 @@ dist_es5.create = create$1;
|
|
|
14398
15188
|
};
|
|
14399
15189
|
return __assign.apply(this, arguments);
|
|
14400
15190
|
};
|
|
14401
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14402
|
-
exports.keyframes = exports.global = exports.css = exports.makeKeyframes = exports.makeGlobal = exports.makeCss = exports.memo = void 0;
|
|
15191
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
15192
|
+
exports$1.keyframes = exports$1.global = exports$1.css = exports$1.makeKeyframes = exports$1.makeGlobal = exports$1.makeCss = exports$1.memo = void 0;
|
|
14403
15193
|
var insert_css_1 = insertCssExports;
|
|
14404
15194
|
var FreeStyle = dist_es5;
|
|
14405
15195
|
var compose = function(f, g) {
|
|
@@ -14424,7 +15214,7 @@ dist_es5.create = create$1;
|
|
|
14424
15214
|
return ret;
|
|
14425
15215
|
};
|
|
14426
15216
|
};
|
|
14427
|
-
exports.memo = memo;
|
|
15217
|
+
exports$1.memo = memo;
|
|
14428
15218
|
var insertCss = /* @__PURE__ */ function() {
|
|
14429
15219
|
var seenClassNames = {};
|
|
14430
15220
|
return function(_a) {
|
|
@@ -14445,24 +15235,24 @@ dist_es5.create = create$1;
|
|
|
14445
15235
|
var className = style.registerStyle(cssObj);
|
|
14446
15236
|
return [className, style.getStyles()];
|
|
14447
15237
|
};
|
|
14448
|
-
exports.makeCss = makeCss;
|
|
15238
|
+
exports$1.makeCss = makeCss;
|
|
14449
15239
|
var makeGlobal = function(cssObj) {
|
|
14450
|
-
return exports.makeCss(__assign({ $global: true }, cssObj));
|
|
15240
|
+
return exports$1.makeCss(__assign({ $global: true }, cssObj));
|
|
14451
15241
|
};
|
|
14452
|
-
exports.makeGlobal = makeGlobal;
|
|
15242
|
+
exports$1.makeGlobal = makeGlobal;
|
|
14453
15243
|
var makeKeyframes = function(arg1, arg2) {
|
|
14454
15244
|
var _a;
|
|
14455
15245
|
var _b = arg2 === void 0 ? [arg1, "&"] : [arg2, arg1], cssObj = _b[0], animName = _b[1];
|
|
14456
15246
|
if (!(typeof animName === "string" || animName instanceof String)) {
|
|
14457
15247
|
throw new Error("Animation name must be a string. Omit argument to auto-generate.");
|
|
14458
15248
|
}
|
|
14459
|
-
var _c = exports.makeCss((_a = { $global: true }, _a["@keyframes " + animName] = cssObj, _a)), className = _c[0], styles = _c[1];
|
|
15249
|
+
var _c = exports$1.makeCss((_a = { $global: true }, _a["@keyframes " + animName] = cssObj, _a)), className = _c[0], styles = _c[1];
|
|
14460
15250
|
return [arg2 === void 0 ? className : animName, styles];
|
|
14461
15251
|
};
|
|
14462
|
-
exports.makeKeyframes = makeKeyframes;
|
|
14463
|
-
exports.css = compose(insertCss, exports.memo(exports.makeCss));
|
|
14464
|
-
exports.global = compose(discard, compose(insertCss, exports.makeGlobal));
|
|
14465
|
-
exports.keyframes = compose(insertCss, exports.makeKeyframes);
|
|
15252
|
+
exports$1.makeKeyframes = makeKeyframes;
|
|
15253
|
+
exports$1.css = compose(insertCss, exports$1.memo(exports$1.makeCss));
|
|
15254
|
+
exports$1.global = compose(discard, compose(insertCss, exports$1.makeGlobal));
|
|
15255
|
+
exports$1.keyframes = compose(insertCss, exports$1.makeKeyframes);
|
|
14466
15256
|
} (dist));
|
|
14467
15257
|
|
|
14468
15258
|
const Spinner = ({ bgColor, fgColor, size = 64 }) => {
|
|
@@ -73531,7 +74321,7 @@ const Export = createSvgIcon$2(({ color }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
73531
74321
|
] }));
|
|
73532
74322
|
Export.displayName = "Export";
|
|
73533
74323
|
|
|
73534
|
-
/*! @license DOMPurify 3.
|
|
74324
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
73535
74325
|
|
|
73536
74326
|
const {
|
|
73537
74327
|
entries,
|
|
@@ -73717,7 +74507,7 @@ function lookupGetter(object, prop) {
|
|
|
73717
74507
|
}
|
|
73718
74508
|
|
|
73719
74509
|
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
73720
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', '
|
|
74510
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
73721
74511
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
73722
74512
|
// List of SVG elements that are disallowed by default.
|
|
73723
74513
|
// We still need to know them so that we can do namespace
|
|
@@ -73731,7 +74521,7 @@ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongd
|
|
|
73731
74521
|
const text = freeze(['#text']);
|
|
73732
74522
|
|
|
73733
74523
|
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
73734
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
74524
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
73735
74525
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
73736
74526
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
73737
74527
|
|
|
@@ -73829,7 +74619,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
73829
74619
|
function createDOMPurify() {
|
|
73830
74620
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
73831
74621
|
const DOMPurify = root => createDOMPurify(root);
|
|
73832
|
-
DOMPurify.version = '3.
|
|
74622
|
+
DOMPurify.version = '3.3.1';
|
|
73833
74623
|
DOMPurify.removed = [];
|
|
73834
74624
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
73835
74625
|
// Not running in a browser, provide a factory function
|
|
@@ -73940,6 +74730,21 @@ function createDOMPurify() {
|
|
|
73940
74730
|
let FORBID_TAGS = null;
|
|
73941
74731
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
73942
74732
|
let FORBID_ATTR = null;
|
|
74733
|
+
/* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
|
|
74734
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
74735
|
+
tagCheck: {
|
|
74736
|
+
writable: true,
|
|
74737
|
+
configurable: false,
|
|
74738
|
+
enumerable: true,
|
|
74739
|
+
value: null
|
|
74740
|
+
},
|
|
74741
|
+
attributeCheck: {
|
|
74742
|
+
writable: true,
|
|
74743
|
+
configurable: false,
|
|
74744
|
+
enumerable: true,
|
|
74745
|
+
value: null
|
|
74746
|
+
}
|
|
74747
|
+
}));
|
|
73943
74748
|
/* Decide if ARIA attributes are okay */
|
|
73944
74749
|
let ALLOW_ARIA_ATTR = true;
|
|
73945
74750
|
/* Decide if custom data attributes are okay */
|
|
@@ -74132,16 +74937,24 @@ function createDOMPurify() {
|
|
|
74132
74937
|
}
|
|
74133
74938
|
/* Merge configuration parameters */
|
|
74134
74939
|
if (cfg.ADD_TAGS) {
|
|
74135
|
-
if (
|
|
74136
|
-
|
|
74940
|
+
if (typeof cfg.ADD_TAGS === 'function') {
|
|
74941
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
74942
|
+
} else {
|
|
74943
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
74944
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
74945
|
+
}
|
|
74946
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
74137
74947
|
}
|
|
74138
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
74139
74948
|
}
|
|
74140
74949
|
if (cfg.ADD_ATTR) {
|
|
74141
|
-
if (
|
|
74142
|
-
|
|
74950
|
+
if (typeof cfg.ADD_ATTR === 'function') {
|
|
74951
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
74952
|
+
} else {
|
|
74953
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
74954
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
74955
|
+
}
|
|
74956
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
74143
74957
|
}
|
|
74144
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
74145
74958
|
}
|
|
74146
74959
|
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
74147
74960
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
@@ -74152,6 +74965,12 @@ function createDOMPurify() {
|
|
|
74152
74965
|
}
|
|
74153
74966
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
74154
74967
|
}
|
|
74968
|
+
if (cfg.ADD_FORBID_CONTENTS) {
|
|
74969
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
74970
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
74971
|
+
}
|
|
74972
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
74973
|
+
}
|
|
74155
74974
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
74156
74975
|
if (KEEP_CONTENT) {
|
|
74157
74976
|
ALLOWED_TAGS['#text'] = true;
|
|
@@ -74449,7 +75268,7 @@ function createDOMPurify() {
|
|
|
74449
75268
|
return true;
|
|
74450
75269
|
}
|
|
74451
75270
|
/* Remove element if anything forbids its presence */
|
|
74452
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
75271
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
74453
75272
|
/* Check if we have a custom element to handle */
|
|
74454
75273
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
74455
75274
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
@@ -74521,7 +75340,7 @@ function createDOMPurify() {
|
|
|
74521
75340
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
74522
75341
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
74523
75342
|
We don't need to check the value; it's always URI safe. */
|
|
74524
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
75343
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
74525
75344
|
if (
|
|
74526
75345
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
74527
75346
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|