@ant-design/x
Version:
Craft AI-driven interfaces effortlessly
2,094 lines (1,920 loc) • 3.53 MB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"), require("antd"), require("antdCssinjs"), require("icons"), require("mermaid"));
else if(typeof define === 'function' && define.amd)
define([, , , , , ], factory);
else if(typeof exports === 'object')
exports["antdx"] = factory(require("react"), require("react-dom"), require("antd"), require("antdCssinjs"), require("icons"), require("mermaid"));
else
root["antdx"] = factory(root["React"], root["ReactDOM"], root["antd"], root["antdCssinjs"], root["icons"], root["mermaid"]);
})(self, function(__WEBPACK_EXTERNAL_MODULE__40868__, __WEBPACK_EXTERNAL_MODULE__41238__, __WEBPACK_EXTERNAL_MODULE__49999__, __WEBPACK_EXTERNAL_MODULE__10283__, __WEBPACK_EXTERNAL_MODULE__25377__, __WEBPACK_EXTERNAL_MODULE__87798__) {
return /******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 65441:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
exports.pathKey = pathKey;
// [times, realValue]
const SPLIT = '%';
/** Connect key with `SPLIT` */
function pathKey(keys) {
return keys.join(SPLIT);
}
/** Record update id for extract static style order. */
let updateId = 0;
class Entity {
instanceId;
constructor(instanceId) {
this.instanceId = instanceId;
}
/** @private Internal cache map. Do not access this directly */
cache = new Map();
/** @private Record update times for each key */
updateTimes = new Map();
extracted = new Set();
get(keys) {
return this.opGet(pathKey(keys));
}
/** A fast get cache with `get` concat. */
opGet(keyPathStr) {
return this.cache.get(keyPathStr) || null;
}
update(keys, valueFn) {
return this.opUpdate(pathKey(keys), valueFn);
}
/** A fast get cache with `get` concat. */
opUpdate(keyPathStr, valueFn) {
const prevValue = this.cache.get(keyPathStr);
const nextValue = valueFn(prevValue);
if (nextValue === null) {
this.cache.delete(keyPathStr);
this.updateTimes.delete(keyPathStr);
} else {
this.cache.set(keyPathStr, nextValue);
this.updateTimes.set(keyPathStr, updateId);
updateId += 1;
}
}
}
var _default = exports["default"] = Entity;
/***/ }),
/***/ 46535:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.StyleProvider = exports.CSS_IN_JS_INSTANCE = exports.ATTR_TOKEN = exports.ATTR_MARK = exports.ATTR_CACHE_PATH = void 0;
exports.createCache = createCache;
exports["default"] = void 0;
var _useMemo = _interopRequireDefault(__webpack_require__(39203));
var _isEqual = _interopRequireDefault(__webpack_require__(92357));
var React = _interopRequireWildcard(__webpack_require__(40868));
var _Cache = _interopRequireDefault(__webpack_require__(65441));
var _autoPrefix = __webpack_require__(71898);
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) return null;
var r = new WeakMap(),
t = new WeakMap();
return (_getRequireWildcardCache = function (e) {
return e ? t : r;
})(e);
}
function _interopRequireWildcard(e, r) {
if (!r && e && e.__esModule) return e;
if (null === e || "object" != typeof e && "function" != typeof e) return {
default: e
};
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) return t.get(e);
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
}
return n.default = e, t && t.set(e, n), n;
}
const ATTR_TOKEN = exports.ATTR_TOKEN = 'data-token-hash';
const ATTR_MARK = exports.ATTR_MARK = 'data-css-hash';
const ATTR_CACHE_PATH = exports.ATTR_CACHE_PATH = 'data-cache-path';
// Mark css-in-js instance in style element
const CSS_IN_JS_INSTANCE = exports.CSS_IN_JS_INSTANCE = '__cssinjs_instance__';
function createCache() {
const cssinjsInstanceId = Math.random().toString(12).slice(2);
// Tricky SSR: Move all inline style to the head.
// PS: We do not recommend tricky mode.
if (typeof document !== 'undefined' && document.head && document.body) {
const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || [];
const {
firstChild
} = document.head;
Array.from(styles).forEach(style => {
style[CSS_IN_JS_INSTANCE] || (style[CSS_IN_JS_INSTANCE] = cssinjsInstanceId);
// Not force move if no head
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
document.head.insertBefore(style, firstChild);
}
});
// Deduplicate of moved styles
const styleHash = {};
Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach(style => {
const hash = style.getAttribute(ATTR_MARK);
if (styleHash[hash]) {
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
style.parentNode?.removeChild(style);
}
} else {
styleHash[hash] = true;
}
});
}
return new _Cache.default(cssinjsInstanceId);
}
const StyleContext = /*#__PURE__*/React.createContext({
hashPriority: 'low',
cache: createCache(),
defaultCache: true,
autoPrefix: false
});
const StyleProvider = props => {
const {
children,
...restProps
} = props;
const parentContext = React.useContext(StyleContext);
const context = (0, _useMemo.default)(() => {
const mergedContext = {
...parentContext
};
Object.keys(restProps).forEach(key => {
const value = restProps[key];
if (restProps[key] !== undefined) {
mergedContext[key] = value;
}
});
const {
cache,
transformers = []
} = restProps;
mergedContext.cache = mergedContext.cache || createCache();
mergedContext.defaultCache = !cache && parentContext.defaultCache;
// autoPrefix
if (transformers.includes(_autoPrefix.AUTO_PREFIX)) {
mergedContext.autoPrefix = true;
}
return mergedContext;
}, [parentContext, restProps], (prev, next) => !(0, _isEqual.default)(prev[0], next[0], true) || !(0, _isEqual.default)(prev[1], next[1], true));
return /*#__PURE__*/React.createElement(StyleContext.Provider, {
value: context
}, children);
};
exports.StyleProvider = StyleProvider;
var _default = exports["default"] = StyleContext;
/***/ }),
/***/ 44004:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _warning = __webpack_require__(79384);
let uuid = 0;
/**
* Theme with algorithms to derive tokens from design tokens.
* Use `createTheme` first which will help to manage the theme instance cache.
*/
class Theme {
derivatives;
id;
constructor(derivatives) {
this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
this.id = uuid;
if (derivatives.length === 0) {
(0, _warning.warning)(derivatives.length > 0, '[Ant Design CSS-in-JS] Theme should have at least one derivative function.');
}
uuid += 1;
}
getDerivativeToken(token) {
return this.derivatives.reduce((result, derivative) => derivative(token, result), undefined);
}
}
exports["default"] = Theme;
/***/ }),
/***/ 54353:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
exports.sameDerivativeOption = sameDerivativeOption;
// ================================== Cache ==================================
function sameDerivativeOption(left, right) {
if (left.length !== right.length) {
return false;
}
for (let i = 0; i < left.length; i++) {
if (left[i] !== right[i]) {
return false;
}
}
return true;
}
class ThemeCache {
static MAX_CACHE_SIZE = 20;
static MAX_CACHE_OFFSET = 5;
cache;
keys;
cacheCallTimes;
constructor() {
this.cache = new Map();
this.keys = [];
this.cacheCallTimes = 0;
}
size() {
return this.keys.length;
}
internalGet(derivativeOption, updateCallTimes = false) {
let cache = {
map: this.cache
};
derivativeOption.forEach(derivative => {
if (!cache) {
cache = undefined;
} else {
cache = cache?.map?.get(derivative);
}
});
if (cache?.value && updateCallTimes) {
cache.value[1] = this.cacheCallTimes++;
}
return cache?.value;
}
get(derivativeOption) {
return this.internalGet(derivativeOption, true)?.[0];
}
has(derivativeOption) {
return !!this.internalGet(derivativeOption);
}
set(derivativeOption, value) {
// New cache
if (!this.has(derivativeOption)) {
if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
const [targetKey] = this.keys.reduce((result, key) => {
const [, callTimes] = result;
if (this.internalGet(key)[1] < callTimes) {
return [key, this.internalGet(key)[1]];
}
return result;
}, [this.keys[0], this.cacheCallTimes]);
this.delete(targetKey);
}
this.keys.push(derivativeOption);
}
let cache = this.cache;
derivativeOption.forEach((derivative, index) => {
if (index === derivativeOption.length - 1) {
cache.set(derivative, {
value: [value, this.cacheCallTimes++]
});
} else {
const cacheValue = cache.get(derivative);
if (!cacheValue) {
cache.set(derivative, {
map: new Map()
});
} else if (!cacheValue.map) {
cacheValue.map = new Map();
}
cache = cache.get(derivative).map;
}
});
}
deleteByPath(currentCache, derivatives) {
const cache = currentCache.get(derivatives[0]);
if (derivatives.length === 1) {
if (!cache.map) {
currentCache.delete(derivatives[0]);
} else {
currentCache.set(derivatives[0], {
map: cache.map
});
}
return cache.value?.[0];
}
const result = this.deleteByPath(cache.map, derivatives.slice(1));
if ((!cache.map || cache.map.size === 0) && !cache.value) {
currentCache.delete(derivatives[0]);
}
return result;
}
delete(derivativeOption) {
// If cache exists
if (this.has(derivativeOption)) {
this.keys = this.keys.filter(item => !sameDerivativeOption(item, derivativeOption));
return this.deleteByPath(this.cache, derivativeOption);
}
return undefined;
}
}
exports["default"] = ThemeCache;
/***/ }),
/***/ 19708:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _calculator = _interopRequireDefault(__webpack_require__(16102));
const CALC_UNIT = 'CALC_UNIT';
const regexp = new RegExp(CALC_UNIT, 'g');
function unit(value) {
if (typeof value === 'number') {
return `${value}${CALC_UNIT}`;
}
return value;
}
class CSSCalculator extends _calculator.default {
result = '';
unitlessCssVar;
lowPriority;
constructor(num, unitlessCssVar) {
super();
const numType = typeof num;
this.unitlessCssVar = unitlessCssVar;
if (num instanceof CSSCalculator) {
this.result = `(${num.result})`;
} else if (numType === 'number') {
this.result = unit(num);
} else if (numType === 'string') {
this.result = num;
}
}
add(num) {
if (num instanceof CSSCalculator) {
this.result = `${this.result} + ${num.getResult()}`;
} else if (typeof num === 'number' || typeof num === 'string') {
this.result = `${this.result} + ${unit(num)}`;
}
this.lowPriority = true;
return this;
}
sub(num) {
if (num instanceof CSSCalculator) {
this.result = `${this.result} - ${num.getResult()}`;
} else if (typeof num === 'number' || typeof num === 'string') {
this.result = `${this.result} - ${unit(num)}`;
}
this.lowPriority = true;
return this;
}
mul(num) {
if (this.lowPriority) {
this.result = `(${this.result})`;
}
if (num instanceof CSSCalculator) {
this.result = `${this.result} * ${num.getResult(true)}`;
} else if (typeof num === 'number' || typeof num === 'string') {
this.result = `${this.result} * ${num}`;
}
this.lowPriority = false;
return this;
}
div(num) {
if (this.lowPriority) {
this.result = `(${this.result})`;
}
if (num instanceof CSSCalculator) {
this.result = `${this.result} / ${num.getResult(true)}`;
} else if (typeof num === 'number' || typeof num === 'string') {
this.result = `${this.result} / ${num}`;
}
this.lowPriority = false;
return this;
}
getResult(force) {
return this.lowPriority || force ? `(${this.result})` : this.result;
}
equal(options) {
const {
unit: cssUnit
} = options || {};
let mergedUnit = true;
if (typeof cssUnit === 'boolean') {
mergedUnit = cssUnit;
} else if (Array.from(this.unitlessCssVar).some(cssVar => this.result.includes(cssVar))) {
mergedUnit = false;
}
this.result = this.result.replace(regexp, mergedUnit ? 'px' : '');
if (typeof this.lowPriority !== 'undefined') {
return `calc(${this.result})`;
}
return this.result;
}
}
exports["default"] = CSSCalculator;
/***/ }),
/***/ 13672:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _calculator = _interopRequireDefault(__webpack_require__(16102));
class NumCalculator extends _calculator.default {
result = 0;
constructor(num) {
super();
if (num instanceof NumCalculator) {
this.result = num.result;
} else if (typeof num === 'number') {
this.result = num;
}
}
add(num) {
if (num instanceof NumCalculator) {
this.result += num.result;
} else if (typeof num === 'number') {
this.result += num;
}
return this;
}
sub(num) {
if (num instanceof NumCalculator) {
this.result -= num.result;
} else if (typeof num === 'number') {
this.result -= num;
}
return this;
}
mul(num) {
if (num instanceof NumCalculator) {
this.result *= num.result;
} else if (typeof num === 'number') {
this.result *= num;
}
return this;
}
div(num) {
if (num instanceof NumCalculator) {
this.result /= num.result;
} else if (typeof num === 'number') {
this.result /= num;
}
return this;
}
equal() {
return this.result;
}
}
exports["default"] = NumCalculator;
/***/ }),
/***/ 16102:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class AbstractCalculator {}
var _default = exports["default"] = AbstractCalculator;
/***/ }),
/***/ 3106:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _CSSCalculator = _interopRequireDefault(__webpack_require__(19708));
var _NumCalculator = _interopRequireDefault(__webpack_require__(13672));
const genCalc = (type, unitlessCssVar) => {
const Calculator = type === 'css' ? _CSSCalculator.default : _NumCalculator.default;
return num => new Calculator(num, unitlessCssVar);
};
var _default = exports["default"] = genCalc;
/***/ }),
/***/ 26291:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = createTheme;
var _ThemeCache = _interopRequireDefault(__webpack_require__(54353));
var _Theme = _interopRequireDefault(__webpack_require__(44004));
const cacheThemes = new _ThemeCache.default();
/**
* Same as new Theme, but will always return same one if `derivative` not changed.
*/
function createTheme(derivatives) {
const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
// Create new theme if not exist
if (!cacheThemes.has(derivativeArr)) {
cacheThemes.set(derivativeArr, new _Theme.default(derivativeArr));
}
// Get theme from cache and return
return cacheThemes.get(derivativeArr);
}
/***/ }),
/***/ 24838:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(77972);
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "Theme", ({
enumerable: true,
get: function () {
return _Theme.default;
}
}));
Object.defineProperty(exports, "ThemeCache", ({
enumerable: true,
get: function () {
return _ThemeCache.default;
}
}));
Object.defineProperty(exports, "createTheme", ({
enumerable: true,
get: function () {
return _createTheme.default;
}
}));
Object.defineProperty(exports, "genCalc", ({
enumerable: true,
get: function () {
return _calc.default;
}
}));
var _calc = _interopRequireDefault(__webpack_require__(3106));
var _createTheme = _interopRequireDefault(__webpack_require__(26291));
var _Theme = _interopRequireDefault(__webpack_require__(44004));
var _ThemeCache = _interopRequireDefault(__webpack_require__(54353));
/***/ }),
/***/ 71898:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = exports.AUTO_PREFIX = void 0;
const AUTO_PREFIX = exports.AUTO_PREFIX = {};
const transform = AUTO_PREFIX;
var _default = exports["default"] = transform;
/***/ }),
/***/ 95110:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __webpack_unused_export__;
var _interopRequireDefault = __webpack_require__(77972);
__webpack_unused_export__ = ({
value: true
});
__webpack_unused_export__ = flattenToken;
__webpack_unused_export__ = injectCSPNonce;
__webpack_unused_export__ = __webpack_unused_export__ = void 0;
__webpack_unused_export__ = memoResult;
__webpack_unused_export__ = supportLayer;
__webpack_unused_export__ = supportLogicProps;
__webpack_unused_export__ = supportWhere;
__webpack_unused_export__ = toStyleStr;
__webpack_unused_export__ = token2key;
exports.bf = unit;
__webpack_unused_export__ = where;
var _hash = _interopRequireDefault(__webpack_require__(77418));
var _canUseDom = _interopRequireDefault(__webpack_require__(80783));
var _dynamicCSS = __webpack_require__(79708);
var _StyleContext = __webpack_require__(46535);
var _theme = __webpack_require__(24838);
// Create a cache for memo concat
const resultCache = new WeakMap();
const RESULT_VALUE = {};
function memoResult(callback, deps) {
let current = resultCache;
for (let i = 0; i < deps.length; i += 1) {
const dep = deps[i];
if (!current.has(dep)) {
current.set(dep, new WeakMap());
}
current = current.get(dep);
}
if (!current.has(RESULT_VALUE)) {
current.set(RESULT_VALUE, callback());
}
return current.get(RESULT_VALUE);
}
// Create a cache here to avoid always loop generate
const flattenTokenCache = new WeakMap();
/**
* Flatten token to string, this will auto cache the result when token not change
*/
function flattenToken(token) {
let str = flattenTokenCache.get(token) || '';
if (!str) {
Object.keys(token).forEach(key => {
const value = token[key];
str += key;
if (value instanceof _theme.Theme) {
str += value.id;
} else if (value && typeof value === 'object') {
str += flattenToken(value);
} else {
str += value;
}
});
// https://github.com/ant-design/ant-design/issues/48386
// Should hash the string to avoid style tag name too long
str = (0, _hash.default)(str);
// Put in cache
flattenTokenCache.set(token, str);
}
return str;
}
/**
* Convert derivative token to key string
*/
function token2key(token, salt) {
return (0, _hash.default)(`${salt}_${flattenToken(token)}`);
}
const randomSelectorKey = `random-${Date.now()}-${Math.random()}`.replace(/\./g, '');
// Magic `content` for detect selector support
const checkContent = '_bAmBoO_';
function supportSelector(styleStr, handleElement, supportCheck) {
if ((0, _canUseDom.default)()) {
(0, _dynamicCSS.updateCSS)(styleStr, randomSelectorKey);
const ele = document.createElement('div');
ele.style.position = 'fixed';
ele.style.left = '0';
ele.style.top = '0';
handleElement?.(ele);
document.body.appendChild(ele);
if (false) {}
const support = supportCheck ? supportCheck(ele) : getComputedStyle(ele).content?.includes(checkContent);
ele.parentNode?.removeChild(ele);
(0, _dynamicCSS.removeCSS)(randomSelectorKey);
return support;
}
return false;
}
let canLayer = undefined;
function supportLayer() {
if (canLayer === undefined) {
canLayer = supportSelector(`@layer ${randomSelectorKey} { .${randomSelectorKey} { content: "${checkContent}"!important; } }`, ele => {
ele.className = randomSelectorKey;
});
}
return canLayer;
}
let canWhere = undefined;
function supportWhere() {
if (canWhere === undefined) {
canWhere = supportSelector(`:where(.${randomSelectorKey}) { content: "${checkContent}"!important; }`, ele => {
ele.className = randomSelectorKey;
});
}
return canWhere;
}
let canLogic = undefined;
function supportLogicProps() {
if (canLogic === undefined) {
canLogic = supportSelector(`.${randomSelectorKey} { inset-block: 93px !important; }`, ele => {
ele.className = randomSelectorKey;
}, ele => getComputedStyle(ele).bottom === '93px');
}
return canLogic;
}
const isClientSide = __webpack_unused_export__ = (0, _canUseDom.default)();
function unit(num) {
if (typeof num === 'number') {
return `${num}px`;
}
return num;
}
function toStyleStr(style, tokenKey, styleId, customizeAttrs = {}, plain = false) {
if (plain) {
return style;
}
const attrs = {
...customizeAttrs,
[_StyleContext.ATTR_TOKEN]: tokenKey,
[_StyleContext.ATTR_MARK]: styleId
};
const attrStr = Object.keys(attrs).map(attr => {
const val = attrs[attr];
return val ? `${attr}="${val}"` : null;
}).filter(v => v).join(' ');
return `<style ${attrStr}>${style}</style>`;
}
function where(options) {
const {
hashCls,
hashPriority = 'low'
} = options || {};
if (!hashCls) {
return '';
}
const hashSelector = `.${hashCls}`;
return hashPriority === 'low' ? `:where(${hashSelector})` : hashSelector;
}
const isNonNullable = val => {
return val !== undefined && val !== null;
};
__webpack_unused_export__ = isNonNullable;
/**
* Get nonce value and inject it into CSS config if available.
*/
function injectCSPNonce(config, nonce) {
const nonceStr = typeof nonce === 'function' ? nonce() : nonce;
if (nonceStr) {
return {
...config,
csp: {
...config.csp,
nonce: nonceStr
}
};
}
return config;
}
/***/ }),
/***/ 62986:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({
value: true
});
exports.Z = void 0;
var _react = __webpack_require__(40868);
const IconContext = /*#__PURE__*/(0, _react.createContext)({});
var _default = exports.Z = IconContext;
/***/ }),
/***/ 77418:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ murmur2; }
/* harmony export */ });
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k = /* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^= /* k >>> r: */
k >>> 24;
h = /* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h = /* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h = /* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
/***/ }),
/***/ 47150:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
const locale = {
// Options
items_per_page: '/ page',
jump_to: 'Go to',
jump_to_confirm: 'confirm',
page: 'Page',
// Pagination
prev_page: 'Previous Page',
next_page: 'Next Page',
prev_5: 'Previous 5 Pages',
next_5: 'Next 5 Pages',
prev_3: 'Previous 3 Pages',
next_3: 'Next 3 Pages',
page_size: 'Page Size'
};
var _default = exports["default"] = locale;
/***/ }),
/***/ 5989:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.commonLocale = void 0;
var commonLocale = exports.commonLocale = {
yearFormat: 'YYYY',
dayFormat: 'D',
cellMeridiemFormat: 'A',
monthBeforeYear: true
};
/***/ }),
/***/ 17572:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _common = __webpack_require__(5989);
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : String(i);
}
function _toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
var locale = _objectSpread(_objectSpread({}, _common.commonLocale), {}, {
locale: 'en_US',
today: 'Today',
now: 'Now',
backToToday: 'Back to today',
ok: 'OK',
clear: 'Clear',
week: 'Week',
month: 'Month',
year: 'Year',
timeSelect: 'select time',
dateSelect: 'select date',
weekSelect: 'Choose a week',
monthSelect: 'Choose a month',
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',
previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
nextYear: 'Next year (Control + right)',
previousDecade: 'Last decade',
nextDecade: 'Next decade',
previousCentury: 'Last century',
nextCentury: 'Next century'
});
var _default = exports["default"] = locale;
/***/ }),
/***/ 80783:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = canUseDom;
function canUseDom() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}
/***/ }),
/***/ 2414:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = contains;
function contains(root, n) {
if (!root) {
return false;
}
// Use native if support
if (root.contains) {
return root.contains(n);
}
// `document.contains` not support with IE11
let node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
/***/ }),
/***/ 79708:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.clearContainerCache = clearContainerCache;
exports.injectCSS = injectCSS;
exports.removeCSS = removeCSS;
exports.updateCSS = updateCSS;
var _canUseDom = _interopRequireDefault(__webpack_require__(80783));
var _contains = _interopRequireDefault(__webpack_require__(2414));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const APPEND_ORDER = 'data-rc-order';
const APPEND_PRIORITY = 'data-rc-priority';
const MARK_KEY = `rc-util-key`;
const containerCache = new Map();
function getMark({
mark
} = {}) {
if (mark) {
return mark.startsWith('data-') ? mark : `data-${mark}`;
}
return MARK_KEY;
}
function getContainer(option) {
if (option.attachTo) {
return option.attachTo;
}
const head = document.querySelector('head');
return head || document.body;
}
function getOrder(prepend) {
if (prepend === 'queue') {
return 'prependQueue';
}
return prepend ? 'prepend' : 'append';
}
/**
* Find style which inject by rc-util
*/
function findStyles(container) {
return Array.from((containerCache.get(container) || container).children).filter(node => node.tagName === 'STYLE');
}
function injectCSS(css, option = {}) {
if (!(0, _canUseDom.default)()) {
return null;
}
const {
csp,
prepend,
priority = 0
} = option;
const mergedOrder = getOrder(prepend);
const isPrependQueue = mergedOrder === 'prependQueue';
const styleNode = document.createElement('style');
styleNode.setAttribute(APPEND_ORDER, mergedOrder);
if (isPrependQueue && priority) {
styleNode.setAttribute(APPEND_PRIORITY, `${priority}`);
}
if (csp?.nonce) {
styleNode.nonce = csp?.nonce;
}
styleNode.innerHTML = css;
const container = getContainer(option);
const {
firstChild
} = container;
if (prepend) {
// If is queue `prepend`, it will prepend first style and then append rest style
if (isPrependQueue) {
const existStyle = (option.styles || findStyles(container)).filter(node => {
// Ignore style which not injected by rc-util with prepend
if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
return false;
}
// Ignore style which priority less then new style
const nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
return priority >= nodePriority;
});
if (existStyle.length) {
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
return styleNode;
}
}
// Use `insertBefore` as `prepend`
container.insertBefore(styleNode, firstChild);
} else {
container.appendChild(styleNode);
}
return styleNode;
}
function findExistNode(key, option = {}) {
let {
styles
} = option;
styles || (styles = findStyles(getContainer(option)));
return styles.find(node => node.getAttribute(getMark(option)) === key);
}
function removeCSS(key, option = {}) {
const existNode = findExistNode(key, option);
if (existNode) {
const container = getContainer(option);
container.removeChild(existNode);
}
}
/**
* qiankun will inject `appendChild` to insert into other
*/
function syncRealContainer(container, option) {
const cachedRealContainer = containerCache.get(container);
// Find real container when not cached or cached container removed
if (!cachedRealContainer || !(0, _contains.default)(document, cachedRealContainer)) {
const placeholderStyle = injectCSS('', option);
const {
parentNode
} = placeholderStyle;
containerCache.set(container, parentNode);
container.removeChild(placeholderStyle);
}
}
/**
* manually clear container cache to avoid global cache in unit testes
*/
function clearContainerCache() {
containerCache.clear();
}
function updateCSS(css, key, originOption = {}) {
const container = getContainer(originOption);
const styles = findStyles(container);
const option = {
...originOption,
styles
};
// Sync real parent
syncRealContainer(container, option);
const existNode = findExistNode(key, option);
if (existNode) {
if (option.csp?.nonce && existNode.nonce !== option.csp?.nonce) {
existNode.nonce = option.csp?.nonce;
}
if (existNode.innerHTML !== css) {
existNode.innerHTML = css;
}
return existNode;
}
const newNode = injectCSS(css, option);
newNode.setAttribute(getMark(option), key);
return newNode;
}
/***/ }),
/***/ 92989:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({
value: true
});
exports.Z = void 0;
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
const KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
// NUMLOCK on FF/Safari Mac
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
// also NUM_NORTH_EAST
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
// also NUM_SOUTH_EAST
/**
* END
*/
END: 35,
// also NUM_SOUTH_WEST
/**
* HOME
*/
HOME: 36,
// also NUM_NORTH_WEST
/**
* LEFT
*/
LEFT: 37,
// also NUM_WEST
/**
* UP
*/
UP: 38,
// also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39,
// also NUM_EAST
/**
* DOWN
*/
DOWN: 40,
// also NUM_SOUTH
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
// also NUM_INSERT
/**
* DELETE
*/
DELETE: 46,
// also NUM_DELETE
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
// needs localization
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
// WIN_KEY_LEFT
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
// needs localization
/**
* DASH
*/
DASH: 189,
// needs localization
/**
* EQUALS
*/
EQUALS: 187,
// needs localization
/**
* COMMA
*/
COMMA: 188,
// needs localization
/**
* PERIOD
*/
PERIOD: 190,
// needs localization
/**
* SLASH
*/
SLASH: 191,
// needs localization
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
// needs localization
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
// needs localization
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
// needs localization
/**
* BACKSLASH
*/
BACKSLASH: 220,
// needs localization
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
// needs localization
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
// Firefox (Gecko) fires this for the meta key instead of 91
/**
* WIN_IME
*/
WIN_IME: 229,
// ======================== Function ========================
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
const {
keyCode
} = e;
if (e.altKey && !e.ctrlKey || e.metaKey ||
// Function keys don't generate text
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
}
// The following keys are quite harmless, even in combination with
// CTRL, ALT or SHIFT.
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
},
/**
* whether character is entered.
*/
isCharacterKey: function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
return true;
}
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
return true;
}
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
return true;
}
// Safari sends zero key code for non-latin characters.
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
return true;
}
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
},
isEditableTarget: function isEditableTarget(e) {
const target = e.target;
if (!(target instanceof HTMLElement)) {
return false;
}
const tagName = target.tagName;
if (tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT' || target.isContentEditable) {
return true;
}
return false;
}
};
var _default = exports.Z = KeyCode;
/***/ }),
/***/ 67367:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = isFragment;
const REACT_ELEMENT_TYPE_18 = Symbol.for('react.element');
const REACT_ELEMENT_TYPE_19 = Symbol.for('react.transitional.element');
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
/**
* Compatible with React 18 or 19 to check if node is a Fragment.
*/
function isFragment(object) {
return (
// Base object type
object && typeof object === 'object' && (
// React Element type
object.$$typeof === REACT_ELEMENT_TYPE_18 || object.$$typeof === REACT_ELEMENT_TYPE_19) &&
// React Fragment type
object.type === REACT_FRAGMENT_TYPE
);
}
/***/ }),
/***/ 53144:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({
value: true
});
__webpack_unused_export__ = exports.ZP = void 0;
var React = _interopRequireWildcard(__webpack_require__(40868));
var _canUseDom = _interopRequireDefault(__webpack_require__(80783));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) return null;
var r = new WeakMap(),
t = new WeakMap();
return (_getRequireWildcardCache = function (e) {
return e ? t : r;
})(e);
}
function _interopRequireWildcard(e, r) {
if (!r && e && e.__esModule) return e;
if (null === e || "object" != typeof e && "function" != typeof e) return {
default: e
};
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) return t.get(e);
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
}
return n.default = e, t && t.set(e, n), n;
}
/**
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
*/
const useInternalLayoutEffect = true && (0, _canUseDom.default)() ? React.useLayoutEffect : React.useEffect;
const useLayoutEffect = (callback, deps) => {
const firstMountRef = React.useRef(true);
useInternalLayoutEffect(() => {
return callback(firstMountRef.current);
}, deps);
// We tell react that first mount has passed
useInternalLayoutEffect(() => {
firstMountRef.current = false;
return () => {
firstMountRef.current = true;
};
}, []);
};
const useLayoutUpdateEffect = (callback, deps) => {
useLayoutEffect(firstMount => {
if (!firstMount) {
return callback();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
};
__webpack_unused_export__ = useLayoutUpdateEffect;
var _default = exports.ZP = useLayoutEffect;
/***/ }),
/***/ 39203:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = useMemo;
var React = _interopRequireWildcard(__webpack_require__(40868));
function _getRequireWildcardCache(e) {
if ("function" != typeof WeakMap) return null;
var r = new WeakMap(),
t = new WeakMap();
return (_getRequireWildcardCache = function (e) {
return e ? t : r;
})(e);
}
function _interopRequireWildcard(e, r) {
if (!r && e && e.__esModule) return e;
if (null === e || "object" != typeof e && "function" != typeof e) return {
default: e
};
var t = _getRequireWildcardCache(r);
if (t && t.has(e)) return t.get(e);
var n = {
__proto__: null
},
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
}
return n.default = e, t && t.set(e, n), n;
}
function useMemo(getValue, condition, shouldUpdate) {
const cacheRef = React.useRef({});
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
cacheRef.current.value = getValue();
cacheRef.current.condition = condition;
}
return cacheRef.current.value;
}
/***/ }),
/***/ 92357:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _warning = _interopRequireDefault(__webpack_require__(79384));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
/**
* Deeply compares two object literals.
* @param obj1 object 1
* @param obj2 object 2
* @param shallow shallow compare
* @returns
*/
function isEqual(obj1, obj2, shallow = false) {
// https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
const refSet = new Set();
function deepEqual(a, b, level = 1) {
const circular = refSet.has(a);
(0, _warning.default)(!circular, 'Warning: There may be circular references');
if (circular) {
return false;
}
if (a === b) {
return true;
}
if (shallow && level > 1) {
return false;
}
refSet.add(a);
const newLevel = level + 1;
if (Array.isArray(a)) {
if (!Array.isArray(b) || a.length !== b.length) {
return false;
}
for (let i = 0; i < a.length; i++) {
if (!deepEqual(a[i], b[i], newLevel)) {
return false;
}
}
return true;
}
if (a && b && typeof a === 'object' && typeof b === 'object') {
const keys = Object.keys(a);
if (keys.length !== Object.keys(b).length) {
return false;
}
return keys.every(key => deepEqual(a[key], b[key], newLevel));
}
// other
return false;
}
return deepEqual(obj1, obj2);
}
var _default = exports["default"] = isEqual;
/***/ }),
/***/ 18579:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({
value: true
});
exports.Z = omit;
function omit(obj, fields) {
const clone = Object.assign({}, obj);
if (Array.isArray(fields)) {
fields.forEach(key => {
delete clone[key];
});
}
return clone;
}
/***/ }),
/***/ 90205:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({
value: true
});
exports.Z = pickAttrs;
const attributes = `accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download