UNPKG

@ly-js/ui

Version:

`@ly-js/ui` 是基于`vue3`常用库,会在`@ly-js/element`、`@ly-js/vant`中引入

1,456 lines (1,451 loc) 70 kB
/*! * @ly-js/ui v0.0.24 * (c) 2021-2022 liyu */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@vueuse/core')) : typeof define === 'function' && define.amd ? define(['exports', 'vue', '@vueuse/core'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LyUi = {}, global.Vue, global.VueUse)); })(this, (function (exports, vue, core) { 'use strict'; /*! * @ly-js/utils v0.0.6 * (c) 2021-2022 liyu */ const inBrowser = typeof window !== "undefined"; const isDef = (val) => val !== void 0 && val !== null; const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val); const isUndefined = (value) => typeof value === "undefined"; const isArray$2 = Array.isArray; const isString = (val) => typeof val === "string"; const isObject$1 = (val) => val !== null && typeof val === "object"; const cacheStringFunction = (fn) => { const cache = 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() : ""); }); function addUnit(value) { if (isDef(value)) { return isNumeric(value) ? `${value}px` : String(value); } return void 0; } var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeGlobal$1 = freeGlobal; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal$1 || freeSelf || Function("return this")(); var root$1 = root; var Symbol = root$1.Symbol; var Symbol$1 = Symbol; var objectProto$4 = Object.prototype; var hasOwnProperty$3 = objectProto$4.hasOwnProperty; var nativeObjectToString$1 = objectProto$4.toString; var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0; function getRawTag(value) { var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = true; } catch (e) { } var result = nativeObjectToString$1.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } var objectProto$3 = Object.prototype; var nativeObjectToString = objectProto$3.toString; function objectToString(value) { return nativeObjectToString.call(value); } var nullTag = "[object Null]", 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 = "[object Symbol]"; function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; } var isArray = Array.isArray; var isArray$1 = isArray; var reWhitespace = /\s/; function trimmedEndIndex(string) { var index2 = string.length; while (index2-- && reWhitespace.test(string.charAt(index2))) { } return index2; } var reTrimStart = /^\s+/; function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; } function isObject(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } var NAN = 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; } 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 : +value; } var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292; function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { 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; } function identity(value) { return value; } var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; function isFunction(value) { if (!isObject(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } var coreJsData = root$1["__core-js_shared__"]; var coreJsData$1 = coreJsData; var maskSrcKey = function() { var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || ""); return uid ? "Symbol(src)_1." + uid : ""; }(); function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var funcProto$1 = Function.prototype; var funcToString$1 = funcProto$1.toString; function toSource(func) { if (func != null) { try { return funcToString$1.call(func); } catch (e) { } try { return func + ""; } catch (e) { } } return ""; } var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var funcProto = Function.prototype, objectProto$2 = Object.prototype; var funcToString = funcProto.toString; var hasOwnProperty$2 = objectProto$2.hasOwnProperty; var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").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(object, key) { return object == null ? void 0 : object[key]; } function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : void 0; } var WeakMap$1 = getNative(root$1, "WeakMap"); var WeakMap$2 = WeakMap$1; var metaMap = WeakMap$2 && new WeakMap$2(); var metaMap$1 = metaMap; var baseSetData = !metaMap$1 ? identity : function(func, data) { metaMap$1.set(func, data); return func; }; var baseSetData$1 = baseSetData; 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; }; }(); var baseCreate$1 = baseCreate; 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$1(Ctor.prototype), result = Ctor.apply(thisBinding, args); return isObject(result) ? result : thisBinding; }; } var WRAP_BIND_FLAG$6 = 1; function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG$6, Ctor = createCtor(func); function wrapper() { var fn = this && this !== root$1 && 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$2 = Math.max; function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$2(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$1 = 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$1(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 = 4294967295; function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } LazyWrapper.prototype = baseCreate$1(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; function noop() { } var getData = !metaMap$1 ? noop : function(func) { return metaMap$1.get(func); }; var getData$1 = getData; var realNames = {}; var realNames$1 = realNames; var objectProto$1 = Object.prototype; var hasOwnProperty$1 = objectProto$1.hasOwnProperty; function getFuncName(func) { var result = func.name + "", array = realNames$1[result], length = hasOwnProperty$1.call(realNames$1, 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$1(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; function copyArray(source, array) { var index2 = -1, length = source.length; array || (array = Array(length)); while (++index2 < length) { array[index2] = source[index2]; } 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 = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function lodash(value) { if (isObjectLike(value) && !isArray$1(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.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$1(other); return !!data && func === data[0]; } var HOT_COUNT = 800, 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$1); var setData$1 = setData; var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 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 defineProperty$1 = defineProperty; var baseSetToString = !defineProperty$1 ? identity : function(func, string) { return defineProperty$1(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string), "writable": true }); }; var baseSetToString$1 = baseSetToString; var setToString = shortOut(baseSetToString$1); var setToString$1 = setToString; function arrayEach(array, iteratee) { var index2 = -1, length = array == null ? 0 : array.length; while (++index2 < length) { if (iteratee(array[index2], index2, array) === false) { break; } } return array; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index2-- : ++index2 < length) { if (predicate(array[index2], index2, array)) { return index2; } } return -1; } function baseIsNaN(value) { return value !== value; } function strictIndexOf(array, value, fromIndex) { var index2 = fromIndex - 1, length = array.length; while (++index2 < length) { if (array[index2] === value) { return index2; } } 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$5 = 1, WRAP_BIND_KEY_FLAG$4 = 2, WRAP_CURRY_FLAG$5 = 8, WRAP_CURRY_RIGHT_FLAG$2 = 16, WRAP_PARTIAL_FLAG$2 = 32, WRAP_PARTIAL_RIGHT_FLAG$2 = 64, WRAP_ARY_FLAG$2 = 128, WRAP_REARG_FLAG$1 = 256, WRAP_FLIP_FLAG$1 = 512; var wrapFlags = [ ["ary", WRAP_ARY_FLAG$2], ["bind", WRAP_BIND_FLAG$5], ["bindKey", WRAP_BIND_KEY_FLAG$4], ["curry", WRAP_CURRY_FLAG$5], ["curryRight", WRAP_CURRY_RIGHT_FLAG$2], ["flip", WRAP_FLIP_FLAG$1], ["partial", WRAP_PARTIAL_FLAG$2], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG$2], ["rearg", WRAP_REARG_FLAG$1] ]; 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$1(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } var WRAP_BIND_FLAG$4 = 1, WRAP_BIND_KEY_FLAG$3 = 2, WRAP_CURRY_BOUND_FLAG$1 = 4, WRAP_CURRY_FLAG$4 = 8, WRAP_PARTIAL_FLAG$1 = 32, WRAP_PARTIAL_RIGHT_FLAG$1 = 64; function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG$4, 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$1 : WRAP_PARTIAL_RIGHT_FLAG$1; bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$1 : WRAP_PARTIAL_FLAG$1); if (!(bitmask & WRAP_CURRY_BOUND_FLAG$1)) { bitmask &= ~(WRAP_BIND_FLAG$4 | WRAP_BIND_KEY_FLAG$3); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(void 0, newData); if (isLaziable(func)) { setData$1(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } function getHolder(func) { var object = func; return object.placeholder; } var MAX_SAFE_INTEGER = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } var nativeMin$1 = Math.min; function reorder(array, indexes) { var arrLength = array.length, length = nativeMin$1(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index2 = indexes[length]; array[length] = isIndex(index2, arrLength) ? oldArray[index2] : void 0; } return array; } var PLACEHOLDER$1 = "__lodash_placeholder__"; function replaceHolders(array, placeholder) { var index2 = -1, length = array.length, resIndex = 0, result = []; while (++index2 < length) { var value = array[index2]; if (value === placeholder || value === PLACEHOLDER$1) { array[index2] = PLACEHOLDER$1; result[resIndex++] = index2; } } return result; } var WRAP_BIND_FLAG$3 = 1, WRAP_BIND_KEY_FLAG$2 = 2, WRAP_CURRY_FLAG$3 = 8, WRAP_CURRY_RIGHT_FLAG$1 = 16, WRAP_ARY_FLAG$1 = 128, WRAP_FLIP_FLAG = 512; function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG$1, isBind = bitmask & WRAP_BIND_FLAG$3, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$2, isCurried = bitmask & (WRAP_CURRY_FLAG$3 | WRAP_CURRY_RIGHT_FLAG$1), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? void 0 : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index2 = length; while (index2--) { args[index2] = arguments[index2]; } 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$1 && 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), index2 = length, placeholder = getHolder(wrapper); while (index2--) { args[index2] = arguments[index2]; } 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$1 && this instanceof wrapper ? Ctor : func; return apply(fn, this, args); } return wrapper; } var WRAP_BIND_FLAG$2 = 1; function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG$2, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root$1 && 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$1 = 1, WRAP_BIND_KEY_FLAG$1 = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG$2 = 8, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256; var nativeMin = Math.min; function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$1 | WRAP_BIND_KEY_FLAG$1 | WRAP_ARY_FLAG); var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG$2 || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG$2; if (!(isCommon || isCombo)) { return data; } if (srcBitmask & WRAP_BIND_FLAG$1) { data[2] = source[2]; newBitmask |= bitmask & WRAP_BIND_FLAG$1 ? 0 : WRAP_CURRY_BOUND_FLAG; } var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } value = source[7]; if (value) { data[7] = value; } if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } if (data[9] == null) { data[9] = source[9]; } data[0] = source[0]; data[1] = newBitmask; return data; } var FUNC_ERROR_TEXT = "Expected a function"; var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG$1 = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64; var nativeMax = Math.max; function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = void 0; } ary = ary === void 0 ? ary : nativeMax(toInteger(ary), 0); arity = arity === void 0 ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = void 0; } var data = isBindKey ? void 0 : getData$1(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === void 0 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG$1 | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG$1 | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG$1 || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(void 0, newData); } var setter = data ? baseSetData$1 : setData$1; return setWrapToString(setter(result, newData), func, bitmask); } var WRAP_CURRY_FLAG = 8; function curry(func, arity, guard) { arity = guard ? void 0 : arity; var result = createWrap(func, WRAP_CURRY_FLAG, void 0, void 0, void 0, void 0, void 0, arity); result.placeholder = curry.placeholder; return result; } curry.placeholder = {}; const encryNo = curry((reg, symbol, str) => { return str.replace(reg, symbol); }); encryNo(/(\d{3})(\d{4})(\d{4})/); const isFullUrl = (url) => { return /^http(s)?/.test(url) || /^\/\//.test(url); }; const on = function(element, event, handler, useCapture = false) { if (element && event && handler) { element.addEventListener(event, handler, useCapture); } }; var MapShim = function() { if (typeof Map !== "undefined") { return Map; } function getIndex(arr, key) { var result = -1; arr.some(function(entry, index2) { if (entry[0] === key) { result = index2; return true; } return false; }); return result; } return function() { function class_1() { this.__entries__ = []; } Object.defineProperty(class_1.prototype, "size", { get: function() { return this.__entries__.length; }, enumerable: true, configurable: true }); class_1.prototype.get = function(key) { var index2 = getIndex(this.__entries__, key); var entry = this.__entries__[index2]; return entry && entry[1]; }; class_1.prototype.set = function(key, value) { var index2 = getIndex(this.__entries__, key); if (~index2) { this.__entries__[index2][1] = value; } else { this.__entries__.push([key, value]); } }; class_1.prototype.delete = function(key) { var entries = this.__entries__; var index2 = getIndex(entries, key); if (~index2) { entries.splice(index2, 1); } }; class_1.prototype.has = function(key) { return !!~getIndex(this.__entries__, key); }; class_1.prototype.clear = function() { this.__entries__.splice(0); }; class_1.prototype.forEach = function(callback, ctx) { if (ctx === void 0) { ctx = null; } for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { var entry = _a[_i]; callback.call(ctx, entry[1], entry[0]); } }; return class_1; }(); }(); var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document; var global$1 = function() { if (typeof global !== "undefined" && global.Math === Math) { return global; } if (typeof self !== "undefined" && self.Math === Math) { return self; } if (typeof window !== "undefined" && window.Math === Math) { return window; } return Function("return this")(); }(); var requestAnimationFrame$1 = function() { if (typeof requestAnimationFrame === "function") { return requestAnimationFrame.bind(global$1); } return function(callback) { return setTimeout(function() { return callback(Date.now()); }, 1e3 / 60); }; }(); var trailingTimeout = 2; function throttle(callback, delay) { var leadingCall = false, trailingCall = false, lastCallTime = 0; function resolvePending() { if (leadingCall) { leadingCall = false; callback(); } if (trailingCall) { proxy(); } } function timeoutCallback() { requestAnimationFrame$1(resolvePending); } function proxy() { var timeStamp = Date.now(); if (leadingCall) { if (timeStamp - lastCallTime < trailingTimeout) { return; } trailingCall = true; } else { leadingCall = true; trailingCall = false; setTimeout(timeoutCallback, delay); } lastCallTime = timeStamp; } return proxy; } var REFRESH_DELAY = 20; var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"]; var mutationObserverSupported = typeof MutationObserver !== "undefined"; var ResizeObserverController = function() { function ResizeObserverController2() { this.connected_ = false; this.mutationEventsAdded_ = false; this.mutationsObserver_ = null; this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); } ResizeObserverController2.prototype.addObserver = function(observer) { if (!~this.observers_.indexOf(observer)) { this.observers_.push(observer); } if (!this.connected_) { this.connect_(); } }; ResizeObserverController2.prototype.removeObserver = function(observer) { var observers2 = this.observers_; var index2 = observers2.indexOf(observer); if (~index2) { observers2.splice(index2, 1); } if (!observers2.length && this.connected_) { this.disconnect_(); } }; ResizeObserverController2.prototype.refresh = function() { var changesDetected = this.updateObservers_(); if (changesDetected) { this.refresh(); } }; ResizeObserverController2.prototype.updateObservers_ = function() { var activeObservers = this.observers_.filter(function(observer) { return observer.gatherActive(), observer.hasActive(); }); activeObservers.forEach(function(observer) { return observer.broadcastActive(); }); return activeObservers.length > 0; }; ResizeObserverController2.prototype.connect_ = function() { if (!isBrowser || this.connected_) { return; } document.addEventListener("transitionend", this.onTransitionEnd_); window.addEventListener("resize", this.refresh); if (mutationObserverSupported) { this.mutationsObserver_ = new MutationObserver(this.refresh); this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true }); } else { document.addEventListener("DOMSubtreeModified", this.refresh); this.mutationEventsAdded_ = true; } this.connected_ = true; }; ResizeObserverController2.prototype.disconnect_ = function() { if (!isBrowser || !this.connected_) { return; } document.removeEventListener("transitionend", this.onTransitionEnd_); window.removeEventListener("resize", this.refresh); if (this.mutationsObserver_) { this.mutationsObserver_.disconnect(); } if (this.mutationEventsAdded_) { document.removeEventListener("DOMSubtreeModified", this.refresh); } this.mutationsObserver_ = null; this.mutationEventsAdded_ = false; this.connected_ = false; }; ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) { var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b; var isReflowProperty = transitionKeys.some(function(key) { return !!~propertyName.indexOf(key); }); if (isReflowProperty) { this.refresh(); } }; ResizeObserverController2.getInstance = function() { if (!this.instance_) { this.instance_ = new ResizeObserverController2(); } return this.instance_; }; ResizeObserverController2.instance_ = null; return ResizeObserverController2; }(); var defineConfigurable = function(target, props) { for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { var key = _a[_i]; Object.defineProperty(target, key, { value: props[key], enumerable: false, writable: false, configurable: true }); } return target; }; var getWindowOf = function(target) { var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; return ownerGlobal || global$1; }; var emptyRect = createRectInit(0, 0, 0, 0); function toFloat(value) { return parseFloat(value) || 0; } function getBordersSize(styles) { var positions = []; for (var _i = 1; _i < arguments.length; _i++) { positions[_i - 1] = arguments[_i]; } return positions.reduce(function(size, position) { var value = styles["border-" + position + "-width"]; return size + toFloat(value); }, 0); } function getPaddings(styles) { var positions = ["top", "right", "bottom", "left"]; var paddings = {}; for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { var position = positions_1[_i]; var value = styles["padding-" + position]; paddings[position] = toFloat(value); } return paddings; } function getSVGContentRect(target) { var bbox = target.getBBox(); return createRectInit(0, 0, bbox.width, bbox.height); } function getHTMLElementContentRect(target) { var clientWidth = target.clientWidth, clientHeight = target.clientHeight; if (!clientWidth && !clientHeight) { return emptyRect; } var styles = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; var width = toFloat(styles.width), height = toFloat(styles.height); if (styles.boxSizing === "border-box") { if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles, "left", "right") + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles, "top", "bottom") + vertPad; } } if (!isDocumentElement(target)) { var vertScrollbar = Math.round(width + horizPad) - clientWidth; var horizScrollbar = Math.round(height + vertPad) - clientHeight; if (Math.abs(vertScrollbar) !== 1) { width -= vertScrollbar; } if (Math.abs(horizScrollbar) !== 1) { height -= horizScrollbar; } } return createRectInit(paddings.left, paddings.top, width, height); } var isSVGGraphicsElement = function() { if (typeof SVGGraphicsElement !== "undefined") { return function(target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; } return function(target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function"; }; }(); function isDocumentElement(target) { return target === getWindowOf(target).document.documentElement; } function getContentRect(target) { if (!isBrowser) { return emptyRect; } if (isSVGGraphicsElement(target)) { return getSVGContentRect(target); } return getHTMLElementContentRect(target); } function createReadOnlyRect(_a) { var x = _a.x, y = _a.y, width = _a.width, height = _a.height; var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object; var rect = Object.create(Constr.prototype); defineConfigurable(rect, { x, y, width, height, top: y, right: x + width, bottom: height + y, left: x }); return rect; } function createRectInit(x, y, width, height) { return { x, y, width, height }; } var ResizeObservation = function() { function ResizeObservation2(target) { this.broadcastWidth = 0; this.broadcastHeight = 0; this.contentRect_ = createRectInit(0, 0, 0, 0); this.target = target; } ResizeObservation2.prototype.isActive = function() { var rect = getContentRect(this.target); this.contentRect_ = rect; return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight; }; ResizeObservation2.prototype.broadcastRect = function() { var rect = this.contentRect_; this.broadcastWidth = rect.width; this.broadcastHeight = rect.height; return rect; }; return ResizeObservation2; }(); var ResizeObserverEntry = function() { function ResizeObserverEntry2(target, rectInit) { var contentRect = createReadOnlyRect(rectInit); defineConfigurable(this, { target, contentRect }); } return ResizeObserverEntry2; }(); var ResizeObserverSPI = function() { function ResizeObserverSPI2(callback, controller, callbackCtx) { this.activeObservations_ = []; this.observations_ = new MapShim(); if (typeof callback !== "function") { throw new TypeError("The callback provided as parameter 1 is not a function."); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; } ResizeObserverSPI2.prototype.observe = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); this.controller_.refresh(); }; ResizeObserverSPI2.prototype.unobserve = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; ResizeObserverSPI2.prototype.disconnect = function() { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; ResizeObserverSPI2.prototype.gatherActive = function() { var _this = this; this.clearActive(); this.observations_.forEach(function(observation) { if (observation.isActive()) { _this.activeObservations_.push(observation); } }); }; ResizeObserverSPI2.prototype.broadcastActive = function() { if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; var entries = this.activeObservations_.map(function(observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; ResizeObserverSPI2.prototype.clearActive = function() { this.activeObservations_.splice(0); }; ResizeObserverSPI2.prototype.hasActive = function() { return this.activeObservations_.length > 0; }; return ResizeObserverSPI2; }(); var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim(); var ResizeObserver = function() { function ResizeObserver2(callback) { if (!(this instanceof ResizeObserver2)) { throw new TypeError("Cannot call a class as a function."); } if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); } return ResizeObserver2; }(); [ "observe", "unobserve", "disconnect" ].forEach(function(method) { ResizeObserver.prototype[method] = function() { var _a; return (_a = observers.get(this))[method].apply(_a, arguments); }; }); var index$1 = function() { if (typeof global$1.ResizeObserver !== "undefined") { return global$1.ResizeObserver; } return ResizeObserver; }(); const resizeHandler = function(entries) { for (const entry of entries) { const listeners = entry.target.__resizeListeners__ || []; if (listeners.length) { listeners.forEach((fn) => { fn(entries); }); } } }; const addResizeListener = function(element, fn) { if (!inBrowser || !element) return; if (!element.__resizeListeners__) { element.__resizeListeners__ = []; element.__ro__ = new index$1(resizeHandler); element.__ro__.observe(element); } element.__resizeListeners__.push(fn); }; const removeResizeListener = function(element, fn) { var _a; if (!element || !element.__resizeListeners__) return; element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { (_a = element.__ro__) == null ? void 0 : _a.disconnect(); } }; function withInstall(options) { options.install = (app) => { const { name } = options; app.component(name, options); app.component(camelize(`-${name}`), options); }; return options; } function directiveWithInstall(name, options) { options.install = (app) => { app.directive(name, options); }; return options; } function genBem(name, mods) { if (!mods) { return ""; } if (typeof mods === "string") { return ` ${name}--${mods}`; } if (Array.isArray(mods)) { return mods.reduce((ret, item) => ret + genBem(name, item), ""); } return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name, key) : ""), ""); } function createBEM(name) { return (el, mods) => { if (el && typeof el !== "string") { mods = el; el = ""; } el = el ? `${name}__${el}` : name; return `${el}${genBem(el, mods)}`; }; } function createNamespace(name) { const prefixedName = `ly-${name}`; return [ prefixedName, createBEM(prefixedName) ]; } const [name$2, bem$1] = createNamespace("fixed-container"); const fixedWrapProps = { zIndex: { type: Number, default: 998 }, wrapClass: { type: String }, top: [Number, String], right: [Number, String], bottom: [Number, String], left: [Number, String], width: [Number, String], height: [Number, String], position: { type: String, default: "fixed" }, offset: { type: Number, default: 0 }, direction: { type: String, default: "bottom" }, placeholder: { type: Boolean, default: true }, appendToBody: Boolean }; const __default__ = { name: name$2, inheritAttrs: false }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: fixedWrapProps, setup(__props) { const props = __props; const wrapRef = vue.ref(null); const { height: placeholderHeight, width: placeholderWidth } = core.useElementSize(wrapRef); const wrapStyle = vue.computed(() => { const { direction, top, right, bottom, left } = props; let offset = props.offset; if (offset > 0) { offset = `${offset}px`; } let o = { position: props.position, zIndex: props.zIndex }; switch (direction) { case "top": o.top = offset; if (isDef(left)) { o.left = addUnit(left); } if (isDef(right)) { o.right = addUnit(right); } break; case "right": o.right = offset; if (isDef(top)) { o.top = addUnit(top); } if (isDef(bottom)) { o.bottom = addUnit(bottom); } break; case "bottom": o.bottom = offset; if (isDef(left)) { o.left = addUnit(left); } if (isDef(right)) { o.right = addUnit(right); } break; case "left": o.left = offset; if (isDef(top)) { o.top = addUnit(top); } if (isDef(bottom)) { o.bottom = addUnit(bottom); } break; } if (props.width) { o.width = addUnit(props.width); } if (props.height) { o.height = addUnit(props.height); } return o; }); const safeAreaInsetCss = vue.computed(() => { return `safe-area-inset-${props.direction}`; }); const placeholderStyle = vue.computed(() => { const direction = props.direction; if (direction === "left" || direction === "right") { return { width: placeholderWidth.value + "px" }; } return { height: placeholderHeight.value + "px" }; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass([vue.unref(bem$1)()]) }, [ _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: vue.normalizeClass([[vue.unref(bem$1)("placeholder"), vue.unref(safeAreaInsetCss)], "safe-area-inset-bottom"]), style: vue.normalizeStyle(vue.unref(placeholderStyle)) }, null, 6)) : vue.createCommentVNode("v-if", true), (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body", disabled: !_ctx.appendToBody }, [ vue.createElementVNode("div", { ref_key: "wrapRef", ref: wrapRef, class: vue.normalizeClass([vue.unref(bem$1)("wrap"), _ctx.wrapClass]), style: vue.normalizeStyle(vue.unref(wrapStyle)) }, [ vue.renderSlot(_ctx.$slots, "default") ], 6) ], 8, ["disabled"])) ], 2); }; } }); var _FixedContainer = _sfc_