@sincerecloud/sc-ui
Version:
vue3 ui ant-design-vue sincerecloud sc-ui typescript
1,517 lines • 1.84 MB
JavaScript
var __defProp2 = Object.defineProperty;
var __defNormalProp2 = (obj, key2, value7) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value: value7 }) : obj[key2] = value7;
var __publicField = (obj, key2, value7) => {
__defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value7);
return value7;
};
import { Tooltip, Tabs, RadioGroup, RadioButton, Radio, Alert, Button as Button$1, Spin, Modal, Select as Select$5, SelectOption, Checkbox, CheckboxGroup, InputSearch, InputGroup, Dropdown, Menu, SubMenu, MenuItem, Input as Input$3, Popover, Popconfirm, Form, FormItem, message, Tag, Table, ConfigProvider as ConfigProvider$1, InputNumber, Switch, Divider, Cascader as Cascader$2, Breadcrumb, BreadcrumbItem, Badge, Skeleton, Descriptions, Tree as Tree$3, TreeSelect as TreeSelect$1, AutoComplete, Rate, Col as Col$1, Row, Drawer, SelectOptGroup, notification } from "ant-design-vue";
import { message as message2 } from "ant-design-vue";
import * as vue from "vue";
import { Fragment, isVNode, unref, defineComponent, computed, createVNode, getCurrentScope, onScopeDispose, ref, isRef, toRefs as toRefs$1, customRef, getCurrentInstance, onMounted, nextTick, onUnmounted, watch, provide, openBlock, createElementBlock, normalizeClass, renderSlot, inject, onBeforeUnmount, reactive, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createTextVNode, useSlots, createBlock, mergeProps, createSlots, renderList, withCtx, normalizeProps, guardReactiveProps, camelize as camelize$2, resolveComponent, watchEffect, shallowRef, toRef, Transition as Transition$1, withDirectives, vShow, onUpdated, resolveDynamicComponent, h as h$2, render, resolveDirective, readonly, toRaw, onActivated, toHandlers, withModifiers, onBeforeUpdate, withKeys, vModelText, useAttrs as useAttrs$1, Comment as Comment$1, Text as Text$1, cloneVNode, onBeforeMount, Teleport, isReactive, isReadonly, vModelDynamic, createApp } from "vue";
import lodash from "lodash";
import dayjs from "dayjs";
import { ExclamationCircleFilled, QuestionCircleOutlined, InfoCircleFilled, CheckCircleFilled, CloseCircleFilled, CheckOutlined, PlusOutlined, EllipsisOutlined, CopyOutlined, DoubleRightOutlined, FilterFilled, createFromIconfontCN, ClockCircleOutlined, CalendarOutlined, LoadingOutlined, SearchOutlined as SearchOutlined$1 } from "@ant-design/icons-vue";
import weekday from "dayjs/plugin/weekday";
import localeData from "dayjs/plugin/localeData";
import weekOfYear from "dayjs/plugin/weekOfYear";
import weekYear from "dayjs/plugin/weekYear";
import advancedFormat from "dayjs/plugin/advancedFormat";
import customParseFormat from "dayjs/plugin/customParseFormat";
import * as isPlainObject$2 from "lodash/isPlainObject";
import * as moment from "moment";
import moment__default from "moment";
import LoadingOutlined$1 from "@ant-design/icons-vue/LoadingOutlined";
import FileOutlined from "@ant-design/icons-vue/FileOutlined";
import CaretDownFilled from "@ant-design/icons-vue/CaretDownFilled";
import MinusSquareOutlined from "@ant-design/icons-vue/MinusSquareOutlined";
import PlusSquareOutlined from "@ant-design/icons-vue/PlusSquareOutlined";
import FolderOpenOutlined from "@ant-design/icons-vue/FolderOpenOutlined";
import FolderOutlined from "@ant-design/icons-vue/FolderOutlined";
import DownOutlined from "@ant-design/icons-vue/DownOutlined";
import CheckOutlined$1 from "@ant-design/icons-vue/CheckOutlined";
import CloseOutlined from "@ant-design/icons-vue/CloseOutlined";
import CloseCircleFilled$1 from "@ant-design/icons-vue/CloseCircleFilled";
import SearchOutlined from "@ant-design/icons-vue/SearchOutlined";
import CaretDownOutlined from "@ant-design/icons-vue/CaretDownOutlined";
import EyeOutlined from "@ant-design/icons-vue/EyeOutlined";
import EyeInvisibleOutlined from "@ant-design/icons-vue/EyeInvisibleOutlined";
import RightOutlined from "@ant-design/icons-vue/RightOutlined";
import RedoOutlined from "@ant-design/icons-vue/RedoOutlined";
function findParentDom(currentDom, level, fn) {
let count = 0;
function recursion(dom, countLevel) {
if (!dom) {
return null;
}
if (countLevel >= level) {
return null;
}
if (isFunction$6(fn)) {
if (fn(dom)) {
return fn(dom);
} else {
return recursion(dom.parentNode, ++count);
}
} else {
return dom;
}
}
if (currentDom.parentNode) {
return recursion(currentDom, ++count);
} else {
return currentDom;
}
}
const pxToRem = (px) => {
if (isNaN(parseFloat(px))) {
return px;
}
return String(px).includes("%") || String(px).includes("rem") || String(px).includes("vh") || String(px).includes("vw") || String(px).includes("vw") ? px : px + "px";
};
const toString$2 = Object.prototype.toString;
function is(val, type2) {
return toString$2.call(val) === `[object ${type2}]`;
}
function isEmptyText(text) {
if (text === null || text === void 0 || text === "") {
return false;
}
return true;
}
function isDef(val) {
return typeof val !== "undefined";
}
function isUnDef(val) {
return !isDef(val);
}
function isObject$4(val) {
return val !== null && is(val, "Object");
}
function transformPxtoRem(val) {
const newVal = String(val).includes("%") || String(val).includes("rem") || String(val).includes("vh") || String(val).includes("vw") || String(val).includes("px") ? val : pxToRem(val);
return newVal;
}
function isNull(val) {
return val === null;
}
function isNullOrUnDef(val) {
return isUnDef(val) || isNull(val);
}
function isNumber$1(val) {
return is(val, "Number");
}
function isString$2(val) {
return is(val, "String");
}
function isFunction$6(val) {
return typeof val === "function";
}
function isBoolean$1(val) {
return is(val, "Boolean");
}
function isArray$4(val) {
return val && Array.isArray(val);
}
const isServer = typeof window === "undefined";
const isClient$2 = !isServer;
const isStringNumber = (val) => {
if (!isString$2(val)) {
return false;
}
return !Number.isNaN(Number(val));
};
class ElementPlusError extends Error {
constructor(m2) {
super(m2);
this.name = "ElementPlusError";
}
}
function throwError(scope, m2) {
throw new ElementPlusError(`[${scope}] ${m2}`);
}
function debugWarn(scope, message3) {
if (process.env.NODE_ENV !== "production") {
const error2 = isString$2(scope) ? new ElementPlusError(`[${scope}] ${message3}`) : scope;
console.warn(error2);
}
}
const projectName = { "BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true }.VITE_GLOB_APP_TITLE;
function error$1(message3) {
throw new Error(`[${projectName} error]:${message3}`);
}
const isElement = (e2) => {
if (typeof Element === "undefined")
return false;
return e2 instanceof Element;
};
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function isObject$3(o2) {
return Object.prototype.toString.call(o2) === "[object Object]";
}
function isPlainObject$1(o2) {
var ctor, prot;
if (isObject$3(o2) === false)
return false;
ctor = o2.constructor;
if (ctor === void 0)
return true;
prot = ctor.prototype;
if (isObject$3(prot) === false)
return false;
if (prot.hasOwnProperty("isPrototypeOf") === false) {
return false;
}
return true;
}
function t$1() {
return t$1 = Object.assign ? Object.assign.bind() : function(e2) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var r2 = arguments[t2];
for (var n2 in r2)
Object.prototype.hasOwnProperty.call(r2, n2) && (e2[n2] = r2[n2]);
}
return e2;
}, t$1.apply(this, arguments);
}
function r$1(e2, t2) {
if (null == e2)
return {};
var r2, n2, i2 = {}, o2 = Object.keys(e2);
for (n2 = 0; n2 < o2.length; n2++)
t2.indexOf(r2 = o2[n2]) >= 0 || (i2[r2] = e2[r2]);
return i2;
}
const n$1 = { silent: false, logLevel: "warn" }, i$1 = ["validator"], o$1 = Object.prototype, a$1 = o$1.toString, s$1 = o$1.hasOwnProperty, u$1 = /^\s*function (\w+)/;
function l$1(e2) {
var t2;
const r2 = null !== (t2 = null == e2 ? void 0 : e2.type) && void 0 !== t2 ? t2 : e2;
if (r2) {
const e3 = r2.toString().match(u$1);
return e3 ? e3[1] : "";
}
return "";
}
const c$1 = isPlainObject$1, f$1 = (e2) => e2;
let d$1 = f$1;
if ("production" !== process.env.NODE_ENV) {
const e2 = "undefined" != typeof console;
d$1 = e2 ? function(e3, t2 = n$1.logLevel) {
false === n$1.silent && console[t2](`[VueTypes warn]: ${e3}`);
} : f$1;
}
const p$1 = (e2, t2) => s$1.call(e2, t2), y$1 = Number.isInteger || function(e2) {
return "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2;
}, v$1 = Array.isArray || function(e2) {
return "[object Array]" === a$1.call(e2);
}, h$1 = (e2) => "[object Function]" === a$1.call(e2), b$1 = (e2) => c$1(e2) && p$1(e2, "_vueTypes_name"), g$1 = (e2) => c$1(e2) && (p$1(e2, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t2) => p$1(e2, t2)));
function O$1(e2, t2) {
return Object.defineProperty(e2.bind(t2), "__original", { value: e2 });
}
function m$1(e2, t2, r2 = false) {
let n2, i2 = true, o2 = "";
n2 = c$1(e2) ? e2 : { type: e2 };
const a2 = b$1(n2) ? n2._vueTypes_name + " - " : "";
if (g$1(n2) && null !== n2.type) {
if (void 0 === n2.type || true === n2.type)
return i2;
if (!n2.required && void 0 === t2)
return i2;
v$1(n2.type) ? (i2 = n2.type.some((e3) => true === m$1(e3, t2, true)), o2 = n2.type.map((e3) => l$1(e3)).join(" or ")) : (o2 = l$1(n2), i2 = "Array" === o2 ? v$1(t2) : "Object" === o2 ? c$1(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e3) {
if (null == e3)
return "";
const t3 = e3.constructor.toString().match(u$1);
return t3 ? t3[1] : "";
}(t2) === o2 : t2 instanceof n2.type);
}
if (!i2) {
const e3 = `${a2}value "${t2}" should be of type "${o2}"`;
return false === r2 ? (d$1(e3), false) : e3;
}
if (p$1(n2, "validator") && h$1(n2.validator)) {
const e3 = d$1, o3 = [];
if (d$1 = (e4) => {
o3.push(e4);
}, i2 = n2.validator(t2), d$1 = e3, !i2) {
const e4 = (o3.length > 1 ? "* " : "") + o3.join("\n* ");
return o3.length = 0, false === r2 ? (d$1(e4), i2) : e4;
}
}
return i2;
}
function j$1(e2, t2) {
const r2 = Object.defineProperties(t2, { _vueTypes_name: { value: e2, writable: true }, isRequired: { get() {
return this.required = true, this;
} }, def: { value(e3) {
return void 0 === e3 ? (p$1(this, "default") && delete this.default, this) : h$1(e3) || true === m$1(this, e3, true) ? (this.default = v$1(e3) ? () => [...e3] : c$1(e3) ? () => Object.assign({}, e3) : e3, this) : (d$1(`${this._vueTypes_name} - invalid default value: "${e3}"`), this);
} } }), { validator: n2 } = r2;
return h$1(n2) && (r2.validator = O$1(n2, r2)), r2;
}
function _$1(e2, t2) {
const r2 = j$1(e2, t2);
return Object.defineProperty(r2, "validate", { value(e3) {
return h$1(this.validator) && d$1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = O$1(e3, this), this;
} });
}
function T$1(e2, t2, n2) {
const o2 = function(e3) {
const t3 = {};
return Object.getOwnPropertyNames(e3).forEach((r2) => {
t3[r2] = Object.getOwnPropertyDescriptor(e3, r2);
}), Object.defineProperties({}, t3);
}(t2);
if (o2._vueTypes_name = e2, !c$1(n2))
return o2;
const { validator: a2 } = n2, s2 = r$1(n2, i$1);
if (h$1(a2)) {
let { validator: e3 } = o2;
e3 && (e3 = null !== (l2 = (u2 = e3).__original) && void 0 !== l2 ? l2 : u2), o2.validator = O$1(e3 ? function(t3) {
return e3.call(this, t3) && a2.call(this, t3);
} : a2, o2);
}
var u2, l2;
return Object.assign(o2, s2);
}
function $$1(e2) {
return e2.replace(/^(?!\s*$)/gm, " ");
}
const w$1 = () => _$1("any", {}), P$1 = () => _$1("function", { type: Function }), x$1 = () => _$1("boolean", { type: Boolean }), E$1 = () => _$1("string", { type: String }), N$1 = () => _$1("number", { type: Number }), q$1 = () => _$1("array", { type: Array }), A$1 = () => _$1("object", { type: Object }), V$1 = () => j$1("integer", { type: Number, validator: (e2) => y$1(e2) }), S$1 = () => j$1("symbol", { validator: (e2) => "symbol" == typeof e2 });
function D$1(e2, t2 = "custom validation failed") {
if ("function" != typeof e2)
throw new TypeError("[VueTypes error]: You must provide a function as argument");
return j$1(e2.name || "<<anonymous function>>", { type: null, validator(r2) {
const n2 = e2(r2);
return n2 || d$1(`${this._vueTypes_name} - ${t2}`), n2;
} });
}
function L$1(e2) {
if (!v$1(e2))
throw new TypeError("[VueTypes error]: You must provide an array as argument.");
const t2 = `oneOf - value should be one of "${e2.join('", "')}".`, r2 = e2.reduce((e3, t3) => {
if (null != t3) {
const r3 = t3.constructor;
-1 === e3.indexOf(r3) && e3.push(r3);
}
return e3;
}, []);
return j$1("oneOf", { type: r2.length > 0 ? r2 : void 0, validator(r3) {
const n2 = -1 !== e2.indexOf(r3);
return n2 || d$1(t2), n2;
} });
}
function F$1(e2) {
if (!v$1(e2))
throw new TypeError("[VueTypes error]: You must provide an array as argument");
let t2 = false, r2 = [];
for (let n3 = 0; n3 < e2.length; n3 += 1) {
const i2 = e2[n3];
if (g$1(i2)) {
if (b$1(i2) && "oneOf" === i2._vueTypes_name && i2.type) {
r2 = r2.concat(i2.type);
continue;
}
if (h$1(i2.validator) && (t2 = true), true === i2.type || !i2.type) {
d$1('oneOfType - invalid usage of "true" or "null" as types.');
continue;
}
r2 = r2.concat(i2.type);
} else
r2.push(i2);
}
r2 = r2.filter((e3, t3) => r2.indexOf(e3) === t3);
const n2 = r2.length > 0 ? r2 : null;
return j$1("oneOfType", t2 ? { type: n2, validator(t3) {
const r3 = [], n3 = e2.some((e3) => {
const n4 = m$1(b$1(e3) && "oneOf" === e3._vueTypes_name ? e3.type || null : e3, t3, true);
return "string" == typeof n4 && r3.push(n4), true === n4;
});
return n3 || d$1(`oneOfType - provided value does not match any of the ${r3.length} passed-in validators:
${$$1(r3.join("\n"))}`), n3;
} } : { type: n2 });
}
function Y$1(e2) {
return j$1("arrayOf", { type: Array, validator(t2) {
let r2 = "";
const n2 = t2.every((t3) => (r2 = m$1(e2, t3, true), true === r2));
return n2 || d$1(`arrayOf - value validation error:
${$$1(r2)}`), n2;
} });
}
function B$1(e2) {
return j$1("instanceOf", { type: e2 });
}
function I$1(e2) {
return j$1("objectOf", { type: Object, validator(t2) {
let r2 = "";
const n2 = Object.keys(t2).every((n3) => (r2 = m$1(e2, t2[n3], true), true === r2));
return n2 || d$1(`objectOf - value validation error:
${$$1(r2)}`), n2;
} });
}
function J$1(e2) {
const t2 = Object.keys(e2), r2 = t2.filter((t3) => {
var r3;
return !(null === (r3 = e2[t3]) || void 0 === r3 || !r3.required);
}), n2 = j$1("shape", { type: Object, validator(n3) {
if (!c$1(n3))
return false;
const i2 = Object.keys(n3);
if (r2.length > 0 && r2.some((e3) => -1 === i2.indexOf(e3))) {
const e3 = r2.filter((e4) => -1 === i2.indexOf(e4));
return d$1(1 === e3.length ? `shape - required property "${e3[0]}" is not defined.` : `shape - required properties "${e3.join('", "')}" are not defined.`), false;
}
return i2.every((r3) => {
if (-1 === t2.indexOf(r3))
return true === this._vueTypes_isLoose || (d$1(`shape - shape definition does not include a "${r3}" property. Allowed keys: "${t2.join('", "')}".`), false);
const i3 = m$1(e2[r3], n3[r3], true);
return "string" == typeof i3 && d$1(`shape - "${r3}" property validation error:
${$$1(i3)}`), true === i3;
});
} });
return Object.defineProperty(n2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(n2, "loose", { get() {
return this._vueTypes_isLoose = true, this;
} }), n2;
}
const M$1 = ["name", "validate", "getter"], R$1 = /* @__PURE__ */ (() => {
var e2;
return (e2 = class {
static get any() {
return w$1();
}
static get func() {
return P$1().def(this.defaults.func);
}
static get bool() {
return x$1().def(this.defaults.bool);
}
static get string() {
return E$1().def(this.defaults.string);
}
static get number() {
return N$1().def(this.defaults.number);
}
static get array() {
return q$1().def(this.defaults.array);
}
static get object() {
return A$1().def(this.defaults.object);
}
static get integer() {
return V$1().def(this.defaults.integer);
}
static get symbol() {
return S$1();
}
static get nullable() {
return { type: null };
}
static extend(e3) {
if (v$1(e3))
return e3.forEach((e4) => this.extend(e4)), this;
const { name: t2, validate: n2 = false, getter: i2 = false } = e3, o2 = r$1(e3, M$1);
if (p$1(this, t2))
throw new TypeError(`[VueTypes error]: Type "${t2}" already defined`);
const { type: a2 } = o2;
if (b$1(a2))
return delete o2.type, Object.defineProperty(this, t2, i2 ? { get: () => T$1(t2, a2, o2) } : { value(...e4) {
const r2 = T$1(t2, a2, o2);
return r2.validator && (r2.validator = r2.validator.bind(r2, ...e4)), r2;
} });
let s2;
return s2 = i2 ? { get() {
const e4 = Object.assign({}, o2);
return n2 ? _$1(t2, e4) : j$1(t2, e4);
}, enumerable: true } : { value(...e4) {
const r2 = Object.assign({}, o2);
let i3;
return i3 = n2 ? _$1(t2, r2) : j$1(t2, r2), r2.validator && (i3.validator = r2.validator.bind(i3, ...e4)), i3;
}, enumerable: true }, Object.defineProperty(this, t2, s2);
}
}).defaults = {}, e2.sensibleDefaults = void 0, e2.config = n$1, e2.custom = D$1, e2.oneOf = L$1, e2.instanceOf = B$1, e2.oneOfType = F$1, e2.arrayOf = Y$1, e2.objectOf = I$1, e2.shape = J$1, e2.utils = { validate: (e3, t2) => true === m$1(t2, e3, true), toType: (e3, t2, r2 = false) => r2 ? _$1(e3, t2) : j$1(e3, t2) }, e2;
})();
function z$1(e2 = { func: () => {
}, bool: true, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
var r2;
return (r2 = class extends R$1 {
static get sensibleDefaults() {
return t$1({}, this.defaults);
}
static set sensibleDefaults(r3) {
this.defaults = false !== r3 ? t$1({}, true !== r3 ? r3 : e2) : {};
}
}).defaults = t$1({}, e2), r2;
}
class C$1 extends z$1() {
}
const PropTypes$1 = z$1({
func: void 0,
bool: void 0,
string: void 0,
number: void 0,
object: void 0,
integer: void 0
});
PropTypes$1.extend([
{
name: "looseBool",
getter: true,
type: Boolean,
default: void 0
},
{
name: "style",
getter: true,
type: [String, Object],
default: void 0
},
{
name: "VNodeChild",
getter: true,
type: void 0
}
]);
const definePropType$1 = (val) => val;
const SCOPE = "utils/style";
function addUnit(value7, defaultUnit = "px") {
if (!value7)
return "";
if (isNumber$1(value7) || isStringNumber(value7)) {
return `${value7}${defaultUnit}`;
} else if (isString$2(value7)) {
return value7;
}
debugWarn(SCOPE, "binding value must be a string or number");
}
const DEFAULT_CONFIG = {
id: "id",
children: "children",
pid: "pid"
};
const getConfig = (config) => Object.assign({}, DEFAULT_CONFIG, config);
function treeToList(tree, config = {}) {
config = getConfig(config);
const { children } = config;
const result = [...tree];
for (let i2 = 0; i2 < result.length; i2++) {
if (!result[i2][children])
continue;
result.splice(i2 + 1, 0, ...result[i2][children]);
}
return result;
}
function findNode(tree, func, config = {}) {
config = getConfig(config);
const { children } = config;
const list2 = [...tree];
for (const node of list2) {
if (func(node))
return node;
node[children] && list2.push(...node[children]);
}
return null;
}
function findNodeAll(tree, func, config = {}) {
config = getConfig(config);
const { children } = config;
const list2 = [...tree];
const result = [];
for (const node of list2) {
func(node) && result.push(node);
node[children] && list2.push(...node[children]);
}
return result;
}
function filter(tree, func, config = {}) {
config = getConfig(config);
const children = config.children;
function listFilter(list2) {
return list2.map((node) => ({ ...node })).filter((node) => {
node[children] = node[children] && listFilter(node[children]);
return func(node) || node[children] && node[children].length;
});
}
return listFilter(tree);
}
function treeMap(treeData, opt) {
return treeData.map((item) => treeMapEach(item, opt));
}
function treeMapEach(data17, { children = "children", conversion }) {
const haveChildren = Array.isArray(data17[children]) && data17[children].length > 0;
const conversionData = conversion(data17) || {};
if (haveChildren) {
return {
...conversionData,
[children]: data17[children].map(
(i2) => treeMapEach(i2, {
children,
conversion
})
)
};
} else {
return {
...conversionData
};
}
}
const hexList = [];
for (let i2 = 0; i2 <= 15; i2++) {
hexList[i2] = i2.toString(16);
}
function buildUUID() {
let uuid2 = "";
for (let i2 = 1; i2 <= 36; i2++) {
if (i2 === 9 || i2 === 14 || i2 === 19 || i2 === 24) {
uuid2 += "-";
} else if (i2 === 15) {
uuid2 += 4;
} else if (i2 === 20) {
uuid2 += hexList[Math.random() * 4 | 8];
} else {
uuid2 += hexList[Math.random() * 16 | 0];
}
}
return uuid2.replace(/-/g, "");
}
function getSlot$2(slots, slot = "default", data17) {
if (!slots || !Reflect.has(slots, slot)) {
return null;
}
if (!isFunction$6(slots[slot])) {
console.error(`${slot} is not a function!`);
return null;
}
const slotFn = slots[slot];
if (!slotFn)
return null;
return slotFn(data17);
}
function isEmptyElement$2(c2) {
return c2 && (c2.type === Comment || c2.type === Fragment && c2.children.length === 0 || c2.type === Text && c2.children.trim() === "");
}
const isValid$4 = (value7) => {
return value7 !== void 0 && value7 !== null && value7 !== "";
};
function isValidElement$1(element) {
if (Array.isArray(element) && element.length === 1) {
element = element[0];
}
return element && element.__v_isVNode && typeof element.type !== "symbol";
}
const flattenChildren$2 = (children = [], filterEmpty2 = true) => {
const temp = Array.isArray(children) ? children : [children];
const res = [];
temp.forEach((child) => {
if (Array.isArray(child)) {
res.push(...flattenChildren$2(child, filterEmpty2));
} else if (child && child.type === Fragment) {
res.push(...flattenChildren$2(child.children, filterEmpty2));
} else if (child && isVNode(child)) {
if (filterEmpty2 && !isEmptyElement$2(child)) {
res.push(child);
} else if (!filterEmpty2) {
res.push(child);
}
} else if (isValid$4(child)) {
res.push(child);
}
});
return res;
};
function getPopupContainer(node) {
var _a2;
return (_a2 = node == null ? void 0 : node.parentNode) != null ? _a2 : document.body;
}
function getBoundingClientRect(element) {
if (!element || !element.getBoundingClientRect) {
return 0;
}
return element.getBoundingClientRect();
}
function trim(string) {
return (string || "").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
}
function hasClass$1(el, cls) {
if (!el || !cls)
return false;
if (cls.indexOf(" ") !== -1)
throw new Error("className should not contain space.");
if (el.classList) {
return el.classList.contains(cls);
} else {
return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
}
}
function addClass(el, cls) {
if (!el)
return;
let curClass = el.className;
const classes3 = (cls || "").split(" ");
for (let i2 = 0, j2 = classes3.length; i2 < j2; i2++) {
const clsName = classes3[i2];
if (!clsName)
continue;
if (el.classList) {
el.classList.add(clsName);
} else if (!hasClass$1(el, clsName)) {
curClass += " " + clsName;
}
}
if (!el.classList) {
el.className = curClass;
}
}
function removeClass(el, cls) {
if (!el || !cls)
return;
const classes3 = cls.split(" ");
let curClass = " " + el.className + " ";
for (let i2 = 0, j2 = classes3.length; i2 < j2; i2++) {
const clsName = classes3[i2];
if (!clsName)
continue;
if (el.classList) {
el.classList.remove(clsName);
} else if (hasClass$1(el, clsName)) {
curClass = curClass.replace(" " + clsName + " ", " ");
}
}
if (!el.classList) {
el.className = trim(curClass);
}
}
function getViewportOffset(element) {
const doc = document.documentElement;
const docScrollLeft = doc.scrollLeft;
const docScrollTop = doc.scrollTop;
const docClientLeft = doc.clientLeft;
const docClientTop = doc.clientTop;
const pageXOffset = window.pageXOffset;
const pageYOffset = window.pageYOffset;
const box = getBoundingClientRect(element);
const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box;
const scrollLeft2 = (pageXOffset || docScrollLeft) - (docClientLeft || 0);
const scrollTop2 = (pageYOffset || docScrollTop) - (docClientTop || 0);
const offsetLeft = retLeft + pageXOffset;
const offsetTop = rectTop + pageYOffset;
const left = offsetLeft - scrollLeft2;
const top = offsetTop - scrollTop2;
const clientWidth = window.document.documentElement.clientWidth;
const clientHeight = window.document.documentElement.clientHeight;
return {
left,
top,
right: clientWidth - rectWidth - left,
bottom: clientHeight - rectHeight - top,
rightIncludeBody: clientWidth - left,
bottomIncludeBody: clientHeight - top
};
}
var MapShim = function() {
if (typeof Map !== "undefined") {
return Map;
}
function getIndex(arr, key2) {
var result = -1;
arr.some(function(entry, index2) {
if (entry[0] === key2) {
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(key2) {
var index2 = getIndex(this.__entries__, key2);
var entry = this.__entries__[index2];
return entry && entry[1];
};
class_1.prototype.set = function(key2, value7) {
var index2 = getIndex(this.__entries__, key2);
if (~index2) {
this.__entries__[index2][1] = value7;
} else {
this.__entries__.push([key2, value7]);
}
};
class_1.prototype.delete = function(key2) {
var entries2 = this.__entries__;
var index2 = getIndex(entries2, key2);
if (~index2) {
entries2.splice(index2, 1);
}
};
class_1.prototype.has = function(key2) {
return !!~getIndex(this.__entries__, key2);
};
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, _a2 = this.__entries__; _i < _a2.length; _i++) {
var entry = _a2[_i];
callback.call(ctx, entry[1], entry[0]);
}
};
return class_1;
}();
}();
var isBrowser$1 = 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$1 || 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$1 || !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(_a2) {
var _b = _a2.propertyName, propertyName = _b === void 0 ? "" : _b;
var isReflowProperty = transitionKeys.some(function(key2) {
return !!~propertyName.indexOf(key2);
});
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, props2) {
for (var _i = 0, _a2 = Object.keys(props2); _i < _a2.length; _i++) {
var key2 = _a2[_i];
Object.defineProperty(target, key2, {
value: props2[key2],
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(value7) {
return parseFloat(value7) || 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 value7 = styles["border-" + position + "-width"];
return size + toFloat(value7);
}, 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 value7 = styles["padding-" + position];
paddings[position] = toFloat(value7);
}
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$1) {
return emptyRect;
}
if (isSVGGraphicsElement(target)) {
return getSVGContentRect(target);
}
return getHTMLElementContentRect(target);
}
function createReadOnlyRect(_a2) {
var x2 = _a2.x, y2 = _a2.y, width = _a2.width, height = _a2.height;
var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
var rect = Object.create(Constr.prototype);
defineConfigurable(rect, {
x: x2,
y: y2,
width,
height,
top: y2,
right: x2 + width,
bottom: height + y2,
left: x2
});
return rect;
}
function createRectInit(x2, y2, width, height) {
return { x: x2, y: y2, 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 entries2 = this.activeObservations_.map(function(observation) {
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
});
this.callback_.call(ctx, entries2, 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$2 = 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$2.prototype[method] = function() {
var _a2;
return (_a2 = observers.get(this))[method].apply(_a2, arguments);
};
});
var index$a = function() {
if (typeof global$1.ResizeObserver !== "undefined") {
return global$1.ResizeObserver;
}
return ResizeObserver$2;
}();
function triggerWindowResize() {
const event = document.createEvent("HTMLEvents");
event.initEvent("resize", true, true);
event.eventType = "message";
window.dispatchEvent(event);
}
const dateUtil = dayjs;
const cloneDeep$e = lodash;
const withInstall$1 = (component, alias) => {
const comp = component;
comp.install = (app) => {
app.component(comp.name || comp.displayName, component);
if (alias) {
app.config.globalProperties[alias] = component;
}
};
return component;
};
function deepMerge(src = {}, target = {}) {
let key2;
const res = cloneDeep$e(src);
for (key2 in target) {
res[key2] = isObject$4(res[key2]) ? deepMerge(res[key2], target[key2]) : res[key2] = target[key2];
}
return res;
}
const definePropType = (val) => val;
const tuple$2 = (...args) => args;
function getDynamicProps(props2) {
const ret = {};
Object.keys(props2).map((key2) => {
ret[key2] = unref(props2[key2]);
});
return ret;
}
const CHANGE_EVENT$1 = "change";
const basePrefixCls = "sc";
const PAGE_SIZE = 10;
const ROW_KEY$2 = "key";
const SELECTION_ROW_KEY = "selectionRowKey";
const FETCH_SETTING = {
pageField: "current",
sizeField: "size",
listField: "records",
totalField: "total"
};
const props$h = {
maxWidth: {
type: String,
default: "600px"
},
showIndex: {
type: Boolean
},
color: {
type: String
},
fontSize: {
type: String,
default: "14px"
},
placement: {
type: String,
default: "right"
},
text: {
type: [Array, String]
}
};
const _sfc_main$$ = defineComponent({
name: "BzHelp",
components: {
Tooltip
},
props: props$h,
setup(props2, {
slots
}) {
const prefixCls2 = basePrefixCls + "Basic-help";
const getTooltipStyle = computed(() => ({
color: props2.color,
fontSize: props2.fontSize
}));
const getOverlayStyle = computed(() => ({
maxWidth: props2.maxWidth
}));
function renderTitle() {
const textList = props2.text;
if (isString$2(textList)) {
return createVNode("p", null, [textList]);
}
if (isArray$4(textList)) {
return textList.map((text, index2) => {
return createVNode("p", {
"key": text
}, [createVNode(Fragment, null, [props2.showIndex ? `${index2 + 1}. ` : "", text])]);
});
}
return null;
}
return () => {
return createVNode(Tooltip, {
"overlayClassName": `${prefixCls2}__wrap`,
"title": createVNode("div", {
"style": unref(getTooltipStyle)
}, [renderTitle()]),
"autoAdjustOverflow": true,
"overlayStyle": unref(getOverlayStyle),
"destroyTooltipOnHide": true,
"placement": props2.placement,
"getPopupContainer": () => getPopupContainer()
}, {
default: () => [createVNode("span", {
"class": prefixCls2
}, [getSlot$2(slots) || createVNode("i", {
"class": "sc-ui sc-question-circle"
}, null)])]
});
};
}
});
const ScHelp = withInstall$1(_sfc_main$$);
var _a;
const isClient$1 = typeof window !== "undefined";
const isFunction$5 = (val) => typeof val === "function";
const isNumber = (val) => typeof val === "number";
const isString$1 = (val) => typeof val === "string";
const noop$5 = () => {
};
isClient$1 && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function resolveUnref(r2) {
return typeof r2 === "function" ? r2() : unref(r2);
}
function createFilterWrapper(filter2, fn) {
function wrapper(...args) {
filter2(() => fn.apply(this, args), { fn, thisArg: this, args });
}
return wrapper;
}
function debounceFilter(ms, options2 = {}) {
let timer;
let maxTimer;
const filter2 = (invoke) => {
const duration = resolveUnref(ms);
const maxDuration = resolveUnref(options2.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 filter2;
}
function identity$1(arg) {
return arg;
}
function tryOnScopeDispose(fn) {
if (getCurrentScope()) {
onScopeDispose(fn);
return true;
}
return false;
}
function useDebounceFn(fn, ms = 200, options2 = {}) {
return createFilterWrapper(debounceFilter(ms, options2), fn);
}
var __defProp$7 = Object.defineProperty;
var __defProps$5 = Object.defineProperties;
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
var __defNormalProp$7 = (obj, key2, value7) => key2 in obj ? __defProp$7(obj, key2, { enumerable: true, configurable: true, writable: true, value: value7 }) : obj[key2] = value7;
var __spreadValues$7 = (a2, b2) => {
for (var prop in b2 || (b2 = {}))
if (__hasOwnProp$9.call(b2, prop))
__defNormalProp$7(a2, prop, b2[prop]);
if (__getOwnPropSymbols$9)
for (var prop of __getOwnPropSymbols$9(b2)) {
if (__propIsEnum$9.call(b2, prop))
__defNormalProp$7(a2, prop, b2[prop]);
}
return a2;
};
var __spreadProps$5 = (a2, b2) => __defProps$5(a2, __getOwnPropDescs$5(b2));
function toRefs(objectRef) {
if (!isRef(objectRef))
return toRefs$1(objectRef);
const result = Array.isArray(objectRef.value) ? new Array(objectRef.value.length) : {};
for (const key2 in objectRef.value) {
result[key2] = customRef(() => ({
get() {
return objectRef.value[key2];
},
set(v2) {
if (Array.isArray(objectRef.value)) {
const copy = [...objectRef.value];
copy[key2] = v2;
objectRef.value = copy;
} else {
const newObject = __spreadProps$5(__spreadValues$7({}, objectRef.value), { [key2]: v2 });
Object.setPrototypeOf(newObject, objectRef.value);
objectRef.value = newObject;
}
}
}));
}
return result;
}
function tryOnMounted(fn, sync = true) {
if (getCurrentInstance())
onMounted(fn);
else if (sync)
fn();
else
nextTick(fn);
}
function tryOnUnmounted(fn) {
if (getCurrentInstance())
onUnmounted(fn);
}
function useTimeoutFn$1(cb, interval, options2 = {}) {
const {
immediate = true
} = options2;
const isPending = 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$1)
start();
}
tryOnScopeDispose(stop);
return {
isPending,
start,
stop
};
}
function unrefElement(elRef) {
var _a2;
const plain = resolveUnref(elRef);
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
}
const defaultWindow = isClient$1 ? window : void 0;
const defaultNavigator = isClient$1 ? window.navigator : void 0;
function useEventListener(...args) {
let target;
let event;
let listener;
let options2;
if (isString$1(args[0])) {
[event, listener, options2] = args;
target = defaultWindow;
} else {
[target, event, listener, options2] = args;
}
if (!target)
return noop$5;
let cleanup2 = noop$5;
const stopWatch = watch(() => unrefElement(target), (el) => {
cleanup2();
if (!el)
return;
el.addEventListener(event, listener, options2);
cleanup2 = () => {
el.removeEventListener(event, listener, options2);
cleanup2 = noop$5;
};
}, { immediate: true, flush: "post" });
const stop = () => {
stopWatch();
cleanup2();
};
tryOnScopeDispose(stop);
return stop;
}
function useSupported(callback, sync = false) {
const isSupported = ref();
const update = () => isSupported.value = Boolean(callback());
update();
tryOnMounted(update, sync);
return isSupported;
}
function useClipboard(options2 = {}) {
const {
navigator: navigator2 = defaultNavigator,
read = false,
source,
copiedDuring = 1500,
legacy = false
} = options2;
const events = ["copy", "cut"];
const isClipboardApiSupported = useSupported(() => navigator2 && "clipboard" in navigator2);
const isSupported = compu