unika-components
Version:
Unika Vue3 components library
1,672 lines (1,499 loc) • 2.34 MB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('crypto')) :
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'crypto'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["unika-components"] = {}, global.vue, global.crypto));
})(this, (function (exports, vue, crypto) { 'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
var script$k = vue.defineComponent({
name: 'UniText',
props: {
element: {
type: Object,
required: true
}
},
setup(props) {
const element = props.element || {};
const css = element.css || {};
const properties = element.properties || {};
// 计算阴影样式
const boxShadowStyle = vue.computed(() => {
if (!properties.shadowSize)
return 'none';
return `${properties.shadowX || 0}px ${properties.shadowY || 0}px ${properties.shadowBlur || 0}px ${properties.shadowColor || '#000'}`;
});
// 计算动画样式
const animationStyle = vue.computed(() => {
if (!properties.animations || properties.animations.length === 0)
return {};
const animation = properties.animations[0];
return {
animation: `${animation.animate} ${animation.duration || 1}s ${animation.timing || 'ease'} ${animation.delay || 0}s ${animation.count || 1} ${animation.loop ? 'infinite' : ''}`
};
});
// 计算文本动画类名
const textAniClasses = vue.computed(() => {
if (!properties.textAni || !Array.isArray(properties.textAni) || properties.textAni.length === 0)
return [];
return properties.textAni.map((ani) => `text-${ani.animate}`);
});
// 计算样式
const computedStyle = vue.computed(() => ({
position: 'absolute',
left: `${css.left || 0}px`,
top: `${css.top || 0}px`,
width: `${css.width || 100}px`,
height: 'auto',
transform: `rotate(${css.transform || 0}deg)`,
}));
// 计算文本样式
const textCommonStyle = vue.computed(() => ({
fontFamily: css.fontFamily || 'gorilla',
fontSize: `${css.fontSize || 16}px`,
lineHeight: css.lineHeight || 1,
letterSpacing: `${css.letterSpacing || 0}px`,
fontWeight: css.fontWeight || 'normal',
fontStyle: css.fontStyle || 'normal',
textDecoration: css.textDecoration || 'none',
textAlign: css.textAlign || 'center',
color: css.color || '#000',
opacity: 1,
padding: `${css.padding || 0}px`,
textIndent: `${css.textIndent || 0}px`,
display: 'none'
}));
const textEditorStyle = vue.computed(() => ({
...textCommonStyle.value,
writingMode: css.writingMode,
display: 'block', // 确保文本编辑器可见
}));
return {
css,
properties,
boxShadowStyle,
animationStyle,
textAniClasses,
computedStyle,
textCommonStyle,
textEditorStyle
};
}
});
const _hoisted_1$b = ["data-id", "data-pid", "data-type", "sign", "signsort", "layername"];
const _hoisted_2$3 = /*#__PURE__*/vue.createStaticVNode("<div class=\"drag-point top-center\" data-v-55ed80cb></div><div class=\"drag-point bottom-center\" data-v-55ed80cb></div><div class=\"drag-point left-top\" data-v-55ed80cb></div><div class=\"drag-point left-center\" data-v-55ed80cb></div><div class=\"drag-point left-bottom\" data-v-55ed80cb></div><div class=\"drag-point right-top\" data-v-55ed80cb></div><div class=\"drag-point right-center\" data-v-55ed80cb></div><div class=\"drag-point right-bottom\" data-v-55ed80cb></div><div class=\"drag-point rotate-icon\" data-v-55ed80cb><i class=\"iconfont hb-xuanzhuan\" data-v-55ed80cb></i></div>", 9);
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
return (_ctx.element && _ctx.properties.visible)
? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(['ele-text', 'eles']),
"data-id": _ctx.element.id,
"data-pid": _ctx.element.pid,
"data-type": _ctx.element.type,
style: vue.normalizeStyle(_ctx.computedStyle),
sign: _ctx.element.sign,
signsort: _ctx.element.signSort,
layername: _ctx.element.layerName
}, [
vue.createElementVNode("div", {
class: "ani-wrap",
style: vue.normalizeStyle({
backgroundColor: _ctx.css.backgroundColor || 'transparent',
borderRadius: `${_ctx.css.borderRadius || 0}px`,
borderColor: _ctx.css.borderColor,
borderStyle: _ctx.css.borderStyle,
borderWidth: `${_ctx.css.borderWidth || 0}px`,
boxShadow: _ctx.boxShadowStyle,
opacity: _ctx.css.opacity || 1,
animation: _ctx.css.animation
})
}, [
vue.createElementVNode("div", {
class: "text-common text-ani",
style: vue.normalizeStyle(_ctx.textCommonStyle)
}, null, 4 /* STYLE */),
vue.createElementVNode("div", {
contenteditable: "false",
class: "text-common text-editor",
style: vue.normalizeStyle(_ctx.textEditorStyle)
}, vue.toDisplayString(_ctx.element.textContent), 5 /* TEXT, STYLE */)
], 4 /* STYLE */),
_hoisted_2$3
], 12 /* STYLE, PROPS */, _hoisted_1$b))
: vue.createCommentVNode("v-if", true)
}
script$k.render = render$l;
script$k.__scopeId = "data-v-55ed80cb";
script$k.__file = "src/components/UniText/UniText.vue";
script$k.install = (app) => {
app.component(script$k.name, script$k);
};
/** Detect free variable `global` from Node.js. */
var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
var freeGlobal$3 = freeGlobal$2;
/** Detect free variable `self`. */
var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root$2 = freeGlobal$3 || freeSelf$1 || Function('return this')();
var root$3 = root$2;
/** Built-in value references. */
var Symbol$3 = root$3.Symbol;
var Symbol$4 = Symbol$3;
/** Used for built-in method references. */
var objectProto$v = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$q = objectProto$v.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString$3 = objectProto$v.toString;
/** Built-in value references. */
var symToStringTag$3 = Symbol$4 ? Symbol$4.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag$1(value) {
var isOwn = hasOwnProperty$q.call(value, symToStringTag$3),
tag = value[symToStringTag$3];
try {
value[symToStringTag$3] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString$3.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag$3] = tag;
} else {
delete value[symToStringTag$3];
}
}
return result;
}
/** Used for built-in method references. */
var objectProto$u = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString$2 = objectProto$u.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString$1(value) {
return nativeObjectToString$2.call(value);
}
/** `Object#toString` result references. */
var nullTag$1 = '[object Null]',
undefinedTag$1 = '[object Undefined]';
/** Built-in value references. */
var symToStringTag$2 = Symbol$4 ? Symbol$4.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag$1(value) {
if (value == null) {
return value === undefined ? undefinedTag$1 : nullTag$1;
}
return (symToStringTag$2 && symToStringTag$2 in Object(value))
? getRawTag$1(value)
: objectToString$1(value);
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike$1(value) {
return value != null && typeof value == 'object';
}
/** `Object#toString` result references. */
var symbolTag$6 = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike$1(value) && baseGetTag$1(value) == symbolTag$6);
}
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
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;
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray$4 = Array.isArray;
var isArray$5 = isArray$4;
/** Used as references for various `Number` constants. */
var INFINITY$2 = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto$4 = Symbol$4 ? Symbol$4.prototype : undefined,
symbolToString = symbolProto$4 ? symbolProto$4.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray$5(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY$2) ? '-0' : result;
}
/** Used to match a single whitespace character. */
var reWhitespace = /\s/;
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
* character of `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the index of the last non-whitespace character.
*/
function trimmedEndIndex(string) {
var index = string.length;
while (index-- && reWhitespace.test(string.charAt(index))) {}
return index;
}
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject$4(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject$4(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject$4(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 : +value);
}
/** Used as references for various `Number` constants. */
var INFINITY$1 = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY$1 || value === -INFINITY$1) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger$1(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
/** `Object#toString` result references. */
var asyncTag$1 = '[object AsyncFunction]',
funcTag$5 = '[object Function]',
genTag$3 = '[object GeneratorFunction]',
proxyTag$1 = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction$3(value) {
if (!isObject$4(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag$1(value);
return tag == funcTag$5 || tag == genTag$3 || tag == asyncTag$1 || tag == proxyTag$1;
}
/** Used to detect overreaching core-js shims. */
var coreJsData$2 = root$3['__core-js_shared__'];
var coreJsData$3 = coreJsData$2;
/** Used to detect methods masquerading as native. */
var maskSrcKey$1 = (function() {
var uid = /[^.]+$/.exec(coreJsData$3 && coreJsData$3.keys && coreJsData$3.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked$1(func) {
return !!maskSrcKey$1 && (maskSrcKey$1 in func);
}
/** Used for built-in method references. */
var funcProto$4 = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString$4 = funcProto$4.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource$1(func) {
if (func != null) {
try {
return funcToString$4.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor$1 = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto$3 = Function.prototype,
objectProto$t = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString$3 = funcProto$3.toString;
/** Used to check objects for own properties. */
var hasOwnProperty$p = objectProto$t.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative$1 = RegExp('^' +
funcToString$3.call(hasOwnProperty$p).replace(reRegExpChar$1, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative$1(value) {
if (!isObject$4(value) || isMasked$1(value)) {
return false;
}
var pattern = isFunction$3(value) ? reIsNative$1 : reIsHostCtor$1;
return pattern.test(toSource$1(value));
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue$4(object, key) {
return object == null ? undefined : object[key];
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative$1(object, key) {
var value = getValue$4(object, key);
return baseIsNative$1(value) ? value : undefined;
}
/* Built-in method references that are verified to be native. */
var WeakMap$2 = getNative$1(root$3, 'WeakMap');
var WeakMap$3 = WeakMap$2;
/** Built-in value references. */
var objectCreate$1 = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate$2 = (function() {
function object() {}
return function(proto) {
if (!isObject$4(proto)) {
return {};
}
if (objectCreate$1) {
return objectCreate$1(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
var baseCreate$3 = baseCreate$2;
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
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);
}
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray$1(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
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(undefined, arguments);
};
}
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
var defineProperty$2 = (function() {
try {
var func = getNative$1(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
var defineProperty$3 = defineProperty$2;
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty$3 ? identity : function(func, string) {
return defineProperty$3(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
var baseSetToString$1 = baseSetToString;
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString$1);
var setToString$1 = setToString;
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach$1(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
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;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER$3 = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint$1 = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex$1(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER$3 : length;
return !!length &&
(type == 'number' ||
(type != 'symbol' && reIsUint$1.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue$1(object, key, value) {
if (key == '__proto__' && defineProperty$3) {
defineProperty$3(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq$1(value, other) {
return value === other || (value !== value && other !== other);
}
/** Used for built-in method references. */
var objectProto$s = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$o = objectProto$s.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue$1(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty$o.call(object, key) && eq$1(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue$1(object, key, value);
}
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject$1(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue$1(object, key, newValue);
} else {
assignValue$1(object, key, newValue);
}
}
return object;
}
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax$2 = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax$2(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax$2(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString$1(overRest(func, start, identity), func + '');
}
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER$2 = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength$1(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$2;
}
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike$1(value) {
return value != null && isLength$1(value.length) && !isFunction$3(value);
}
/** Used for built-in method references. */
var objectProto$r = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype$1(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$r;
return value === proto;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes$1(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/** `Object#toString` result references. */
var argsTag$7 = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments$1(value) {
return isObjectLike$1(value) && baseGetTag$1(value) == argsTag$7;
}
/** Used for built-in method references. */
var objectProto$q = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$n = objectProto$q.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable$3 = objectProto$q.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments$2 = baseIsArguments$1(function() { return arguments; }()) ? baseIsArguments$1 : function(value) {
return isObjectLike$1(value) && hasOwnProperty$n.call(value, 'callee') &&
!propertyIsEnumerable$3.call(value, 'callee');
};
var isArguments$3 = isArguments$2;
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse$1() {
return false;
}
/** Detect free variable `exports`. */
var freeExports$5 = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule$5 = freeExports$5 && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports$5 = freeModule$5 && freeModule$5.exports === freeExports$5;
/** Built-in value references. */
var Buffer$2 = moduleExports$5 ? root$3.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer$1 = Buffer$2 ? Buffer$2.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer$2 = nativeIsBuffer$1 || stubFalse$1;
var isBuffer$3 = isBuffer$2;
/** `Object#toString` result references. */
var argsTag$6 = '[object Arguments]',
arrayTag$5 = '[object Array]',
boolTag$7 = '[object Boolean]',
dateTag$7 = '[object Date]',
errorTag$5 = '[object Error]',
funcTag$4 = '[object Function]',
mapTag$c = '[object Map]',
numberTag$7 = '[object Number]',
objectTag$8 = '[object Object]',
regexpTag$7 = '[object RegExp]',
setTag$c = '[object Set]',
stringTag$7 = '[object String]',
weakMapTag$5 = '[object WeakMap]';
var arrayBufferTag$7 = '[object ArrayBuffer]',
dataViewTag$9 = '[object DataView]',
float32Tag$5 = '[object Float32Array]',
float64Tag$5 = '[object Float64Array]',
int8Tag$5 = '[object Int8Array]',
int16Tag$5 = '[object Int16Array]',
int32Tag$5 = '[object Int32Array]',
uint8Tag$5 = '[object Uint8Array]',
uint8ClampedTag$5 = '[object Uint8ClampedArray]',
uint16Tag$5 = '[object Uint16Array]',
uint32Tag$5 = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags$1 = {};
typedArrayTags$1[float32Tag$5] = typedArrayTags$1[float64Tag$5] =
typedArrayTags$1[int8Tag$5] = typedArrayTags$1[int16Tag$5] =
typedArrayTags$1[int32Tag$5] = typedArrayTags$1[uint8Tag$5] =
typedArrayTags$1[uint8ClampedTag$5] = typedArrayTags$1[uint16Tag$5] =
typedArrayTags$1[uint32Tag$5] = true;
typedArrayTags$1[argsTag$6] = typedArrayTags$1[arrayTag$5] =
typedArrayTags$1[arrayBufferTag$7] = typedArrayTags$1[boolTag$7] =
typedArrayTags$1[dataViewTag$9] = typedArrayTags$1[dateTag$7] =
typedArrayTags$1[errorTag$5] = typedArrayTags$1[funcTag$4] =
typedArrayTags$1[mapTag$c] = typedArrayTags$1[numberTag$7] =
typedArrayTags$1[objectTag$8] = typedArrayTags$1[regexpTag$7] =
typedArrayTags$1[setTag$c] = typedArrayTags$1[stringTag$7] =
typedArrayTags$1[weakMapTag$5] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray$1(value) {
return isObjectLike$1(value) &&
isLength$1(value.length) && !!typedArrayTags$1[baseGetTag$1(value)];
}
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary$1(func) {
return function(value) {
return func(value);
};
}
/** Detect free variable `exports`. */
var freeExports$4 = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule$4 = freeExports$4 && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports$4 = freeModule$4 && freeModule$4.exports === freeExports$4;
/** Detect free variable `process` from Node.js. */
var freeProcess$1 = moduleExports$4 && freeGlobal$3.process;
/** Used to access faster Node.js helpers. */
var nodeUtil$2 = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule$4 && freeModule$4.require && freeModule$4.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess$1 && freeProcess$1.binding && freeProcess$1.binding('util');
} catch (e) {}
}());
var nodeUtil$3 = nodeUtil$2;
/* Node.js helper references. */
var nodeIsTypedArray$1 = nodeUtil$3 && nodeUtil$3.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray$2 = nodeIsTypedArray$1 ? baseUnary$1(nodeIsTypedArray$1) : baseIsTypedArray$1;
var isTypedArray$3 = isTypedArray$2;
/** Used for built-in method references. */
var objectProto$p = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$m = objectProto$p.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys$1(value, inherited) {
var isArr = isArray$5(value),
isArg = !isArr && isArguments$3(value),
isBuff = !isArr && !isArg && isBuffer$3(value),
isType = !isArr && !isArg && !isBuff && isTypedArray$3(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes$1(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty$m.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex$1(key, length)
))) {
result.push(key);
}
}
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg$1(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys$2 = overArg$1(Object.keys, Object);
var nativeKeys$3 = nativeKeys$2;
/** Used for built-in method references. */
var objectProto$o = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$l = objectProto$o.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys$1(object) {
if (!isPrototype$1(object)) {
return nativeKeys$3(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty$l.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys$2(object) {
return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys$1(object);
}
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn$1(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/** Used for built-in method references. */
var objectProto$n = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty$k = objectProto$n.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Obj