UNPKG

element-plus

Version:

A Component Library for Vue 3

1,582 lines (1,473 loc) 2.16 MB
/*! Element Plus v2.9.9 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) : typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ElementPlus = {}, global.Vue)); })(this, (function (exports, vue) { 'use strict'; const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`; const isVisible = (element) => { const computed = getComputedStyle(element); return computed.position === "fixed" ? false : element.offsetParent !== null; }; const obtainAllFocusableElements$1 = (element) => { return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item)); }; const isFocusable = (element) => { if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) { return true; } if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") { return false; } switch (element.nodeName) { case "A": { return !!element.href && element.rel !== "ignore"; } case "INPUT": { return !(element.type === "hidden" || element.type === "file"); } case "BUTTON": case "SELECT": case "TEXTAREA": { return true; } default: { return false; } } }; const triggerEvent = function(elm, name, ...opts) { let eventName; if (name.includes("mouse") || name.includes("click")) { eventName = "MouseEvents"; } else if (name.includes("key")) { eventName = "KeyboardEvent"; } else { eventName = "HTMLEvents"; } const evt = document.createEvent(eventName); evt.initEvent(name, ...opts); elm.dispatchEvent(evt); return elm; }; const isLeaf = (el) => !el.getAttribute("aria-owns"); const getSibling = (el, distance, elClass) => { const { parentNode } = el; if (!parentNode) return null; const siblings = parentNode.querySelectorAll(elClass); const index = Array.prototype.indexOf.call(siblings, el); return siblings[index + distance] || null; }; const focusNode = (el) => { if (!el) return; el.focus(); !isLeaf(el) && el.click(); }; const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => { const handleEvent = (event) => { const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event); if (checkForDefaultPrevented === false || !shouldPrevent) { return oursHandler == null ? void 0 : oursHandler(event); } }; return handleEvent; }; const whenMouse = (handler) => { return (e) => e.pointerType === "mouse" ? handler(e) : void 0; }; var __defProp$9 = Object.defineProperty; var __defProps$6 = Object.defineProperties; var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols$b = Object.getOwnPropertySymbols; var __hasOwnProp$b = Object.prototype.hasOwnProperty; var __propIsEnum$b = Object.prototype.propertyIsEnumerable; var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues$9 = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp$b.call(b, prop)) __defNormalProp$9(a, prop, b[prop]); if (__getOwnPropSymbols$b) for (var prop of __getOwnPropSymbols$b(b)) { if (__propIsEnum$b.call(b, prop)) __defNormalProp$9(a, prop, b[prop]); } return a; }; var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b)); function computedEager(fn, options) { var _a; const result = vue.shallowRef(); vue.watchEffect(() => { result.value = fn(); }, __spreadProps$6(__spreadValues$9({}, options), { flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync" })); return vue.readonly(result); } var _a; const isClient = typeof window !== "undefined"; const isDef = (val) => typeof val !== "undefined"; const isString$2 = (val) => typeof val === "string"; const noop$1 = () => { }; const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function resolveUnref(r) { return typeof r === "function" ? r() : vue.unref(r); } function createFilterWrapper(filter, fn) { function wrapper(...args) { filter(() => fn.apply(this, args), { fn, thisArg: this, args }); } return wrapper; } function debounceFilter(ms, options = {}) { let timer; let maxTimer; const filter = (invoke) => { const duration = resolveUnref(ms); const maxDuration = resolveUnref(options.maxWait); if (timer) clearTimeout(timer); if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) { if (maxTimer) { clearTimeout(maxTimer); maxTimer = null; } return invoke(); } if (maxDuration && !maxTimer) { maxTimer = setTimeout(() => { if (timer) clearTimeout(timer); maxTimer = null; invoke(); }, maxDuration); } timer = setTimeout(() => { if (maxTimer) clearTimeout(maxTimer); maxTimer = null; invoke(); }, duration); }; return filter; } function throttleFilter(ms, trailing = true, leading = true) { let lastExec = 0; let timer; let isLeading = true; const clear = () => { if (timer) { clearTimeout(timer); timer = void 0; } }; const filter = (invoke) => { const duration = resolveUnref(ms); const elapsed = Date.now() - lastExec; clear(); if (duration <= 0) { lastExec = Date.now(); return invoke(); } if (elapsed > duration && (leading || !isLeading)) { lastExec = Date.now(); invoke(); } else if (trailing) { timer = setTimeout(() => { lastExec = Date.now(); isLeading = true; clear(); invoke(); }, duration); } if (!leading && !timer) timer = setTimeout(() => isLeading = true, duration); isLeading = false; }; return filter; } function identity$1(arg) { return arg; } function tryOnScopeDispose(fn) { if (vue.getCurrentScope()) { vue.onScopeDispose(fn); return true; } return false; } function useDebounceFn(fn, ms = 200, options = {}) { return createFilterWrapper(debounceFilter(ms, options), fn); } function refDebounced(value, ms = 200, options = {}) { if (ms <= 0) return value; const debounced = vue.ref(value.value); const updater = useDebounceFn(() => { debounced.value = value.value; }, ms, options); vue.watch(value, () => updater()); return debounced; } function useThrottleFn(fn, ms = 200, trailing = false, leading = true) { return createFilterWrapper(throttleFilter(ms, trailing, leading), fn); } function tryOnMounted(fn, sync = true) { if (vue.getCurrentInstance()) vue.onMounted(fn); else if (sync) fn(); else vue.nextTick(fn); } function useTimeoutFn(cb, interval, options = {}) { const { immediate = true } = options; const isPending = vue.ref(false); let timer = null; function clear() { if (timer) { clearTimeout(timer); timer = null; } } function stop() { isPending.value = false; clear(); } function start(...args) { clear(); isPending.value = true; timer = setTimeout(() => { isPending.value = false; timer = null; cb(...args); }, resolveUnref(interval)); } if (immediate) { isPending.value = true; if (isClient) start(); } tryOnScopeDispose(stop); return { isPending, start, stop }; } function unrefElement(elRef) { var _a; const plain = resolveUnref(elRef); return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain; } const defaultWindow = isClient ? window : void 0; const defaultDocument = isClient ? window.document : void 0; function useEventListener(...args) { let target; let event; let listener; let options; if (isString$2(args[0])) { [event, listener, options] = args; target = defaultWindow; } else { [target, event, listener, options] = args; } if (!target) return noop$1; let cleanup = noop$1; const stopWatch = vue.watch(() => unrefElement(target), (el) => { cleanup(); if (!el) return; el.addEventListener(event, listener, options); cleanup = () => { el.removeEventListener(event, listener, options); cleanup = noop$1; }; }, { immediate: true, flush: "post" }); const stop = () => { stopWatch(); cleanup(); }; tryOnScopeDispose(stop); return stop; } function onClickOutside(target, handler, options = {}) { const { window = defaultWindow, ignore, capture = true, detectIframe = false } = options; if (!window) return; const shouldListen = vue.ref(true); let fallback; const listener = (event) => { window.clearTimeout(fallback); const el = unrefElement(target); const composedPath = event.composedPath(); if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value) return; if (ignore && ignore.length > 0) { if (ignore.some((target2) => { const el2 = unrefElement(target2); return el2 && (event.target === el2 || composedPath.includes(el2)); })) return; } handler(event); }; const cleanup = [ useEventListener(window, "click", listener, { passive: true, capture }), useEventListener(window, "pointerdown", (e) => { const el = unrefElement(target); shouldListen.value = !!el && !e.composedPath().includes(el); }, { passive: true }), useEventListener(window, "pointerup", (e) => { if (e.button === 0) { const path = e.composedPath(); e.composedPath = () => path; fallback = window.setTimeout(() => listener(e), 50); } }, { passive: true }), detectIframe && useEventListener(window, "blur", (event) => { var _a; const el = unrefElement(target); if (((_a = document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(document.activeElement))) handler(event); }) ].filter(Boolean); const stop = () => cleanup.forEach((fn) => fn()); return stop; } function useActiveElement(options = {}) { const { window = defaultWindow } = options; const counter = vue.ref(0); if (window) { useEventListener(window, "blur", () => counter.value += 1, true); useEventListener(window, "focus", () => counter.value += 1, true); } return vue.computed(() => { counter.value; return window == null ? void 0 : window.document.activeElement; }); } function useSupported(callback, sync = false) { const isSupported = vue.ref(); const update = () => isSupported.value = Boolean(callback()); update(); tryOnMounted(update, sync); return isSupported; } const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; const globalKey = "__vueuse_ssr_handlers__"; _global[globalKey] = _global[globalKey] || {}; _global[globalKey]; function useCssVar(prop, target, { window = defaultWindow, initialValue = "" } = {}) { const variable = vue.ref(initialValue); const elRef = vue.computed(() => { var _a; return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement); }); vue.watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => { var _a; if (el && window) { const value = (_a = window.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a.trim(); variable.value = value || initialValue; } }, { immediate: true }); vue.watch(variable, (val) => { var _a; if ((_a = elRef.value) == null ? void 0 : _a.style) elRef.value.style.setProperty(resolveUnref(prop), val); }); return variable; } function useDocumentVisibility({ document = defaultDocument } = {}) { if (!document) return vue.ref("visible"); const visibility = vue.ref(document.visibilityState); useEventListener(document, "visibilitychange", () => { visibility.value = document.visibilityState; }); return visibility; } var __getOwnPropSymbols$f = Object.getOwnPropertySymbols; var __hasOwnProp$f = Object.prototype.hasOwnProperty; var __propIsEnum$f = Object.prototype.propertyIsEnumerable; var __objRest$2 = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols$f) for (var prop of __getOwnPropSymbols$f(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop)) target[prop] = source[prop]; } return target; }; function useResizeObserver(target, callback, options = {}) { const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]); let observer; const isSupported = useSupported(() => window && "ResizeObserver" in window); const cleanup = () => { if (observer) { observer.disconnect(); observer = void 0; } }; const stopWatch = vue.watch(() => unrefElement(target), (el) => { cleanup(); if (isSupported.value && window && el) { observer = new ResizeObserver(callback); observer.observe(el, observerOptions); } }, { immediate: true, flush: "post" }); const stop = () => { cleanup(); stopWatch(); }; tryOnScopeDispose(stop); return { isSupported, stop }; } function useElementBounding(target, options = {}) { const { reset = true, windowResize = true, windowScroll = true, immediate = true } = options; const height = vue.ref(0); const bottom = vue.ref(0); const left = vue.ref(0); const right = vue.ref(0); const top = vue.ref(0); const width = vue.ref(0); const x = vue.ref(0); const y = vue.ref(0); function update() { const el = unrefElement(target); if (!el) { if (reset) { height.value = 0; bottom.value = 0; left.value = 0; right.value = 0; top.value = 0; width.value = 0; x.value = 0; y.value = 0; } return; } const rect = el.getBoundingClientRect(); height.value = rect.height; bottom.value = rect.bottom; left.value = rect.left; right.value = rect.right; top.value = rect.top; width.value = rect.width; x.value = rect.x; y.value = rect.y; } useResizeObserver(target, update); vue.watch(() => unrefElement(target), (ele) => !ele && update()); if (windowScroll) useEventListener("scroll", update, { passive: true }); if (windowResize) useEventListener("resize", update, { passive: true }); tryOnMounted(() => { if (immediate) update(); }); return { height, bottom, left, right, top, width, x, y, update }; } var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols; var __hasOwnProp$7 = Object.prototype.hasOwnProperty; var __propIsEnum$7 = Object.prototype.propertyIsEnumerable; var __objRest$1 = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols$7) for (var prop of __getOwnPropSymbols$7(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop)) target[prop] = source[prop]; } return target; }; function useMutationObserver(target, callback, options = {}) { const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest$1(_a, ["window"]); let observer; const isSupported = useSupported(() => window && "MutationObserver" in window); const cleanup = () => { if (observer) { observer.disconnect(); observer = void 0; } }; const stopWatch = vue.watch(() => unrefElement(target), (el) => { cleanup(); if (isSupported.value && window && el) { observer = new MutationObserver(callback); observer.observe(el, mutationOptions); } }, { immediate: true }); const stop = () => { cleanup(); stopWatch(); }; tryOnScopeDispose(stop); return { isSupported, stop }; } var SwipeDirection; (function(SwipeDirection2) { SwipeDirection2["UP"] = "UP"; SwipeDirection2["RIGHT"] = "RIGHT"; SwipeDirection2["DOWN"] = "DOWN"; SwipeDirection2["LEFT"] = "LEFT"; SwipeDirection2["NONE"] = "NONE"; })(SwipeDirection || (SwipeDirection = {})); var __defProp = Object.defineProperty; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; const _TransitionPresets = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; __spreadValues({ linear: identity$1 }, _TransitionPresets); function useVModel(props, key, emit, options = {}) { var _a, _b, _c; const { passive = false, eventName, deep = false, defaultValue } = options; const vm = vue.getCurrentInstance(); const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy)); let event = eventName; if (!key) { { key = "modelValue"; } } event = eventName || event || `update:${key.toString()}`; const getValue = () => isDef(props[key]) ? props[key] : defaultValue; if (passive) { const proxy = vue.ref(getValue()); vue.watch(() => props[key], (v) => proxy.value = v); vue.watch(proxy, (v) => { if (v !== props[key] || deep) _emit(event, v); }, { deep }); return proxy; } else { return vue.computed({ get() { return getValue(); }, set(value) { _emit(event, value); } }); } } function useWindowFocus({ window = defaultWindow } = {}) { if (!window) return vue.ref(false); const focused = vue.ref(window.document.hasFocus()); useEventListener(window, "blur", () => { focused.value = false; }); useEventListener(window, "focus", () => { focused.value = true; }); return focused; } function useWindowSize(options = {}) { const { window = defaultWindow, initialWidth = Infinity, initialHeight = Infinity, listenOrientation = true } = options; const width = vue.ref(initialWidth); const height = vue.ref(initialHeight); const update = () => { if (window) { width.value = window.innerWidth; height.value = window.innerHeight; } }; update(); tryOnMounted(update); useEventListener("resize", update, { passive: true }); if (listenOrientation) useEventListener("orientationchange", update, { passive: true }); return { width, height }; } const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent); const isInContainer = (el, container) => { if (!isClient || !el || !container) return false; const elRect = el.getBoundingClientRect(); let containerRect; if (container instanceof Element) { containerRect = container.getBoundingClientRect(); } else { containerRect = { top: 0, right: window.innerWidth, bottom: window.innerHeight, left: 0 }; } return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right; }; const getOffsetTop = (el) => { let offset = 0; let parent = el; while (parent) { offset += parent.offsetTop; parent = parent.offsetParent; } return offset; }; const getOffsetTopDistance = (el, containerEl) => { return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl)); }; const getClientXY = (event) => { let clientX; let clientY; if (event.type === "touchend") { clientY = event.changedTouches[0].clientY; clientX = event.changedTouches[0].clientX; } else if (event.type.startsWith("touch")) { clientY = event.touches[0].clientY; clientX = event.touches[0].clientX; } else { clientY = event.clientY; clientX = event.clientX; } return { clientX, clientY }; }; function easeInOutCubic(t, b, c, d) { const cc = c - b; t /= d / 2; if (t < 1) { return cc / 2 * t * t * t + b; } return cc / 2 * ((t -= 2) * t * t + 2) + b; } const NOOP = () => { }; const hasOwnProperty$p = Object.prototype.hasOwnProperty; const hasOwn = (val, key) => hasOwnProperty$p.call(val, key); const isArray$1 = Array.isArray; const isDate$1 = (val) => toTypeString(val) === "[object Date]"; const isFunction$1 = (val) => typeof val === "function"; const isString$1 = (val) => typeof val === "string"; const isObject$1 = (val) => val !== null && typeof val === "object"; const isPromise = (val) => { return isObject$1(val) && isFunction$1(val.then) && isFunction$1(val.catch); }; const objectToString$1 = Object.prototype.toString; const toTypeString = (value) => objectToString$1.call(value); const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]"; const cacheStringFunction = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; const camelizeRE = /-(\w)/g; const camelize = cacheStringFunction((str) => { return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); }); const hyphenateRE = /\B([A-Z])/g; const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); const capitalize$2 = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var Symbol$1 = root.Symbol; var objectProto$s = Object.prototype; var hasOwnProperty$o = objectProto$s.hasOwnProperty; var nativeObjectToString$3 = objectProto$s.toString; var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0; function getRawTag(value) { var isOwn = hasOwnProperty$o.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = true; } catch (e) { } var result = nativeObjectToString$3.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } var objectProto$r = Object.prototype; var nativeObjectToString$2 = objectProto$r.toString; function objectToString(value) { return nativeObjectToString$2.call(value); } var nullTag = "[object Null]"; var undefinedTag = "[object Undefined]"; var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; function baseGetTag(value) { if (value == null) { return value === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } function isObjectLike(value) { return value != null && typeof value == "object"; } var symbolTag$3 = "[object Symbol]"; function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3; } var NAN$2 = 0 / 0; function baseToNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN$2; } return +value; } function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } var isArray = Array.isArray; var INFINITY$5 = 1 / 0; var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0; var symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0; function baseToString(value) { if (typeof value == "string") { return value; } if (isArray(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result = value + ""; return result == "0" && 1 / value == -INFINITY$5 ? "-0" : result; } function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === void 0 && other === void 0) { return defaultValue; } if (value !== void 0) { result = value; } if (other !== void 0) { if (result === void 0) { return other; } if (typeof value == "string" || typeof other == "string") { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0); var reWhitespace = /\s/; function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) { } return index; } var reTrimStart$2 = /^\s+/; function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart$2, "") : string; } function isObject(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } var NAN$1 = 0 / 0; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsOctal = /^0o[0-7]+$/i; var freeParseInt = parseInt; function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN$1; } if (isObject(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN$1 : +value; } var INFINITY$4 = 1 / 0; var MAX_INTEGER = 17976931348623157e292; function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY$4 || value === -INFINITY$4) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } var FUNC_ERROR_TEXT$b = "Expected a function"; function after(n, func) { if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT$b); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } function identity(value) { return value; } var asyncTag = "[object AsyncFunction]"; var funcTag$2 = "[object Function]"; var genTag$1 = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; function isFunction(value) { if (!isObject(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; } var coreJsData = root["__core-js_shared__"]; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var funcProto$2 = Function.prototype; var funcToString$2 = funcProto$2.toString; function toSource(func) { if (func != null) { try { return funcToString$2.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var funcProto$1 = Function.prototype; var objectProto$q = Object.prototype; var funcToString$1 = funcProto$1.toString; var hasOwnProperty$n = objectProto$q.hasOwnProperty; var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$n).replace(reRegExpChar$1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } function getValue$1(object, key) { return object == null ? void 0 : object[key]; } function getNative(object, key) { var value = getValue$1(object, key); return baseIsNative(value) ? value : void 0; } var WeakMap = getNative(root, "WeakMap"); var metaMap = WeakMap && new WeakMap(); var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; var objectCreate = Object.create; var baseCreate = function() { function object() { } return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object(); object.prototype = void 0; return result; }; }(); function createCtor(Ctor) { return function() { var args = arguments; switch (args.length) { case 0: return new Ctor(); case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); return isObject(result) ? result : thisBinding; }; } var WRAP_BIND_FLAG$8 = 1; function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG$8, Ctor = createCtor(func); function wrapper() { var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } var nativeMax$g = Math.max; function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$g(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } var nativeMax$f = Math.max; function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax$f(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } function baseLodash() { } var MAX_ARRAY_LENGTH$6 = 4294967295; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH$6; this.__views__ = []; } LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; function noop() { } var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; var realNames = {}; var objectProto$p = Object.prototype; var hasOwnProperty$m = objectProto$p.hasOwnProperty; function getFuncName(func) { var result = func.name + "", array = realNames[result], length = hasOwnProperty$m.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = void 0; } LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } var objectProto$o = Object.prototype; var hasOwnProperty$l = objectProto$o.hasOwnProperty; function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty$l.call(value, "__wrapped__")) { return wrapperClone(value); } } return new LodashWrapper(value); } lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } var HOT_COUNT = 800; var HOT_SPAN = 16; var nativeNow = Date.now; function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(void 0, arguments); }; } var setData = shortOut(baseSetData); var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/; var reSplitDetails = /,? & /; function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; details = details.join(length > 2 ? ", " : " "); return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); } function constant(value) { return function() { return value; }; } var defineProperty = function() { try { var func = getNative(Object, "defineProperty"); func({}, "", {}); return func; } catch (e) { } }(); var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; var setToString = shortOut(baseSetToString); function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index-- : ++index < length) { if (predicate(array[index], index, array)) { return index; } } return -1; } function baseIsNaN(value) { return value !== value; } function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } var WRAP_BIND_FLAG$7 = 1; var WRAP_BIND_KEY_FLAG$6 = 2; var WRAP_CURRY_FLAG$6 = 8; var WRAP_CURRY_RIGHT_FLAG$3 = 16; var WRAP_PARTIAL_FLAG$6 = 32; var WRAP_PARTIAL_RIGHT_FLAG$3 = 64; var WRAP_ARY_FLAG$4 = 128; var WRAP_REARG_FLAG$3 = 256; var WRAP_FLIP_FLAG$2 = 512; var wrapFlags = [ ["ary", WRAP_ARY_FLAG$4], ["bind", WRAP_BIND_FLAG$7], ["bindKey", WRAP_BIND_KEY_FLAG$6], ["curry", WRAP_CURRY_FLAG$6], ["curryRight", WRAP_CURRY_RIGHT_FLAG$3], ["flip", WRAP_FLIP_FLAG$2], ["partial", WRAP_PARTIAL_FLAG$6], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG$3], ["rearg", WRAP_REARG_FLAG$3] ]; function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = "_." + pair[0]; if (bitmask & pair[1] && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } function setWrapToString(wrapper, reference, bitmask) { var source = reference + ""; return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } var WRAP_BIND_FLAG$6 = 1; var WRAP_BIND_KEY_FLAG$5 = 2; var WRAP_CURRY_BOUND_FLAG$1 = 4; var WRAP_CURRY_FLAG$5 = 8; var WRAP_PARTIAL_FLAG$5 = 32; var WRAP_PARTIAL_RIGHT_FLAG$2 = 64; function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG$5, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials; bitmask |= isCurry ? WRAP_PARTIAL_FLAG$5 : WRAP_PARTIAL_RIGHT_FLAG$2; bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$2 : WRAP_PARTIAL_FLAG$5); if (!(bitmask & WRAP_CURRY_BOUND_FLAG$1)) { bitmask &= ~(WRAP_BIND_FLAG$6 | WRAP_BIND_KEY_FLAG$5); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(void 0, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } function getHolder(func) { var object = func; return object.placeholder; } var MAX_SAFE_INTEGER$5 = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER$5 : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } var nativeMin$e = Math.min; function reorder(array, indexes) { var arrLength = array.length, length = nativeMin$e(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : void 0; } return array; } var PLACEHOLDER$1 = "__lodash_placeholder__"; function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER$1) { array[index] = PLACEHOLDER$1; result[resIndex++] = index; } } return result; } var WRAP_BIND_FLAG$5 = 1; var WRAP_BIND_KEY_FLAG$4 = 2; var WRAP_CURRY_FLAG$4 = 8; var WRAP_CURRY_RIGHT_FLAG$2 = 16; var WRAP_ARY_FLAG$3 = 128; var WRAP_FLIP_FLAG$1 = 512; function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG$3, isBind = bitmask & WRAP_BIND_FLAG$5, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$4, isCurried = bitmask & (WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2), isFlip = bitmask & WRAP_FLIP_FLAG$1, Ctor = isBindKey ? void 0 : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, void 0, args, holders, void 0, void 0, arity - length); } var fn = this && this !== root && this instanceof wrapper ? Ctor : func; return apply(fn, this, args); } return wrapper; } var WRAP_BIND_FLAG$4 = 1; function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG$4, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } var PLACEHOLDER = "__lodash_placeholder__"; var WRAP_BIND_FLAG$3 = 1; var WRAP_BIND_KEY_FLAG$3 = 2; var WRAP_CURRY_BOUND_FLAG = 4; var WRAP_CURRY_FLAG$3 = 8; var WRAP_ARY_FLAG$2 = 128; var WRAP_REARG_FLAG$2 = 256; var nativeMin$d = Math.min; function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$3 | WRAP_BIND_KEY_FLAG$3 | WRAP_ARY_FLAG$2); var isCombo = srcBitmask == WRAP_ARY_FLAG$2 && bitmask == WRAP_CURRY_FLAG$3 || srcBitmask == WRAP_ARY_FLAG$2 && bitmask == WRAP_REARG_FLAG$2 && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG$2 | WRAP_REARG_FLAG$2) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG$3; if (!(isCommon || isCombo)) { return data; } if (srcBitmask & WRAP_BIND_FLAG$3) { data[2] = source[2]; newBitmask |= bitmask & WRAP_BIND_FLAG$3 ? 0 : WRAP_CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials