import {
arrow_down_default,
arrow_left_default,
arrow_right_default,
arrow_up_default,
back_default,
calendar_default,
caret_right_default,
caret_top_default,
check_default,
circle_check_default,
circle_check_filled_default,
circle_close_default,
circle_close_filled_default,
clock_default,
close_default,
d_arrow_left_default,
d_arrow_right_default,
delete_default,
document_default,
full_screen_default,
hide_default,
info_filled_default,
loading_default,
minus_default,
more_default,
more_filled_default,
picture_filled_default,
plus_default,
question_filled_default,
refresh_left_default,
refresh_right_default,
scale_to_original_default,
search_default,
sort_down_default,
sort_up_default,
star_default,
star_filled_default,
success_filled_default,
view_default,
warning_filled_default,
zoom_in_default,
zoom_out_default
} from "/node_modules/.vite/deps/chunk-JHGZVYP2.js?v=e2549d3d";
import {
Schema,
castArray_default,
clamp_default,
cloneDeep_default,
clone_default,
debounce_default,
findLastIndex_default,
flatMap_default,
flattenDeep_default,
flatten_default,
fromPairs_default,
get_default,
has_default,
isEqual_default,
isNil_default,
isNull_default,
isUndefined_default,
memoize_default,
merge_default,
omit_default,
pick_default,
require_advancedFormat,
require_customParseFormat,
require_localeData,
require_weekOfYear,
require_weekYear,
set_default,
throttle_default,
union_default
} from "/node_modules/.vite/deps/chunk-OIZJ777O.js?v=e2549d3d";
import {
require_dayjs_min
} from "/node_modules/.vite/deps/chunk-FTDBO4JW.js?v=e2549d3d";
import {
TinyColor
} from "/node_modules/.vite/deps/chunk-USF4GMDZ.js?v=e2549d3d";
import {
Comment,
Fragment,
NOOP,
Teleport,
Text,
Transition,
TransitionGroup,
camelize,
capitalize,
cloneVNode,
computed,
createApp,
createBaseVNode,
createBlock,
createCommentVNode,
createElementBlock,
createSlots,
createTextVNode,
createVNode,
defineComponent,
effectScope,
getCurrentInstance,
getCurrentScope,
guardReactiveProps,
h,
hasOwn,
hyphenate,
inject,
isArray,
isDate,
isFunction,
isObject,
isPlainObject,
isPromise,
isRef,
isString,
isVNode,
markRaw,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onActivated,
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onDeactivated,
onMounted,
onScopeDispose,
onUnmounted,
onUpdated,
openBlock,
provide,
reactive,
readonly,
ref,
render,
renderList,
renderSlot,
resolveComponent,
resolveDirective,
resolveDynamicComponent,
shallowReactive,
shallowRef,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toRef,
toRefs,
triggerRef,
unref,
useAttrs,
useSlots,
vModelCheckbox,
vModelRadio,
vModelText,
vShow,
warn,
watch,
watchEffect,
withCtx,
withDirectives,
withKeys,
withModifiers
} from "/node_modules/.vite/deps/chunk-JMZIKGQ3.js?v=e2549d3d";
import {
__commonJS,
__toESM
} from "/node_modules/.vite/deps/chunk-G3PMV62Z.js?v=e2549d3d";
// node_modules/dayjs/plugin/dayOfYear.js
var require_dayOfYear = __commonJS({
"node_modules/dayjs/plugin/dayOfYear.js"(exports, module) {
!(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_dayOfYear = t();
})(exports, (function() {
"use strict";
return function(e, t, n) {
t.prototype.dayOfYear = function(e2) {
var t2 = Math.round((n(this).startOf("day") - n(this).startOf("year")) / 864e5) + 1;
return null == e2 ? t2 : this.add(e2 - t2, "day");
};
};
}));
}
});
// node_modules/dayjs/plugin/isSameOrAfter.js
var require_isSameOrAfter = __commonJS({
"node_modules/dayjs/plugin/isSameOrAfter.js"(exports, module) {
!(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrAfter = t();
})(exports, (function() {
"use strict";
return function(e, t) {
t.prototype.isSameOrAfter = function(e2, t2) {
return this.isSame(e2, t2) || this.isAfter(e2, t2);
};
};
}));
}
});
// node_modules/dayjs/plugin/isSameOrBefore.js
var require_isSameOrBefore = __commonJS({
"node_modules/dayjs/plugin/isSameOrBefore.js"(exports, module) {
!(function(e, i) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrBefore = i();
})(exports, (function() {
"use strict";
return function(e, i) {
i.prototype.isSameOrBefore = function(e2, i2) {
return this.isSame(e2, i2) || this.isBefore(e2, i2);
};
};
}));
}
});
// node_modules/element-plus/es/version.mjs
var version = "2.13.2";
// node_modules/element-plus/es/constants/key.mjs
var INSTALLED_KEY = /* @__PURE__ */ Symbol("INSTALLED_KEY");
// node_modules/element-plus/es/components/config-provider/src/constants.mjs
var configProviderContextKey = /* @__PURE__ */ Symbol();
// node_modules/element-plus/es/locale/lang/en.mjs
var English = {
name: "en",
el: {
breadcrumb: {
label: "Breadcrumb"
},
colorpicker: {
confirm: "OK",
clear: "Clear",
defaultLabel: "color picker",
description: "current color is {color}. press enter to select a new color.",
alphaLabel: "pick alpha value",
alphaDescription: "alpha {alpha}, current color is {color}",
hueLabel: "pick hue value",
hueDescription: "hue {hue}, current color is {color}",
svLabel: "pick saturation and brightness value",
svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}",
predefineDescription: "select {value} as the color"
},
datepicker: {
now: "Now",
today: "Today",
cancel: "Cancel",
clear: "Clear",
confirm: "OK",
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
monthTablePrompt: "Use the arrow keys and enter to select the month",
yearTablePrompt: "Use the arrow keys and enter to select the year",
selectedDate: "Selected date",
selectDate: "Select date",
selectTime: "Select time",
startDate: "Start Date",
startTime: "Start Time",
endDate: "End Date",
endTime: "End Time",
prevYear: "Previous Year",
nextYear: "Next Year",
prevMonth: "Previous Month",
nextMonth: "Next Month",
year: "",
month1: "January",
month2: "February",
month3: "March",
month4: "April",
month5: "May",
month6: "June",
month7: "July",
month8: "August",
month9: "September",
month10: "October",
month11: "November",
month12: "December",
weeks: {
sun: "Sun",
mon: "Mon",
tue: "Tue",
wed: "Wed",
thu: "Thu",
fri: "Fri",
sat: "Sat"
},
weeksFull: {
sun: "Sunday",
mon: "Monday",
tue: "Tuesday",
wed: "Wednesday",
thu: "Thursday",
fri: "Friday",
sat: "Saturday"
},
months: {
jan: "Jan",
feb: "Feb",
mar: "Mar",
apr: "Apr",
may: "May",
jun: "Jun",
jul: "Jul",
aug: "Aug",
sep: "Sep",
oct: "Oct",
nov: "Nov",
dec: "Dec"
}
},
inputNumber: {
decrease: "decrease number",
increase: "increase number"
},
select: {
loading: "Loading",
noMatch: "No matching data",
noData: "No data",
placeholder: "Select"
},
mention: {
loading: "Loading"
},
dropdown: {
toggleDropdown: "Toggle Dropdown"
},
cascader: {
noMatch: "No matching data",
loading: "Loading",
placeholder: "Select",
noData: "No data"
},
pagination: {
goto: "Go to",
pagesize: "/page",
total: "Total {total}",
pageClassifier: "",
page: "Page",
prev: "Go to previous page",
next: "Go to next page",
currentPage: "page {pager}",
prevPages: "Previous {pager} pages",
nextPages: "Next {pager} pages",
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
},
dialog: {
close: "Close this dialog"
},
drawer: {
close: "Close this dialog"
},
messagebox: {
title: "Message",
confirm: "OK",
cancel: "Cancel",
error: "Illegal input",
close: "Close this dialog"
},
upload: {
deleteTip: "press delete to remove",
delete: "Delete",
preview: "Preview",
continue: "Continue"
},
slider: {
defaultLabel: "slider between {min} and {max}",
defaultRangeStartLabel: "pick start value",
defaultRangeEndLabel: "pick end value"
},
table: {
emptyText: "No Data",
confirmFilter: "Confirm",
resetFilter: "Reset",
clearFilter: "All",
sumText: "Sum",
selectAllLabel: "Select all rows",
selectRowLabel: "Select this row",
expandRowLabel: "Expand this row",
collapseRowLabel: "Collapse this row",
sortLabel: "Sort by {column}",
filterLabel: "Filter by {column}"
},
tag: {
close: "Close this tag"
},
tour: {
next: "Next",
previous: "Previous",
finish: "Finish",
close: "Close this dialog"
},
tree: {
emptyText: "No Data"
},
transfer: {
noMatch: "No matching data",
noData: "No data",
titles: ["List 1", "List 2"],
filterPlaceholder: "Enter keyword",
noCheckedFormat: "{total} items",
hasCheckedFormat: "{checked}/{total} checked"
},
image: {
error: "FAILED"
},
pageHeader: {
title: "Back"
},
popconfirm: {
confirmButtonText: "Yes",
cancelButtonText: "No"
},
carousel: {
leftArrow: "Carousel arrow left",
rightArrow: "Carousel arrow right",
indicator: "Carousel switch to index {index}"
}
}
};
// node_modules/element-plus/es/hooks/use-locale/index.mjs
var buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
var translate = (path, option, locale) => get_default(locale, path, path).replace(
/\{(\w+)\}/g,
(_2, key) => {
var _a;
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
}
);
var buildLocaleContext = (locale) => {
const lang = computed(() => unref(locale).name);
const localeRef = isRef(locale) ? locale : ref(locale);
return {
lang,
locale: localeRef,
t: buildTranslator(locale)
};
};
var localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
var useLocale = (localeOverrides) => {
const locale = localeOverrides || inject(localeContextKey, ref());
return buildLocaleContext(computed(() => locale.value || English));
};
// node_modules/element-plus/es/hooks/use-namespace/index.mjs
var defaultNamespace = "el";
var statePrefix = "is-";
var _bem = (namespace, block, blockSuffix, element, modifier) => {
let cls = `${namespace}-${block}`;
if (blockSuffix) {
cls += `-${blockSuffix}`;
}
if (element) {
cls += `__${element}`;
}
if (modifier) {
cls += `--${modifier}`;
}
return cls;
};
var namespaceContextKey = /* @__PURE__ */ Symbol("namespaceContextKey");
var useGetDerivedNamespace = (namespaceOverrides) => {
const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
const namespace = computed(() => {
return unref(derivedNamespace) || defaultNamespace;
});
return namespace;
};
var useNamespace = (block, namespaceOverrides) => {
const namespace = useGetDerivedNamespace(namespaceOverrides);
const b2 = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
const m2 = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
const be2 = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
const is = (name, ...args) => {
const state = args.length >= 1 ? args[0] : true;
return name && state ? `${statePrefix}${name}` : "";
};
const cssVar = (object) => {
const styles = {};
for (const key in object) {
if (object[key]) {
styles[`--${namespace.value}-${key}`] = object[key];
}
}
return styles;
};
const cssVarBlock = (object) => {
const styles = {};
for (const key in object) {
if (object[key]) {
styles[`--${namespace.value}-${block}-${key}`] = object[key];
}
}
return styles;
};
const cssVarName = (name) => `--${namespace.value}-${name}`;
const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
return {
namespace,
b: b2,
e,
m: m2,
be: be2,
em,
bm,
bem,
is,
// css
cssVar,
cssVarName,
cssVarBlock,
cssVarBlockName
};
};
// node_modules/element-plus/es/utils/types.mjs
var isUndefined = (val) => val === void 0;
var isBoolean = (val) => typeof val === "boolean";
var isNumber = (val) => typeof val === "number";
var isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length;
var isElement = (e) => {
if (typeof Element === "undefined") return false;
return e instanceof Element;
};
var isPropAbsent = (prop) => isNil_default(prop);
var isStringNumber = (val) => {
if (!isString(val)) {
return false;
}
return !Number.isNaN(Number(val));
};
var isWindow = (val) => val === window;
// node_modules/@vueuse/shared/index.mjs
function computedEager(fn2, options) {
var _a;
const result = shallowRef();
watchEffect(() => {
result.value = fn2();
}, {
...options,
flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
});
return readonly(result);
}
function tryOnScopeDispose(fn2) {
if (getCurrentScope()) {
onScopeDispose(fn2);
return true;
}
return false;
}
function toValue(r) {
return typeof r === "function" ? r() : unref(r);
}
function toReactive(objectRef) {
if (!isRef(objectRef))
return reactive(objectRef);
const proxy = new Proxy({}, {
get(_2, p2, receiver) {
return unref(Reflect.get(objectRef.value, p2, receiver));
},
set(_2, p2, value) {
if (isRef(objectRef.value[p2]) && !isRef(value))
objectRef.value[p2].value = value;
else
objectRef.value[p2] = value;
return true;
},
deleteProperty(_2, p2) {
return Reflect.deleteProperty(objectRef.value, p2);
},
has(_2, p2) {
return Reflect.has(objectRef.value, p2);
},
ownKeys() {
return Object.keys(objectRef.value);
},
getOwnPropertyDescriptor() {
return {
enumerable: true,
configurable: true
};
}
});
return reactive(proxy);
}
function reactiveComputed(fn2) {
return toReactive(computed(fn2));
}
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
var isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
var isDef = (val) => typeof val !== "undefined";
var notNullish = (val) => val != null;
var toString = Object.prototype.toString;
var isObject2 = (val) => toString.call(val) === "[object Object]";
var clamp = (n, min3, max3) => Math.min(max3, Math.max(min3, n));
var noop = () => {
};
var isIOS = getIsIOS();
function getIsIOS() {
var _a, _b;
return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
}
function createFilterWrapper(filter, fn2) {
function wrapper(...args) {
return new Promise((resolve, reject) => {
Promise.resolve(filter(() => fn2.apply(this, args), { fn: fn2, thisArg: this, args })).then(resolve).catch(reject);
});
}
return wrapper;
}
function debounceFilter(ms, options = {}) {
let timer;
let maxTimer;
let lastRejector = noop;
const _clearTimeout = (timer2) => {
clearTimeout(timer2);
lastRejector();
lastRejector = noop;
};
const filter = (invoke) => {
const duration = toValue(ms);
const maxDuration = toValue(options.maxWait);
if (timer)
_clearTimeout(timer);
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
if (maxTimer) {
_clearTimeout(maxTimer);
maxTimer = null;
}
return Promise.resolve(invoke());
}
return new Promise((resolve, reject) => {
lastRejector = options.rejectOnCancel ? reject : resolve;
if (maxDuration && !maxTimer) {
maxTimer = setTimeout(() => {
if (timer)
_clearTimeout(timer);
maxTimer = null;
resolve(invoke());
}, maxDuration);
}
timer = setTimeout(() => {
if (maxTimer)
_clearTimeout(maxTimer);
maxTimer = null;
resolve(invoke());
}, duration);
});
};
return filter;
}
function throttleFilter(...args) {
let lastExec = 0;
let timer;
let isLeading = true;
let lastRejector = noop;
let lastValue;
let ms;
let trailing;
let leading;
let rejectOnCancel;
if (!isRef(args[0]) && typeof args[0] === "object")
({ delay: ms, trailing = true, leading = true, rejectOnCancel = false } = args[0]);
else
[ms, trailing = true, leading = true, rejectOnCancel = false] = args;
const clear = () => {
if (timer) {
clearTimeout(timer);
timer = void 0;
lastRejector();
lastRejector = noop;
}
};
const filter = (_invoke) => {
const duration = toValue(ms);
const elapsed = Date.now() - lastExec;
const invoke = () => {
return lastValue = _invoke();
};
clear();
if (duration <= 0) {
lastExec = Date.now();
return invoke();
}
if (elapsed > duration && (leading || !isLeading)) {
lastExec = Date.now();
invoke();
} else if (trailing) {
lastValue = new Promise((resolve, reject) => {
lastRejector = rejectOnCancel ? reject : resolve;
timer = setTimeout(() => {
lastExec = Date.now();
isLeading = true;
resolve(invoke());
clear();
}, Math.max(0, duration - elapsed));
});
}
if (!leading && !timer)
timer = setTimeout(() => isLeading = true, duration);
isLeading = false;
return lastValue;
};
return filter;
}
function cacheStringFunction(fn2) {
const cache2 = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache2[str];
return hit || (cache2[str] = fn2(str));
};
}
var hyphenateRE = /\B([A-Z])/g;
var hyphenate2 = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
var camelizeRE = /-(\w)/g;
var camelize2 = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
});
function identity(arg) {
return arg;
}
function getLifeCycleTarget(target2) {
return target2 || getCurrentInstance();
}
function useDebounceFn(fn2, ms = 200, options = {}) {
return createFilterWrapper(
debounceFilter(ms, options),
fn2
);
}
function refDebounced(value, ms = 200, options = {}) {
const debounced = ref(value.value);
const updater = useDebounceFn(() => {
debounced.value = value.value;
}, ms, options);
watch(value, () => updater());
return debounced;
}
function useThrottleFn(fn2, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
return createFilterWrapper(
throttleFilter(ms, trailing, leading, rejectOnCancel),
fn2
);
}
function tryOnMounted(fn2, sync = true, target2) {
const instance = getLifeCycleTarget();
if (instance)
onMounted(fn2, target2);
else if (sync)
fn2();
else
nextTick(fn2);
}
function useTimeoutFn(cb, interval, options = {}) {
const {
immediate = true
} = options;
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);
}, toValue(interval));
}
if (immediate) {
isPending.value = true;
if (isClient)
start();
}
tryOnScopeDispose(stop);
return {
isPending: readonly(isPending),
start,
stop
};
}
// node_modules/@vueuse/core/node_modules/vue-demi/lib/index.mjs
var isVue22 = false;
// node_modules/@vueuse/core/index.mjs
function unrefElement(elRef) {
var _a;
const plain = toValue(elRef);
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
}
var defaultWindow = isClient ? window : void 0;
var defaultDocument = isClient ? window.document : void 0;
var defaultNavigator = isClient ? window.navigator : void 0;
var defaultLocation = isClient ? window.location : void 0;
function useEventListener(...args) {
let target2;
let events;
let listeners;
let options;
if (typeof args[0] === "string" || Array.isArray(args[0])) {
[events, listeners, options] = args;
target2 = defaultWindow;
} else {
[target2, events, listeners, options] = args;
}
if (!target2)
return noop;
if (!Array.isArray(events))
events = [events];
if (!Array.isArray(listeners))
listeners = [listeners];
const cleanups = [];
const cleanup = () => {
cleanups.forEach((fn2) => fn2());
cleanups.length = 0;
};
const register = (el, event, listener, options2) => {
el.addEventListener(event, listener, options2);
return () => el.removeEventListener(event, listener, options2);
};
const stopWatch = watch(
() => [unrefElement(target2), toValue(options)],
([el, options2]) => {
cleanup();
if (!el)
return;
const optionsClone = isObject2(options2) ? { ...options2 } : options2;
cleanups.push(
...events.flatMap((event) => {
return listeners.map((listener) => register(el, event, listener, optionsClone));
})
);
},
{ immediate: true, flush: "post" }
);
const stop = () => {
stopWatch();
cleanup();
};
tryOnScopeDispose(stop);
return stop;
}
var _iOSWorkaround = false;
function onClickOutside(target2, handler, options = {}) {
const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
if (!window2)
return noop;
if (isIOS && !_iOSWorkaround) {
_iOSWorkaround = true;
Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop));
window2.document.documentElement.addEventListener("click", noop);
}
let shouldListen = true;
const shouldIgnore = (event) => {
return ignore.some((target22) => {
if (typeof target22 === "string") {
return Array.from(window2.document.querySelectorAll(target22)).some((el) => el === event.target || event.composedPath().includes(el));
} else {
const el = unrefElement(target22);
return el && (event.target === el || event.composedPath().includes(el));
}
});
};
const listener = (event) => {
const el = unrefElement(target2);
if (!el || el === event.target || event.composedPath().includes(el))
return;
if (event.detail === 0)
shouldListen = !shouldIgnore(event);
if (!shouldListen) {
shouldListen = true;
return;
}
handler(event);
};
const cleanup = [
useEventListener(window2, "click", listener, { passive: true, capture }),
useEventListener(window2, "pointerdown", (e) => {
const el = unrefElement(target2);
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
}, { passive: true }),
detectIframe && useEventListener(window2, "blur", (event) => {
setTimeout(() => {
var _a;
const el = unrefElement(target2);
if (((_a = window2.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement))) {
handler(event);
}
}, 0);
})
].filter(Boolean);
const stop = () => cleanup.forEach((fn2) => fn2());
return stop;
}
function useMounted() {
const isMounted = ref(false);
const instance = getCurrentInstance();
if (instance) {
onMounted(() => {
isMounted.value = true;
}, isVue22 ? void 0 : instance);
}
return isMounted;
}
function useSupported(callback) {
const isMounted = useMounted();
return computed(() => {
isMounted.value;
return Boolean(callback());
});
}
function useMutationObserver(target2, callback, options = {}) {
const { window: window2 = defaultWindow, ...mutationOptions } = options;
let observer;
const isSupported = useSupported(() => window2 && "MutationObserver" in window2);
const cleanup = () => {
if (observer) {
observer.disconnect();
observer = void 0;
}
};
const targets = computed(() => {
const value = toValue(target2);
const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);
return new Set(items);
});
const stopWatch = watch(
() => targets.value,
(targets2) => {
cleanup();
if (isSupported.value && targets2.size) {
observer = new MutationObserver(callback);
targets2.forEach((el) => observer.observe(el, mutationOptions));
}
},
{ immediate: true, flush: "post" }
);
const takeRecords = () => {
return observer == null ? void 0 : observer.takeRecords();
};
const stop = () => {
cleanup();
stopWatch();
};
tryOnScopeDispose(stop);
return {
isSupported,
stop,
takeRecords
};
}
function useActiveElement(options = {}) {
var _a;
const {
window: window2 = defaultWindow,
deep = true,
triggerOnRemoval = false
} = options;
const document2 = (_a = options.document) != null ? _a : window2 == null ? void 0 : window2.document;
const getDeepActiveElement = () => {
var _a2;
let element = document2 == null ? void 0 : document2.activeElement;
if (deep) {
while (element == null ? void 0 : element.shadowRoot)
element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;
}
return element;
};
const activeElement = ref();
const trigger = () => {
activeElement.value = getDeepActiveElement();
};
if (window2) {
useEventListener(window2, "blur", (event) => {
if (event.relatedTarget !== null)
return;
trigger();
}, true);
useEventListener(window2, "focus", trigger, true);
}
if (triggerOnRemoval) {
useMutationObserver(document2, (mutations) => {
mutations.filter((m2) => m2.removedNodes.length).map((n) => Array.from(n.removedNodes)).flat().forEach((node) => {
if (node === activeElement.value)
trigger();
});
}, {
childList: true,
subtree: true
});
}
trigger();
return activeElement;
}
function useMediaQuery(query, options = {}) {
const { window: window2 = defaultWindow } = options;
const isSupported = useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
let mediaQuery;
const matches = ref(false);
const handler = (event) => {
matches.value = event.matches;
};
const cleanup = () => {
if (!mediaQuery)
return;
if ("removeEventListener" in mediaQuery)
mediaQuery.removeEventListener("change", handler);
else
mediaQuery.removeListener(handler);
};
const stopWatch = watchEffect(() => {
if (!isSupported.value)
return;
cleanup();
mediaQuery = window2.matchMedia(toValue(query));
if ("addEventListener" in mediaQuery)
mediaQuery.addEventListener("change", handler);
else
mediaQuery.addListener(handler);
matches.value = mediaQuery.matches;
});
tryOnScopeDispose(() => {
stopWatch();
cleanup();
mediaQuery = void 0;
});
return matches;
}
function cloneFnJSON(source) {
return JSON.parse(JSON.stringify(source));
}
var _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var globalKey = "__vueuse_ssr_handlers__";
var handlers = getHandlers();
function getHandlers() {
if (!(globalKey in _global))
_global[globalKey] = _global[globalKey] || {};
return _global[globalKey];
}
function useCssVar(prop, target2, options = {}) {
const { window: window2 = defaultWindow, initialValue = "", observe = false } = options;
const variable = ref(initialValue);
const elRef = computed(() => {
var _a;
return unrefElement(target2) || ((_a = window2 == null ? void 0 : window2.document) == null ? void 0 : _a.documentElement);
});
function updateCssVar() {
var _a;
const key = toValue(prop);
const el = toValue(elRef);
if (el && window2) {
const value = (_a = window2.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();
variable.value = value || initialValue;
}
}
if (observe) {
useMutationObserver(elRef, updateCssVar, {
attributeFilter: ["style", "class"],
window: window2
});
}
watch(
[elRef, () => toValue(prop)],
updateCssVar,
{ immediate: true }
);
watch(
variable,
(val) => {
var _a;
if ((_a = elRef.value) == null ? void 0 : _a.style)
elRef.value.style.setProperty(toValue(prop), val);
}
);
return variable;
}
function useDocumentVisibility(options = {}) {
const { document: document2 = defaultDocument } = options;
if (!document2)
return ref("visible");
const visibility = ref(document2.visibilityState);
useEventListener(document2, "visibilitychange", () => {
visibility.value = document2.visibilityState;
});
return visibility;
}
function useResizeObserver(target2, callback, options = {}) {
const { window: window2 = defaultWindow, ...observerOptions } = options;
let observer;
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
const cleanup = () => {
if (observer) {
observer.disconnect();
observer = void 0;
}
};
const targets = computed(() => Array.isArray(target2) ? target2.map((el) => unrefElement(el)) : [unrefElement(target2)]);
const stopWatch = watch(
targets,
(els) => {
cleanup();
if (isSupported.value && window2) {
observer = new ResizeObserver(callback);
for (const _el of els)
_el && observer.observe(_el, observerOptions);
}
},
{ immediate: true, flush: "post" }
);
const stop = () => {
cleanup();
stopWatch();
};
tryOnScopeDispose(stop);
return {
isSupported,
stop
};
}
function useElementBounding(target2, options = {}) {
const {
reset = true,
windowResize = true,
windowScroll = true,
immediate = true
} = options;
const height = ref(0);
const bottom = ref(0);
const left = ref(0);
const right = ref(0);
const top = ref(0);
const width = ref(0);
const x2 = ref(0);
const y = ref(0);
function update() {
const el = unrefElement(target2);
if (!el) {
if (reset) {
height.value = 0;
bottom.value = 0;
left.value = 0;
right.value = 0;
top.value = 0;
width.value = 0;
x2.value = 0;
y.value = 0;
}
return;
}
const rect = el.getBoundingClientRect();
height.value = rect.height;
bottom.value = rect.bottom;
left.value = rect.left;
right.value = rect.right;
top.value = rect.top;
width.value = rect.width;
x2.value = rect.x;
y.value = rect.y;
}
useResizeObserver(target2, update);
watch(() => unrefElement(target2), (ele) => !ele && update());
useMutationObserver(target2, update, {
attributeFilter: ["style", "class"]
});
if (windowScroll)
useEventListener("scroll", update, { capture: true, passive: true });
if (windowResize)
useEventListener("resize", update, { passive: true });
tryOnMounted(() => {
if (immediate)
update();
});
return {
height,
bottom,
left,
right,
top,
width,
x: x2,
y,
update
};
}
function useElementSize(target2, initialSize = { width: 0, height: 0 }, options = {}) {
const { window: window2 = defaultWindow, box = "content-box" } = options;
const isSVG = computed(() => {
var _a, _b;
return (_b = (_a = unrefElement(target2)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
});
const width = ref(initialSize.width);
const height = ref(initialSize.height);
const { stop: stop1 } = useResizeObserver(
target2,
([entry]) => {
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
if (window2 && isSVG.value) {
const $elem = unrefElement(target2);
if ($elem) {
const rect = $elem.getBoundingClientRect();
width.value = rect.width;
height.value = rect.height;
}
} else {
if (boxSize) {
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
} else {
width.value = entry.contentRect.width;
height.value = entry.contentRect.height;
}
}
},
options
);
tryOnMounted(() => {
const ele = unrefElement(target2);
if (ele) {
width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
}
});
const stop2 = watch(
() => unrefElement(target2),
(ele) => {
width.value = ele ? initialSize.width : 0;
height.value = ele ? initialSize.height : 0;
}
);
function stop() {
stop1();
stop2();
}
return {
width,
height,
stop
};
}
function useIntersectionObserver(target2, callback, options = {}) {
const {
root,
rootMargin = "0px",
threshold = 0.1,
window: window2 = defaultWindow,
immediate = true
} = options;
const isSupported = useSupported(() => window2 && "IntersectionObserver" in window2);
const targets = computed(() => {
const _target = toValue(target2);
return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);
});
let cleanup = noop;
const isActive = ref(immediate);
const stopWatch = isSupported.value ? watch(
() => [targets.value, unrefElement(root), isActive.value],
([targets2, root2]) => {
cleanup();
if (!isActive.value)
return;
if (!targets2.length)
return;
const observer = new IntersectionObserver(
callback,
{
root: unrefElement(root2),
rootMargin,
threshold
}
);
targets2.forEach((el) => el && observer.observe(el));
cleanup = () => {
observer.disconnect();
cleanup = noop;
};
},
{ immediate, flush: "post" }
) : noop;
const stop = () => {
cleanup();
stopWatch();
isActive.value = false;
};
tryOnScopeDispose(stop);
return {
isSupported,
isActive,
pause() {
cleanup();
isActive.value = false;
},
resume() {
isActive.value = true;
},
stop
};
}
var defaultState = {
x: 0,
y: 0,
pointerId: 0,
pressure: 0,
tiltX: 0,
tiltY: 0,
width: 0,
height: 0,
twist: 0,
pointerType: null
};
var keys = Object.keys(defaultState);
var DEFAULT_UNITS = [
{ max: 6e4, value: 1e3, name: "second" },
{ max: 276e4, value: 6e4, name: "minute" },
{ max: 72e6, value: 36e5, name: "hour" },
{ max: 5184e5, value: 864e5, name: "day" },
{ max: 24192e5, value: 6048e5, name: "week" },
{ max: 28512e6, value: 2592e6, name: "month" },
{ max: Number.POSITIVE_INFINITY, value: 31536e6, name: "year" }
];
var _TransitionPresets = {
easeInSine: [0.12, 0, 0.39, 0],
easeOutSine: [0.61, 1, 0.88, 1],
easeInOutSine: [0.37, 0, 0.63, 1],
easeInQuad: [0.11, 0, 0.5, 0],
easeOutQuad: [0.5, 1, 0.89, 1],
easeInOutQuad: [0.45, 0, 0.55, 1],
easeInCubic: [0.32, 0, 0.67, 0],
easeOutCubic: [0.33, 1, 0.68, 1],
easeInOutCubic: [0.65, 0, 0.35, 1],
easeInQuart: [0.5, 0, 0.75, 0],
easeOutQuart: [0.25, 1, 0.5, 1],
easeInOutQuart: [0.76, 0, 0.24, 1],
easeInQuint: [0.64, 0, 0.78, 0],
easeOutQuint: [0.22, 1, 0.36, 1],
easeInOutQuint: [0.83, 0, 0.17, 1],
easeInExpo: [0.7, 0, 0.84, 0],
easeOutExpo: [0.16, 1, 0.3, 1],
easeInOutExpo: [0.87, 0, 0.13, 1],
easeInCirc: [0.55, 0, 1, 0.45],
easeOutCirc: [0, 0.55, 0.45, 1],
easeInOutCirc: [0.85, 0, 0.15, 1],
easeInBack: [0.36, 0, 0.66, -0.56],
easeOutBack: [0.34, 1.56, 0.64, 1],
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
var TransitionPresets = Object.assign({}, { linear: identity }, _TransitionPresets);
function useVModel(props2, key, emit, options = {}) {
var _a, _b, _c, _d, _e;
const {
clone = false,
passive = false,
eventName,
deep = false,
defaultValue,
shouldEmit
} = options;
const vm = getCurrentInstance();
const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
let event = eventName;
if (!key) {
if (isVue22) {
const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;
key = (modelOptions == null ? void 0 : modelOptions.value) || "value";
if (!eventName)
event = (modelOptions == null ? void 0 : modelOptions.event) || "input";
} else {
key = "modelValue";
}
}
event = event || `update:${key.toString()}`;
const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
const getValue = () => isDef(props2[key]) ? cloneFn(props2[key]) : defaultValue;
const triggerEmit = (value) => {
if (shouldEmit) {
if (shouldEmit(value))
_emit(event, value);
} else {
_emit(event, value);
}
};
if (passive) {
const initialValue = getValue();
const proxy = ref(initialValue);
let isUpdating = false;
watch(
() => props2[key],
(v2) => {
if (!isUpdating) {
isUpdating = true;
proxy.value = cloneFn(v2);
nextTick(() => isUpdating = false);
}
}
);
watch(
proxy,
(v2) => {
if (!isUpdating && (v2 !== props2[key] || deep))
triggerEmit(v2);
},
{ deep }
);
return proxy;
} else {
return computed({
get() {
return getValue();
},
set(value) {
triggerEmit(value);
}
});
}
}
function useWindowFocus(options = {}) {
const { window: window2 = defaultWindow } = options;
if (!window2)
return ref(false);
const focused = ref(window2.document.hasFocus());
useEventListener(window2, "blur", () => {
focused.value = false;
});
useEventListener(window2, "focus", () => {
focused.value = true;
});
return focused;
}
function useWindowSize(options = {}) {
const {
window: window2 = defaultWindow,
initialWidth = Number.POSITIVE_INFINITY,
initialHeight = Number.POSITIVE_INFINITY,
listenOrientation = true,
includeScrollbar = true
} = options;
const width = ref(initialWidth);
const height = ref(initialHeight);
const update = () => {
if (window2) {
if (includeScrollbar) {
width.value = window2.innerWidth;
height.value = window2.innerHeight;
} else {
width.value = window2.document.documentElement.clientWidth;
height.value = window2.document.documentElement.clientHeight;
}
}
};
update();
tryOnMounted(update);
useEventListener("resize", update, { passive: true });
if (listenOrientation) {
const matches = useMediaQuery("(orientation: portrait)");
watch(matches, () => update());
}
return { width, height };
}
// node_modules/element-plus/es/utils/error.mjs
var ElementPlusError = class extends Error {
constructor(m2) {
super(m2);
this.name = "ElementPlusError";
}
};
function throwError(scope, m2) {
throw new ElementPlusError(`[${scope}] ${m2}`);
}
function debugWarn(scope, message2) {
if (true) {
const error = isString(scope) ? new ElementPlusError(`[${scope}] ${message2}`) : scope;
console.warn(error);
}
}
// node_modules/element-plus/es/hooks/use-z-index/index.mjs
var initial = {
current: 0
};
var zIndex = ref(0);
var defaultInitialZIndex = 2e3;
var ZINDEX_INJECTION_KEY = /* @__PURE__ */ Symbol("elZIndexContextKey");
var zIndexContextKey = /* @__PURE__ */ Symbol("zIndexContextKey");
var useZIndex = (zIndexOverrides) => {
const increasingInjection = getCurrentInstance() ? inject(ZINDEX_INJECTION_KEY, initial) : initial;
const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0);
const initialZIndex = computed(() => {
const zIndexFromInjection = unref(zIndexInjection);
return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
});
const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
const nextZIndex = () => {
increasingInjection.current++;
zIndex.value = increasingInjection.current;
return currentZIndex.value;
};
if (!isClient && !inject(ZINDEX_INJECTION_KEY)) {
debugWarn(
"ZIndexInjection",
`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`
);
}
return {
initialZIndex,
currentZIndex,
nextZIndex
};
};
// node_modules/element-plus/es/utils/vue/props/runtime.mjs
var epPropKey = "__epPropKey";
var definePropType = (val) => val;
var isEpProp = (val) => isObject(val) && !!val[epPropKey];
var buildProp = (prop, key) => {
if (!isObject(prop) || isEpProp(prop)) return prop;
const { values, required, default: defaultValue, type, validator } = prop;
const _validator = values || validator ? (val) => {
let valid = false;
let allowedValues = [];
if (values) {
allowedValues = Array.from(values);
if (hasOwn(prop, "default")) {
allowedValues.push(defaultValue);
}
valid || (valid = allowedValues.includes(val));
}
if (validator) valid || (valid = validator(val));
if (!valid && allowedValues.length > 0) {
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
warn(
`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
val
)}.`
);
}
return valid;
} : void 0;
const epProp = {
type,
required: !!required,
validator: _validator,
[epPropKey]: true
};
if (hasOwn(prop, "default")) epProp.default = defaultValue;
return epProp;
};
var buildProps = (props2) => fromPairs_default(
Object.entries(props2).map(([key, option]) => [
key,
buildProp(option, key)
])
);
// node_modules/element-plus/es/constants/size.mjs
var componentSizes = ["", "default", "small", "large"];
var componentSizeMap = {
large: 40,
default: 32,
small: 24
};
// node_modules/element-plus/es/hooks/use-size/index.mjs
var useSizeProp = buildProp({
type: String,
values: componentSizes,
required: false
});
var useSizeProps = {
size: useSizeProp
};
var SIZE_INJECTION_KEY = /* @__PURE__ */ Symbol("size");
var useGlobalSize = () => {
const injectedSize = inject(SIZE_INJECTION_KEY, {});
return computed(() => {
return unref(injectedSize.size) || "";
});
};
// node_modules/element-plus/es/hooks/use-empty-values/index.mjs
var emptyValuesContextKey = /* @__PURE__ */ Symbol("emptyValuesContextKey");
var SCOPE = "use-empty-values";
var DEFAULT_EMPTY_VALUES = ["", void 0, null];
var DEFAULT_VALUE_ON_CLEAR = void 0;
var useEmptyValuesProps = buildProps({
/**
* @description empty values supported by the component
*/
emptyValues: Array,
/**
* @description return value when cleared, if you want to set `undefined`, use `() => undefined`
*/
valueOnClear: {
/* eslint-disable-next-line @typescript-eslint/no-unsafe-function-type */
type: definePropType([
String,
Number,
Boolean,
Function
]),
default: void 0,
validator: (val) => {
val = isFunction(val) ? val() : val;
if (isArray(val)) {
return val.every((item) => !item);
}
return !val;
}
}
});
var useEmptyValues = (props2, defaultValue) => {
const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
const emptyValues = computed(
() => props2.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES
);
const valueOnClear = computed(() => {
if (isFunction(props2.valueOnClear)) {
return props2.valueOnClear();
} else if (props2.valueOnClear !== void 0) {
return props2.valueOnClear;
} else if (isFunction(config.value.valueOnClear)) {
return config.value.valueOnClear();
} else if (config.value.valueOnClear !== void 0) {
return config.value.valueOnClear;
}
return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR;
});
const isEmptyValue = (value) => {
let result = true;
if (isArray(value)) {
result = emptyValues.value.some((emptyValue) => {
return isEqual_default(value, emptyValue);
});
} else {
result = emptyValues.value.includes(value);
}
return result;
};
if (!isEmptyValue(valueOnClear.value)) {
debugWarn(SCOPE, "value-on-clear should be a value of empty-values");
}
return {
emptyValues,
valueOnClear,
isEmptyValue
};
};
// node_modules/element-plus/es/utils/objects.mjs
var keysOf = (arr) => Object.keys(arr);
var entriesOf = (arr) => Object.entries(arr);
var getProp = (obj, path, defaultValue) => {
return {
get value() {
return get_default(obj, path, defaultValue);
},
set value(val) {
set_default(obj, path, val);
}
};
};
// node_modules/element-plus/es/components/config-provider/src/hooks/use-global-config.mjs
var globalConfig = ref();
function useGlobalConfig(key, defaultValue = void 0) {
const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
if (key) {
return computed(() => {
var _a, _b;
return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
});
} else {
return config;
}
}
function useGlobalComponentSettings(block, sizeFallback) {
const config = useGlobalConfig();
const ns = useNamespace(
block,
computed(() => {
var _a;
return ((_a = config.value) == null ? void 0 : _a.namespace) || defaultNamespace;
})
);
const locale = useLocale(computed(() => {
var _a;
return (_a = config.value) == null ? void 0 : _a.locale;
}));
const zIndex2 = useZIndex(
computed(() => {
var _a;
return ((_a = config.value) == null ? void 0 : _a.zIndex) || defaultInitialZIndex;
})
);
const size2 = computed(() => {
var _a;
return unref(sizeFallback) || ((_a = config.value) == null ? void 0 : _a.size) || "";
});
provideGlobalConfig(computed(() => unref(config) || {}));
return {
ns,
locale,
zIndex: zIndex2,
size: size2
};
}
var provideGlobalConfig = (config, app, global2 = false) => {
var _a;
const inSetup = !!getCurrentInstance();
const oldConfig = inSetup ? useGlobalConfig() : void 0;
const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? provide : void 0;
if (!provideFn) {
debugWarn(
"provideGlobalConfig",
"provideGlobalConfig() can only be used inside setup()."
);
return;
}
const context = computed(() => {
const cfg = unref(config);
if (!(oldConfig == null ? void 0 : oldConfig.value)) return cfg;
return mergeConfig(oldConfig.value, cfg);
});
provideFn(configProviderContextKey, context);
provideFn(
localeContextKey,
computed(() => context.value.locale)
);
provideFn(
namespaceContextKey,
computed(() => context.value.namespace)
);
provideFn(
zIndexContextKey,
computed(() => context.value.zIndex)
);
provideFn(SIZE_INJECTION_KEY, {
size: computed(() => context.value.size || "")
});
provideFn(
emptyValuesContextKey,
computed(() => ({
emptyValues: context.value.emptyValues,
valueOnClear: context.value.valueOnClear
}))
);
if (global2 || !globalConfig.value) {
globalConfig.value = context.value;
}
return context;
};
var mergeConfig = (a2, b2) => {
const keys2 = [.../* @__PURE__ */ new Set([...keysOf(a2), ...keysOf(b2)])];
const obj = {};
for (const key of keys2) {
obj[key] = b2[key] !== void 0 ? b2[key] : a2[key];
}
return obj;
};
// node_modules/element-plus/es/make-installer.mjs
var makeInstaller = (components = []) => {
const install2 = (app, options) => {
if (app[INSTALLED_KEY]) return;
app[INSTALLED_KEY] = true;
components.forEach((c2) => app.use(c2));
if (options) provideGlobalConfig(options, app, true);
};
return {
version,
install: install2
};
};
// node_modules/element-plus/es/components/teleport/src/teleport.mjs
var teleportProps = buildProps({
to: {
type: definePropType([String, Object]),
required: true
},
disabled: Boolean
});
// node_modules/element-plus/es/constants/event.mjs
var UPDATE_MODEL_EVENT = "update:modelValue";
var CHANGE_EVENT = "change";
var INPUT_EVENT = "input";
// node_modules/element-plus/es/components/affix/src/affix.mjs
var affixProps = buildProps({
/**
* @description affix element zIndex value
* */
zIndex: {
type: definePropType([Number, String]),
default: 100
},
/**
* @description target container. (CSS selector)
*/
target: {
type: String,
default: ""
},
/**
* @description offset distance
* */
offset: {
type: Number,
default: 0
},
/**
* @description position of affix
* */
position: {
type: String,
values: ["top", "bottom"],
default: "top"
},
/**
* @description whether affix element is teleported, if `true` it will be teleported to where `append-to` sets
* */
teleported: Boolean,
/**
* @description which element the affix element appends to
* */
appendTo: {
type: teleportProps.to.type,
default: "body"
}
});
var affixEmits = {
scroll: ({ scrollTop, fixed }) => isNumber(scrollTop) && isBoolean(fixed),
[CHANGE_EVENT]: (fixed) => isBoolean(fixed)
};
// node_modules/element-plus/es/components/teleport/src/teleport.vue2.mjs
var _sfc_main = defineComponent({
__name: "teleport",
props: teleportProps,
setup(__props) {
return (_ctx, _cache) => {
return _ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, {
key: 1,
to: _ctx.to
}, [
renderSlot(_ctx.$slots, "default")
], 8, ["to"]));
};
}
});
// node_modules/element-plus/es/utils/vue/install.mjs
var withInstall = (main, extra) => {
main.install = (app) => {
for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
app.component(comp.name, comp);
}
};
if (extra) {
for (const [key, comp] of Object.entries(extra)) {
main[key] = comp;
}
}
return main;
};
var withInstallFunction = (fn2, name) => {
fn2.install = (app) => {
fn2._context = app._context;
app.config.globalProperties[name] = fn2;
};
return fn2;
};
var withInstallDirective = (directive, name) => {
directive.install = (app) => {
app.directive(name, directive);
};
return directive;
};
var withNoopInstall = (component2) => {
component2.install = NOOP;
return component2;
};
// node_modules/element-plus/es/components/teleport/index.mjs
var ElTeleport = withInstall(_sfc_main);
// node_modules/element-plus/es/utils/easings.mjs
function easeInOutCubic(t, b2, c2, d2) {
const cc = c2 - b2;
t /= d2 / 2;
if (t < 1) {
return cc / 2 * t * t * t + b2;
}
return cc / 2 * ((t -= 2) * t * t + 2) + b2;
}
// node_modules/element-plus/es/utils/raf.mjs
var rAF = (fn2) => isClient ? window.requestAnimationFrame(fn2) : setTimeout(fn2, 16);
var cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
// node_modules/element-plus/es/utils/dom/style.mjs
var SCOPE2 = "utils/dom/style";
var classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
var hasClass = (el, cls) => {
if (!el || !cls) return false;
if (cls.includes(" ")) throw new Error("className should not contain space.");
return el.classList.contains(cls);
};
var addClass = (el, cls) => {
if (!el || !cls.trim()) return;
el.classList.add(...classNameToArray(cls));
};
var removeClass = (el, cls) => {
if (!el || !cls.trim()) return;
el.classList.remove(...classNameToArray(cls));
};
var getStyle = (element, styleName) => {
var _a;
if (!isClient || !element || !styleName) return "";
let key = camelize(styleName);
if (key === "float") key = "cssFloat";
try {
const style = element.style[key];
if (style) return style;
const computed2 = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, "");
return computed2 ? computed2[key] : "";
} catch (e) {
return element.style[key];
}
};
var setStyle = (element, styleName, value) => {
if (!element || !styleName) return;
if (isObject(styleName)) {
entriesOf(styleName).forEach(
([prop, value2]) => setStyle(element, prop, value2)
);
} else {
const key = camelize(styleName);
element.style[key] = value;
}
};
function addUnit(value, defaultUnit = "px") {
if (!value && value !== 0) return "";
if (isNumber(value) || isStringNumber(value)) {
return `${value}${defaultUnit}`;
} else if (isString(value)) {
return value;
}
debugWarn(SCOPE2, "binding value must be a string or number");
}
// node_modules/element-plus/es/utils/dom/scroll.mjs
var isScroll = (el, isVertical) => {
if (!isClient) return false;
const key = {
undefined: "overflow",
true: "overflow-y",
false: "overflow-x"
}[String(isVertical)];
const overflow = getStyle(el, key);
return ["scroll", "auto", "overlay"].some((s2) => overflow.includes(s2));
};
var getScrollContainer = (el, isVertical) => {
if (!isClient) return;
let parent = el;
while (parent) {
if ([window, document, document.documentElement].includes(parent))
return window;
if (isScroll(parent, isVertical)) return parent;
parent = parent.parentNode;
}
return parent;
};
var scrollBarWidth;
var getScrollBarWidth = (namespace) => {
var _a;
if (!isClient) return 0;
if (scrollBarWidth !== void 0) return scrollBarWidth;
const outer = document.createElement("div");
outer.className = `${namespace}-scrollbar__wrap`;
outer.style.visibility = "hidden";
outer.style.width = "100px";
outer.style.position = "absolute";
outer.style.top = "-9999px";
document.body.appendChild(outer);
const widthNoScroll = outer.offsetWidth;
outer.style.overflow = "scroll";
const inner = document.createElement("div");
inner.style.width = "100%";
outer.appendChild(inner);
const widthWithScroll = inner.offsetWidth;
(_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
scrollBarWidth = widthNoScroll - widthWithScroll;
return scrollBarWidth;
};
function scrollIntoView(container, selected) {
if (!isClient) return;
if (!selected) {
container.scrollTop = 0;
return;
}
const offsetParents = [];
let pointer = selected.offsetParent;
while (pointer !== null && container !== pointer && container.contains(pointer)) {
offsetParents.push(pointer);
pointer = pointer.offsetParent;
}
const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
const bottom = top + selected.offsetHeight;
const viewRectTop = container.scrollTop;
const viewRectBottom = viewRectTop + container.clientHeight;
if (top < viewRectTop) {
container.scrollTop = top;
} else if (bottom > viewRectBottom) {
container.scrollTop = bottom - container.clientHeight;
}
}
function animateScrollTo(container, from, to, duration, callback) {
const startTime = Date.now();
let handle;
const scroll = () => {
const timestamp2 = Date.now();
const time = timestamp2 - startTime;
const nextScrollTop = easeInOutCubic(
time > duration ? duration : time,
from,
to,
duration
);
if (isWindow(container)) {
container.scrollTo(window.pageXOffset, nextScrollTop);
} else {
container.scrollTop = nextScrollTop;
}
if (time < duration) {
handle = rAF(scroll);
} else if (isFunction(callback)) {
callback();
}
};
scroll();
return () => {
handle && cAF(handle);
};
}
var getScrollElement = (target2, container) => {
if (isWindow(container)) {
return target2.ownerDocument.documentElement;
}
return container;
};
var getScrollTop = (container) => {
if (isWindow(container)) {
return window.scrollY;
}
return container.scrollTop;
};
// node_modules/element-plus/es/components/affix/src/affix.vue2.mjs
var COMPONENT_NAME = "ElAffix";
var _sfc_main2 = defineComponent({
...{
name: COMPONENT_NAME
},
__name: "affix",
props: affixProps,
emits: affixEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("affix");
const target2 = shallowRef();
const root = shallowRef();
const scrollContainer = shallowRef();
const { height: windowHeight } = useWindowSize();
const {
height: rootHeight,
width: rootWidth,
top: rootTop,
bottom: rootBottom,
left: rootLeft,
update: updateRoot
} = useElementBounding(root, { windowScroll: false });
const targetRect = useElementBounding(target2);
const fixed = ref(false);
const scrollTop = ref(0);
const transform = ref(0);
const teleportDisabled = computed(() => {
return !props2.teleported || !fixed.value;
});
const rootStyle = computed(() => {
return {
height: fixed.value ? `${rootHeight.value}px` : "",
width: fixed.value ? `${rootWidth.value}px` : ""
};
});
const affixStyle = computed(() => {
if (!fixed.value) return {};
const offset3 = addUnit(props2.offset);
return {
height: `${rootHeight.value}px`,
width: `${rootWidth.value}px`,
top: props2.position === "top" ? offset3 : "",
bottom: props2.position === "bottom" ? offset3 : "",
left: props2.teleported ? `${rootLeft.value}px` : "",
transform: transform.value ? `translateY(${transform.value}px)` : "",
zIndex: props2.zIndex
};
});
const update = () => {
if (!scrollContainer.value) return;
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
const { position, target: target22, offset: offset3 } = props2;
const rootHeightOffset = offset3 + rootHeight.value;
if (position === "top") {
if (target22) {
const difference = targetRect.bottom.value - rootHeightOffset;
fixed.value = offset3 > rootTop.value && targetRect.bottom.value > 0;
transform.value = difference < 0 ? difference : 0;
} else {
fixed.value = offset3 > rootTop.value;
}
} else if (target22) {
const difference = windowHeight.value - targetRect.top.value - rootHeightOffset;
fixed.value = windowHeight.value - offset3 < rootBottom.value && windowHeight.value > targetRect.top.value;
transform.value = difference < 0 ? -difference : 0;
} else {
fixed.value = windowHeight.value - offset3 < rootBottom.value;
}
};
const updateRootRect = async () => {
if (!fixed.value) {
updateRoot();
return;
}
fixed.value = false;
await nextTick();
updateRoot();
fixed.value = true;
};
const handleScroll2 = async () => {
updateRoot();
await nextTick();
emit("scroll", {
scrollTop: scrollTop.value,
fixed: fixed.value
});
};
watch(fixed, (val) => emit(CHANGE_EVENT, val));
onMounted(() => {
var _a;
if (props2.target) {
target2.value = (_a = document.querySelector(props2.target)) != null ? _a : void 0;
if (!target2.value)
throwError(COMPONENT_NAME, `Target does not exist: ${props2.target}`);
} else {
target2.value = document.documentElement;
}
scrollContainer.value = getScrollContainer(root.value, true);
updateRoot();
});
onActivated(() => {
nextTick(updateRootRect);
});
onDeactivated(() => {
fixed.value = false;
});
useEventListener(scrollContainer, "scroll", handleScroll2);
watchEffect(update);
__expose({
/** @description update affix status */
update,
/** @description update rootRect info */
updateRoot: updateRootRect
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "root",
ref: root,
class: normalizeClass(unref(ns).b()),
style: normalizeStyle(rootStyle.value)
},
[
createVNode(unref(ElTeleport), {
disabled: teleportDisabled.value,
to: __props.appendTo
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }),
style: normalizeStyle(affixStyle.value)
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "to"])
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/affix/index.mjs
var ElAffix = withInstall(_sfc_main2);
// node_modules/element-plus/es/utils/vue/icon.mjs
var iconPropType = definePropType([
String,
Object,
Function
]);
var CloseComponents = {
Close: close_default
};
var TypeComponents = {
Close: close_default,
SuccessFilled: success_filled_default,
InfoFilled: info_filled_default,
WarningFilled: warning_filled_default,
CircleCloseFilled: circle_close_filled_default
};
var TypeComponentsMap = {
primary: info_filled_default,
success: success_filled_default,
warning: warning_filled_default,
error: circle_close_filled_default,
info: info_filled_default
};
var ValidateComponentsMap = {
validating: loading_default,
success: circle_check_default,
error: circle_close_default
};
// node_modules/element-plus/es/components/alert/src/alert.mjs
var alertEffects = ["light", "dark"];
var alertProps = buildProps({
/**
* @description alert title.
*/
title: {
type: String,
default: ""
},
description: {
type: String,
default: ""
},
/**
* @description alert type.
*/
type: {
type: String,
values: keysOf(TypeComponentsMap),
default: "info"
},
/**
* @description whether alert can be dismissed.
*/
closable: {
type: Boolean,
default: true
},
/**
* @description text for replacing x button
*/
closeText: {
type: String,
default: ""
},
/**
* @description whether show icon
*/
showIcon: Boolean,
/**
* @description should content be placed in center.
*/
center: Boolean,
effect: {
type: String,
values: alertEffects,
default: "light"
}
});
var alertEmits = {
close: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/icon/src/icon.mjs
var iconProps = buildProps({
/**
* @description SVG icon size, size x size
*/
size: {
type: definePropType([Number, String])
},
/**
* @description SVG tag's fill attribute
*/
color: {
type: String
}
});
// node_modules/element-plus/es/components/icon/src/icon.vue2.mjs
var _sfc_main3 = defineComponent({
...{
name: "ElIcon",
inheritAttrs: false
},
__name: "icon",
props: iconProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("icon");
const style = computed(() => {
const { size: size2, color } = props2;
const fontSize = addUnit(size2);
if (!fontSize && !color) return {};
return {
fontSize,
"--color": color
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"i",
mergeProps({
class: unref(ns).b(),
style: style.value
}, _ctx.$attrs),
[
renderSlot(_ctx.$slots, "default")
],
16
/* FULL_PROPS */
);
};
}
});
// node_modules/element-plus/es/components/icon/index.mjs
var ElIcon = withInstall(_sfc_main3);
// node_modules/element-plus/es/utils/vue/vnode.mjs
var SCOPE3 = "utils/vue/vnode";
var PatchFlags = ((PatchFlags2) => {
PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
return PatchFlags2;
})(PatchFlags || {});
function isFragment(node) {
return isVNode(node) && node.type === Fragment;
}
function isComment(node) {
return isVNode(node) && node.type === Comment;
}
function isValidElementNode(node) {
return isVNode(node) && !isFragment(node) && !isComment(node);
}
var getNormalizedProps = (node) => {
if (!isVNode(node)) {
debugWarn(SCOPE3, "[getNormalizedProps] must be a VNode");
return {};
}
const raw = node.props || {};
const type = (isVNode(node.type) ? node.type.props : void 0) || {};
const props2 = {};
Object.keys(type).forEach((key) => {
if (hasOwn(type[key], "default")) {
props2[key] = type[key].default;
}
});
Object.keys(raw).forEach((key) => {
props2[camelize(key)] = raw[key];
});
return props2;
};
var flattedChildren = (children) => {
const vNodes = isArray(children) ? children : [children];
const result = [];
vNodes.forEach((child) => {
var _a;
if (isArray(child)) {
result.push(...flattedChildren(child));
} else if (isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) {
result.push(child, ...flattedChildren(child.component.subTree));
} else if (isVNode(child) && isArray(child.children)) {
result.push(...flattedChildren(child.children));
} else if (isVNode(child) && child.shapeFlag === 2) {
result.push(...flattedChildren(child.type()));
} else {
result.push(child);
}
});
return result;
};
// node_modules/element-plus/es/components/alert/src/alert.vue2.mjs
var _sfc_main4 = defineComponent({
...{
name: "ElAlert"
},
__name: "alert",
props: alertProps,
emits: alertEmits,
setup(__props, { emit: __emit }) {
const { Close } = TypeComponents;
const props2 = __props;
const emit = __emit;
const slots = useSlots();
const ns = useNamespace("alert");
const visible = ref(true);
const iconComponent = computed(() => TypeComponentsMap[props2.type]);
const hasDesc = computed(() => {
var _a;
if (props2.description) return true;
const slotContent = (_a = slots.default) == null ? void 0 : _a.call(slots);
if (!slotContent) return false;
const children = flattedChildren(slotContent);
return children.some((child) => !isComment(child));
});
const close2 = (evt) => {
visible.value = false;
emit("close", evt);
};
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, {
name: unref(ns).b("fade"),
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).b(), unref(ns).m(__props.type), unref(ns).is("center", __props.center), unref(ns).is(__props.effect)]),
role: "alert"
},
[
__props.showIcon && (_ctx.$slots.icon || iconComponent.value) ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([unref(ns).e("icon"), unref(ns).is("big", hasDesc.value)])
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "icon", {}, () => [
(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))
])
]),
_: 3
/* FORWARDED */
}, 8, ["class"])) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("content"))
},
[
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass([unref(ns).e("title"), { "with-description": hasDesc.value }])
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
hasDesc.value ? (openBlock(), createElementBlock(
"p",
{
key: 1,
class: normalizeClass(unref(ns).e("description"))
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.description),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
__props.closable ? (openBlock(), createElementBlock(
Fragment,
{ key: 2 },
[
__props.closeText ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass([unref(ns).e("close-btn"), unref(ns).is("customed")]),
onClick: close2
},
toDisplayString(__props.closeText),
3
/* TEXT, CLASS */
)) : (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass(unref(ns).e("close-btn")),
onClick: close2
}, {
default: withCtx(() => [
createVNode(unref(Close))
]),
_: 1
/* STABLE */
}, 8, ["class"]))
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
), [
[vShow, visible.value]
])
]),
_: 3
/* FORWARDED */
}, 8, ["name"]);
};
}
});
// node_modules/element-plus/es/components/alert/index.mjs
var ElAlert = withInstall(_sfc_main4);
// node_modules/@popperjs/core/dist/index.mjs
var L = "top";
var W = "bottom";
var T = "right";
var P = "left";
var me = "auto";
var Q = [L, W, T, P];
var Y = "start";
var Z = "end";
var Ye = "clippingParents";
var je = "viewport";
var ee = "popper";
var Ge = "reference";
var De = Q.reduce(function(e, t) {
return e.concat([t + "-" + Y, t + "-" + Z]);
}, []);
var Ee = [].concat(Q, [me]).reduce(function(e, t) {
return e.concat([t, t + "-" + Y, t + "-" + Z]);
}, []);
var Je = "beforeRead";
var Ke = "read";
var Qe = "afterRead";
var Ze = "beforeMain";
var et = "main";
var tt = "afterMain";
var nt = "beforeWrite";
var rt = "write";
var ot = "afterWrite";
var it = [Je, Ke, Qe, Ze, et, tt, nt, rt, ot];
function V(e) {
return e ? (e.nodeName || "").toLowerCase() : null;
}
function B(e) {
if (e == null) return window;
if (e.toString() !== "[object Window]") {
var t = e.ownerDocument;
return t && t.defaultView || window;
}
return e;
}
function G(e) {
var t = B(e).Element;
return e instanceof t || e instanceof Element;
}
function R(e) {
var t = B(e).HTMLElement;
return e instanceof t || e instanceof HTMLElement;
}
function Ae(e) {
if (typeof ShadowRoot == "undefined") return false;
var t = B(e).ShadowRoot;
return e instanceof t || e instanceof ShadowRoot;
}
function Tt(e) {
var t = e.state;
Object.keys(t.elements).forEach(function(n) {
var r = t.styles[n] || {}, o2 = t.attributes[n] || {}, a2 = t.elements[n];
!R(a2) || !V(a2) || (Object.assign(a2.style, r), Object.keys(o2).forEach(function(c2) {
var s2 = o2[c2];
s2 === false ? a2.removeAttribute(c2) : a2.setAttribute(c2, s2 === true ? "" : s2);
}));
});
}
function Bt(e) {
var t = e.state, n = { popper: { position: t.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
Object.keys(t.elements).forEach(function(r) {
var o2 = t.elements[r], a2 = t.attributes[r] || {}, c2 = Object.keys(t.styles.hasOwnProperty(r) ? t.styles[r] : n[r]), s2 = c2.reduce(function(i, f2) {
return i[f2] = "", i;
}, {});
!R(o2) || !V(o2) || (Object.assign(o2.style, s2), Object.keys(a2).forEach(function(i) {
o2.removeAttribute(i);
}));
});
};
}
var ke = { name: "applyStyles", enabled: true, phase: "write", fn: Tt, effect: Bt, requires: ["computeStyles"] };
function C(e) {
return e.split("-")[0];
}
var J = Math.max;
var ve = Math.min;
var te = Math.round;
function Le() {
var e = navigator.userAgentData;
return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
return t.brand + "/" + t.version;
}).join(" ") : navigator.userAgent;
}
function at() {
return !/^((?!chrome|android).)*safari/i.test(Le());
}
function ne(e, t, n) {
t === void 0 && (t = false), n === void 0 && (n = false);
var r = e.getBoundingClientRect(), o2 = 1, a2 = 1;
t && R(e) && (o2 = e.offsetWidth > 0 && te(r.width) / e.offsetWidth || 1, a2 = e.offsetHeight > 0 && te(r.height) / e.offsetHeight || 1);
var c2 = G(e) ? B(e) : window, s2 = c2.visualViewport, i = !at() && n, f2 = (r.left + (i && s2 ? s2.offsetLeft : 0)) / o2, u2 = (r.top + (i && s2 ? s2.offsetTop : 0)) / a2, m2 = r.width / o2, h3 = r.height / a2;
return { width: m2, height: h3, top: u2, right: f2 + m2, bottom: u2 + h3, left: f2, x: f2, y: u2 };
}
function Pe(e) {
var t = ne(e), n = e.offsetWidth, r = e.offsetHeight;
return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - r) <= 1 && (r = t.height), { x: e.offsetLeft, y: e.offsetTop, width: n, height: r };
}
function st(e, t) {
var n = t.getRootNode && t.getRootNode();
if (e.contains(t)) return true;
if (n && Ae(n)) {
var r = t;
do {
if (r && e.isSameNode(r)) return true;
r = r.parentNode || r.host;
} while (r);
}
return false;
}
function I(e) {
return B(e).getComputedStyle(e);
}
function Rt(e) {
return ["table", "td", "th"].indexOf(V(e)) >= 0;
}
function N(e) {
return ((G(e) ? e.ownerDocument : e.document) || window.document).documentElement;
}
function ye(e) {
return V(e) === "html" ? e : e.assignedSlot || e.parentNode || (Ae(e) ? e.host : null) || N(e);
}
function ft(e) {
return !R(e) || I(e).position === "fixed" ? null : e.offsetParent;
}
function Ht(e) {
var t = /firefox/i.test(Le()), n = /Trident/i.test(Le());
if (n && R(e)) {
var r = I(e);
if (r.position === "fixed") return null;
}
var o2 = ye(e);
for (Ae(o2) && (o2 = o2.host); R(o2) && ["html", "body"].indexOf(V(o2)) < 0; ) {
var a2 = I(o2);
if (a2.transform !== "none" || a2.perspective !== "none" || a2.contain === "paint" || ["transform", "perspective"].indexOf(a2.willChange) !== -1 || t && a2.willChange === "filter" || t && a2.filter && a2.filter !== "none") return o2;
o2 = o2.parentNode;
}
return null;
}
function se(e) {
for (var t = B(e), n = ft(e); n && Rt(n) && I(n).position === "static"; ) n = ft(n);
return n && (V(n) === "html" || V(n) === "body" && I(n).position === "static") ? t : n || Ht(e) || t;
}
function Me(e) {
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function fe(e, t, n) {
return J(e, ve(t, n));
}
function St(e, t, n) {
var r = fe(e, t, n);
return r > n ? n : r;
}
function ct() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function ut(e) {
return Object.assign({}, ct(), e);
}
function pt(e, t) {
return t.reduce(function(n, r) {
return n[r] = e, n;
}, {});
}
var Vt = function(e, t) {
return e = typeof e == "function" ? e(Object.assign({}, t.rects, { placement: t.placement })) : e, ut(typeof e != "number" ? e : pt(e, Q));
};
function Ct(e) {
var t, n = e.state, r = e.name, o2 = e.options, a2 = n.elements.arrow, c2 = n.modifiersData.popperOffsets, s2 = C(n.placement), i = Me(s2), f2 = [P, T].indexOf(s2) >= 0, u2 = f2 ? "height" : "width";
if (!(!a2 || !c2)) {
var m2 = Vt(o2.padding, n), h3 = Pe(a2), l2 = i === "y" ? L : P, g = i === "y" ? W : T, p2 = n.rects.reference[u2] + n.rects.reference[i] - c2[i] - n.rects.popper[u2], y = c2[i] - n.rects.reference[i], b2 = se(a2), x2 = b2 ? i === "y" ? b2.clientHeight || 0 : b2.clientWidth || 0 : 0, O2 = p2 / 2 - y / 2, d2 = m2[l2], v2 = x2 - h3[u2] - m2[g], w2 = x2 / 2 - h3[u2] / 2 + O2, $ = fe(d2, w2, v2), j = i;
n.modifiersData[r] = (t = {}, t[j] = $, t.centerOffset = $ - w2, t);
}
}
function qt(e) {
var t = e.state, n = e.options, r = n.element, o2 = r === void 0 ? "[data-popper-arrow]" : r;
o2 != null && (typeof o2 == "string" && (o2 = t.elements.popper.querySelector(o2), !o2) || st(t.elements.popper, o2) && (t.elements.arrow = o2));
}
var lt = { name: "arrow", enabled: true, phase: "main", fn: Ct, effect: qt, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function re(e) {
return e.split("-")[1];
}
var It = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function Nt(e, t) {
var n = e.x, r = e.y, o2 = t.devicePixelRatio || 1;
return { x: te(n * o2) / o2 || 0, y: te(r * o2) / o2 || 0 };
}
function dt(e) {
var t, n = e.popper, r = e.popperRect, o2 = e.placement, a2 = e.variation, c2 = e.offsets, s2 = e.position, i = e.gpuAcceleration, f2 = e.adaptive, u2 = e.roundOffsets, m2 = e.isFixed, h3 = c2.x, l2 = h3 === void 0 ? 0 : h3, g = c2.y, p2 = g === void 0 ? 0 : g, y = typeof u2 == "function" ? u2({ x: l2, y: p2 }) : { x: l2, y: p2 };
l2 = y.x, p2 = y.y;
var b2 = c2.hasOwnProperty("x"), x2 = c2.hasOwnProperty("y"), O2 = P, d2 = L, v2 = window;
if (f2) {
var w2 = se(n), $ = "clientHeight", j = "clientWidth";
if (w2 === B(n) && (w2 = N(n), I(w2).position !== "static" && s2 === "absolute" && ($ = "scrollHeight", j = "scrollWidth")), w2 = w2, o2 === L || (o2 === P || o2 === T) && a2 === Z) {
d2 = W;
var D2 = m2 && w2 === v2 && v2.visualViewport ? v2.visualViewport.height : w2[$];
p2 -= D2 - r.height, p2 *= i ? 1 : -1;
}
if (o2 === P || (o2 === L || o2 === W) && a2 === Z) {
O2 = T;
var E2 = m2 && w2 === v2 && v2.visualViewport ? v2.visualViewport.width : w2[j];
l2 -= E2 - r.width, l2 *= i ? 1 : -1;
}
}
var A2 = Object.assign({ position: s2 }, f2 && It), H = u2 === true ? Nt({ x: l2, y: p2 }, B(n)) : { x: l2, y: p2 };
if (l2 = H.x, p2 = H.y, i) {
var k;
return Object.assign({}, A2, (k = {}, k[d2] = x2 ? "0" : "", k[O2] = b2 ? "0" : "", k.transform = (v2.devicePixelRatio || 1) <= 1 ? "translate(" + l2 + "px, " + p2 + "px)" : "translate3d(" + l2 + "px, " + p2 + "px, 0)", k));
}
return Object.assign({}, A2, (t = {}, t[d2] = x2 ? p2 + "px" : "", t[O2] = b2 ? l2 + "px" : "", t.transform = "", t));
}
function Ft(e) {
var t = e.state, n = e.options, r = n.gpuAcceleration, o2 = r === void 0 ? true : r, a2 = n.adaptive, c2 = a2 === void 0 ? true : a2, s2 = n.roundOffsets, i = s2 === void 0 ? true : s2, f2 = { placement: C(t.placement), variation: re(t.placement), popper: t.elements.popper, popperRect: t.rects.popper, gpuAcceleration: o2, isFixed: t.options.strategy === "fixed" };
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, dt(Object.assign({}, f2, { offsets: t.modifiersData.popperOffsets, position: t.options.strategy, adaptive: c2, roundOffsets: i })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, dt(Object.assign({}, f2, { offsets: t.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: i })))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement });
}
var We = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: Ft, data: {} };
var ge = { passive: true };
function Ut(e) {
var t = e.state, n = e.instance, r = e.options, o2 = r.scroll, a2 = o2 === void 0 ? true : o2, c2 = r.resize, s2 = c2 === void 0 ? true : c2, i = B(t.elements.popper), f2 = [].concat(t.scrollParents.reference, t.scrollParents.popper);
return a2 && f2.forEach(function(u2) {
u2.addEventListener("scroll", n.update, ge);
}), s2 && i.addEventListener("resize", n.update, ge), function() {
a2 && f2.forEach(function(u2) {
u2.removeEventListener("scroll", n.update, ge);
}), s2 && i.removeEventListener("resize", n.update, ge);
};
}
var Te = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
}, effect: Ut, data: {} };
var _t = { left: "right", right: "left", bottom: "top", top: "bottom" };
function be(e) {
return e.replace(/left|right|bottom|top/g, function(t) {
return _t[t];
});
}
var zt = { start: "end", end: "start" };
function ht(e) {
return e.replace(/start|end/g, function(t) {
return zt[t];
});
}
function Be(e) {
var t = B(e), n = t.pageXOffset, r = t.pageYOffset;
return { scrollLeft: n, scrollTop: r };
}
function Re(e) {
return ne(N(e)).left + Be(e).scrollLeft;
}
function Xt(e, t) {
var n = B(e), r = N(e), o2 = n.visualViewport, a2 = r.clientWidth, c2 = r.clientHeight, s2 = 0, i = 0;
if (o2) {
a2 = o2.width, c2 = o2.height;
var f2 = at();
(f2 || !f2 && t === "fixed") && (s2 = o2.offsetLeft, i = o2.offsetTop);
}
return { width: a2, height: c2, x: s2 + Re(e), y: i };
}
function Yt(e) {
var t, n = N(e), r = Be(e), o2 = (t = e.ownerDocument) == null ? void 0 : t.body, a2 = J(n.scrollWidth, n.clientWidth, o2 ? o2.scrollWidth : 0, o2 ? o2.clientWidth : 0), c2 = J(n.scrollHeight, n.clientHeight, o2 ? o2.scrollHeight : 0, o2 ? o2.clientHeight : 0), s2 = -r.scrollLeft + Re(e), i = -r.scrollTop;
return I(o2 || n).direction === "rtl" && (s2 += J(n.clientWidth, o2 ? o2.clientWidth : 0) - a2), { width: a2, height: c2, x: s2, y: i };
}
function He(e) {
var t = I(e), n = t.overflow, r = t.overflowX, o2 = t.overflowY;
return /auto|scroll|overlay|hidden/.test(n + o2 + r);
}
function mt(e) {
return ["html", "body", "#document"].indexOf(V(e)) >= 0 ? e.ownerDocument.body : R(e) && He(e) ? e : mt(ye(e));
}
function ce(e, t) {
var n;
t === void 0 && (t = []);
var r = mt(e), o2 = r === ((n = e.ownerDocument) == null ? void 0 : n.body), a2 = B(r), c2 = o2 ? [a2].concat(a2.visualViewport || [], He(r) ? r : []) : r, s2 = t.concat(c2);
return o2 ? s2 : s2.concat(ce(ye(c2)));
}
function Se(e) {
return Object.assign({}, e, { left: e.x, top: e.y, right: e.x + e.width, bottom: e.y + e.height });
}
function Gt(e, t) {
var n = ne(e, false, t === "fixed");
return n.top = n.top + e.clientTop, n.left = n.left + e.clientLeft, n.bottom = n.top + e.clientHeight, n.right = n.left + e.clientWidth, n.width = e.clientWidth, n.height = e.clientHeight, n.x = n.left, n.y = n.top, n;
}
function vt(e, t, n) {
return t === je ? Se(Xt(e, n)) : G(t) ? Gt(t, n) : Se(Yt(N(e)));
}
function Jt(e) {
var t = ce(ye(e)), n = ["absolute", "fixed"].indexOf(I(e).position) >= 0, r = n && R(e) ? se(e) : e;
return G(r) ? t.filter(function(o2) {
return G(o2) && st(o2, r) && V(o2) !== "body";
}) : [];
}
function Kt(e, t, n, r) {
var o2 = t === "clippingParents" ? Jt(e) : [].concat(t), a2 = [].concat(o2, [n]), c2 = a2[0], s2 = a2.reduce(function(i, f2) {
var u2 = vt(e, f2, r);
return i.top = J(u2.top, i.top), i.right = ve(u2.right, i.right), i.bottom = ve(u2.bottom, i.bottom), i.left = J(u2.left, i.left), i;
}, vt(e, c2, r));
return s2.width = s2.right - s2.left, s2.height = s2.bottom - s2.top, s2.x = s2.left, s2.y = s2.top, s2;
}
function yt(e) {
var t = e.reference, n = e.element, r = e.placement, o2 = r ? C(r) : null, a2 = r ? re(r) : null, c2 = t.x + t.width / 2 - n.width / 2, s2 = t.y + t.height / 2 - n.height / 2, i;
switch (o2) {
case L:
i = { x: c2, y: t.y - n.height };
break;
case W:
i = { x: c2, y: t.y + t.height };
break;
case T:
i = { x: t.x + t.width, y: s2 };
break;
case P:
i = { x: t.x - n.width, y: s2 };
break;
default:
i = { x: t.x, y: t.y };
}
var f2 = o2 ? Me(o2) : null;
if (f2 != null) {
var u2 = f2 === "y" ? "height" : "width";
switch (a2) {
case Y:
i[f2] = i[f2] - (t[u2] / 2 - n[u2] / 2);
break;
case Z:
i[f2] = i[f2] + (t[u2] / 2 - n[u2] / 2);
break;
}
}
return i;
}
function oe(e, t) {
t === void 0 && (t = {});
var n = t, r = n.placement, o2 = r === void 0 ? e.placement : r, a2 = n.strategy, c2 = a2 === void 0 ? e.strategy : a2, s2 = n.boundary, i = s2 === void 0 ? Ye : s2, f2 = n.rootBoundary, u2 = f2 === void 0 ? je : f2, m2 = n.elementContext, h3 = m2 === void 0 ? ee : m2, l2 = n.altBoundary, g = l2 === void 0 ? false : l2, p2 = n.padding, y = p2 === void 0 ? 0 : p2, b2 = ut(typeof y != "number" ? y : pt(y, Q)), x2 = h3 === ee ? Ge : ee, O2 = e.rects.popper, d2 = e.elements[g ? x2 : h3], v2 = Kt(G(d2) ? d2 : d2.contextElement || N(e.elements.popper), i, u2, c2), w2 = ne(e.elements.reference), $ = yt({ reference: w2, element: O2, placement: o2 }), j = Se(Object.assign({}, O2, $)), D2 = h3 === ee ? j : w2, E2 = { top: v2.top - D2.top + b2.top, bottom: D2.bottom - v2.bottom + b2.bottom, left: v2.left - D2.left + b2.left, right: D2.right - v2.right + b2.right }, A2 = e.modifiersData.offset;
if (h3 === ee && A2) {
var H = A2[o2];
Object.keys(E2).forEach(function(k) {
var F2 = [T, W].indexOf(k) >= 0 ? 1 : -1, U2 = [L, W].indexOf(k) >= 0 ? "y" : "x";
E2[k] += H[U2] * F2;
});
}
return E2;
}
function Qt(e, t) {
t === void 0 && (t = {});
var n = t, r = n.placement, o2 = n.boundary, a2 = n.rootBoundary, c2 = n.padding, s2 = n.flipVariations, i = n.allowedAutoPlacements, f2 = i === void 0 ? Ee : i, u2 = re(r), m2 = u2 ? s2 ? De : De.filter(function(g) {
return re(g) === u2;
}) : Q, h3 = m2.filter(function(g) {
return f2.indexOf(g) >= 0;
});
h3.length === 0 && (h3 = m2);
var l2 = h3.reduce(function(g, p2) {
return g[p2] = oe(e, { placement: p2, boundary: o2, rootBoundary: a2, padding: c2 })[C(p2)], g;
}, {});
return Object.keys(l2).sort(function(g, p2) {
return l2[g] - l2[p2];
});
}
function Zt(e) {
if (C(e) === me) return [];
var t = be(e);
return [ht(e), t, ht(t)];
}
function en(e) {
var t = e.state, n = e.options, r = e.name;
if (!t.modifiersData[r]._skip) {
for (var o2 = n.mainAxis, a2 = o2 === void 0 ? true : o2, c2 = n.altAxis, s2 = c2 === void 0 ? true : c2, i = n.fallbackPlacements, f2 = n.padding, u2 = n.boundary, m2 = n.rootBoundary, h3 = n.altBoundary, l2 = n.flipVariations, g = l2 === void 0 ? true : l2, p2 = n.allowedAutoPlacements, y = t.options.placement, b2 = C(y), x2 = b2 === y, O2 = i || (x2 || !g ? [be(y)] : Zt(y)), d2 = [y].concat(O2).reduce(function(z, q) {
return z.concat(C(q) === me ? Qt(t, { placement: q, boundary: u2, rootBoundary: m2, padding: f2, flipVariations: g, allowedAutoPlacements: p2 }) : q);
}, []), v2 = t.rects.reference, w2 = t.rects.popper, $ = /* @__PURE__ */ new Map(), j = true, D2 = d2[0], E2 = 0; E2 < d2.length; E2++) {
var A2 = d2[E2], H = C(A2), k = re(A2) === Y, F2 = [L, W].indexOf(H) >= 0, U2 = F2 ? "width" : "height", M2 = oe(t, { placement: A2, boundary: u2, rootBoundary: m2, altBoundary: h3, padding: f2 }), S2 = F2 ? k ? T : P : k ? W : L;
v2[U2] > w2[U2] && (S2 = be(S2));
var ue = be(S2), _2 = [];
if (a2 && _2.push(M2[H] <= 0), s2 && _2.push(M2[S2] <= 0, M2[ue] <= 0), _2.every(function(z) {
return z;
})) {
D2 = A2, j = false;
break;
}
$.set(A2, _2);
}
if (j) for (var pe = g ? 3 : 1, xe = function(z) {
var q = d2.find(function(de) {
var ae = $.get(de);
if (ae) return ae.slice(0, z).every(function(K) {
return K;
});
});
if (q) return D2 = q, "break";
}, ie = pe; ie > 0; ie--) {
var le = xe(ie);
if (le === "break") break;
}
t.placement !== D2 && (t.modifiersData[r]._skip = true, t.placement = D2, t.reset = true);
}
}
var gt = { name: "flip", enabled: true, phase: "main", fn: en, requiresIfExists: ["offset"], data: { _skip: false } };
function bt(e, t, n) {
return n === void 0 && (n = { x: 0, y: 0 }), { top: e.top - t.height - n.y, right: e.right - t.width + n.x, bottom: e.bottom - t.height + n.y, left: e.left - t.width - n.x };
}
function wt(e) {
return [L, T, W, P].some(function(t) {
return e[t] >= 0;
});
}
function tn(e) {
var t = e.state, n = e.name, r = t.rects.reference, o2 = t.rects.popper, a2 = t.modifiersData.preventOverflow, c2 = oe(t, { elementContext: "reference" }), s2 = oe(t, { altBoundary: true }), i = bt(c2, r), f2 = bt(s2, o2, a2), u2 = wt(i), m2 = wt(f2);
t.modifiersData[n] = { referenceClippingOffsets: i, popperEscapeOffsets: f2, isReferenceHidden: u2, hasPopperEscaped: m2 }, t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-reference-hidden": u2, "data-popper-escaped": m2 });
}
var xt = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: tn };
function nn(e, t, n) {
var r = C(e), o2 = [P, L].indexOf(r) >= 0 ? -1 : 1, a2 = typeof n == "function" ? n(Object.assign({}, t, { placement: e })) : n, c2 = a2[0], s2 = a2[1];
return c2 = c2 || 0, s2 = (s2 || 0) * o2, [P, T].indexOf(r) >= 0 ? { x: s2, y: c2 } : { x: c2, y: s2 };
}
function rn(e) {
var t = e.state, n = e.options, r = e.name, o2 = n.offset, a2 = o2 === void 0 ? [0, 0] : o2, c2 = Ee.reduce(function(u2, m2) {
return u2[m2] = nn(m2, t.rects, a2), u2;
}, {}), s2 = c2[t.placement], i = s2.x, f2 = s2.y;
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += i, t.modifiersData.popperOffsets.y += f2), t.modifiersData[r] = c2;
}
var Ot = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: rn };
function on(e) {
var t = e.state, n = e.name;
t.modifiersData[n] = yt({ reference: t.rects.reference, element: t.rects.popper, placement: t.placement });
}
var Ve = { name: "popperOffsets", enabled: true, phase: "read", fn: on, data: {} };
function an(e) {
return e === "x" ? "y" : "x";
}
function sn(e) {
var t = e.state, n = e.options, r = e.name, o2 = n.mainAxis, a2 = o2 === void 0 ? true : o2, c2 = n.altAxis, s2 = c2 === void 0 ? false : c2, i = n.boundary, f2 = n.rootBoundary, u2 = n.altBoundary, m2 = n.padding, h3 = n.tether, l2 = h3 === void 0 ? true : h3, g = n.tetherOffset, p2 = g === void 0 ? 0 : g, y = oe(t, { boundary: i, rootBoundary: f2, padding: m2, altBoundary: u2 }), b2 = C(t.placement), x2 = re(t.placement), O2 = !x2, d2 = Me(b2), v2 = an(d2), w2 = t.modifiersData.popperOffsets, $ = t.rects.reference, j = t.rects.popper, D2 = typeof p2 == "function" ? p2(Object.assign({}, t.rects, { placement: t.placement })) : p2, E2 = typeof D2 == "number" ? { mainAxis: D2, altAxis: D2 } : Object.assign({ mainAxis: 0, altAxis: 0 }, D2), A2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, H = { x: 0, y: 0 };
if (w2) {
if (a2) {
var k, F2 = d2 === "y" ? L : P, U2 = d2 === "y" ? W : T, M2 = d2 === "y" ? "height" : "width", S2 = w2[d2], ue = S2 + y[F2], _2 = S2 - y[U2], pe = l2 ? -j[M2] / 2 : 0, xe = x2 === Y ? $[M2] : j[M2], ie = x2 === Y ? -j[M2] : -$[M2], le = t.elements.arrow, z = l2 && le ? Pe(le) : { width: 0, height: 0 }, q = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ct(), de = q[F2], ae = q[U2], K = fe(0, $[M2], z[M2]), Et = O2 ? $[M2] / 2 - pe - K - de - E2.mainAxis : xe - K - de - E2.mainAxis, At = O2 ? -$[M2] / 2 + pe + K + ae + E2.mainAxis : ie + K + ae + E2.mainAxis, Oe = t.elements.arrow && se(t.elements.arrow), kt = Oe ? d2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (k = A2 == null ? void 0 : A2[d2]) != null ? k : 0, Lt = S2 + Et - Ce - kt, Pt = S2 + At - Ce, qe = fe(l2 ? ve(ue, Lt) : ue, S2, l2 ? J(_2, Pt) : _2);
w2[d2] = qe, H[d2] = qe - S2;
}
if (s2) {
var Ie, Mt = d2 === "x" ? L : P, Wt = d2 === "x" ? W : T, X2 = w2[v2], he = v2 === "y" ? "height" : "width", Ne = X2 + y[Mt], Fe = X2 - y[Wt], $e = [L, P].indexOf(b2) !== -1, Ue = (Ie = A2 == null ? void 0 : A2[v2]) != null ? Ie : 0, _e = $e ? Ne : X2 - $[he] - j[he] - Ue + E2.altAxis, ze = $e ? X2 + $[he] + j[he] - Ue - E2.altAxis : Fe, Xe = l2 && $e ? St(_e, X2, ze) : fe(l2 ? _e : Ne, X2, l2 ? ze : Fe);
w2[v2] = Xe, H[v2] = Xe - X2;
}
t.modifiersData[r] = H;
}
}
var $t = { name: "preventOverflow", enabled: true, phase: "main", fn: sn, requiresIfExists: ["offset"] };
function fn(e) {
return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop };
}
function cn(e) {
return e === B(e) || !R(e) ? Be(e) : fn(e);
}
function un(e) {
var t = e.getBoundingClientRect(), n = te(t.width) / e.offsetWidth || 1, r = te(t.height) / e.offsetHeight || 1;
return n !== 1 || r !== 1;
}
function pn(e, t, n) {
n === void 0 && (n = false);
var r = R(t), o2 = R(t) && un(t), a2 = N(t), c2 = ne(e, o2, n), s2 = { scrollLeft: 0, scrollTop: 0 }, i = { x: 0, y: 0 };
return (r || !r && !n) && ((V(t) !== "body" || He(a2)) && (s2 = cn(t)), R(t) ? (i = ne(t, true), i.x += t.clientLeft, i.y += t.clientTop) : a2 && (i.x = Re(a2))), { x: c2.left + s2.scrollLeft - i.x, y: c2.top + s2.scrollTop - i.y, width: c2.width, height: c2.height };
}
function ln(e) {
var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
e.forEach(function(a2) {
t.set(a2.name, a2);
});
function o2(a2) {
n.add(a2.name);
var c2 = [].concat(a2.requires || [], a2.requiresIfExists || []);
c2.forEach(function(s2) {
if (!n.has(s2)) {
var i = t.get(s2);
i && o2(i);
}
}), r.push(a2);
}
return e.forEach(function(a2) {
n.has(a2.name) || o2(a2);
}), r;
}
function dn(e) {
var t = ln(e);
return it.reduce(function(n, r) {
return n.concat(t.filter(function(o2) {
return o2.phase === r;
}));
}, []);
}
function hn(e) {
var t;
return function() {
return t || (t = new Promise(function(n) {
Promise.resolve().then(function() {
t = void 0, n(e());
});
})), t;
};
}
function mn(e) {
var t = e.reduce(function(n, r) {
var o2 = n[r.name];
return n[r.name] = o2 ? Object.assign({}, o2, r, { options: Object.assign({}, o2.options, r.options), data: Object.assign({}, o2.data, r.data) }) : r, n;
}, {});
return Object.keys(t).map(function(n) {
return t[n];
});
}
var jt = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Dt() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n];
return !t.some(function(r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function we(e) {
e === void 0 && (e = {});
var t = e, n = t.defaultModifiers, r = n === void 0 ? [] : n, o2 = t.defaultOptions, a2 = o2 === void 0 ? jt : o2;
return function(c2, s2, i) {
i === void 0 && (i = a2);
var f2 = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, jt, a2), modifiersData: {}, elements: { reference: c2, popper: s2 }, attributes: {}, styles: {} }, u2 = [], m2 = false, h3 = { state: f2, setOptions: function(p2) {
var y = typeof p2 == "function" ? p2(f2.options) : p2;
g(), f2.options = Object.assign({}, a2, f2.options, y), f2.scrollParents = { reference: G(c2) ? ce(c2) : c2.contextElement ? ce(c2.contextElement) : [], popper: ce(s2) };
var b2 = dn(mn([].concat(r, f2.options.modifiers)));
return f2.orderedModifiers = b2.filter(function(x2) {
return x2.enabled;
}), l2(), h3.update();
}, forceUpdate: function() {
if (!m2) {
var p2 = f2.elements, y = p2.reference, b2 = p2.popper;
if (Dt(y, b2)) {
f2.rects = { reference: pn(y, se(b2), f2.options.strategy === "fixed"), popper: Pe(b2) }, f2.reset = false, f2.placement = f2.options.placement, f2.orderedModifiers.forEach(function(j) {
return f2.modifiersData[j.name] = Object.assign({}, j.data);
});
for (var x2 = 0; x2 < f2.orderedModifiers.length; x2++) {
if (f2.reset === true) {
f2.reset = false, x2 = -1;
continue;
}
var O2 = f2.orderedModifiers[x2], d2 = O2.fn, v2 = O2.options, w2 = v2 === void 0 ? {} : v2, $ = O2.name;
typeof d2 == "function" && (f2 = d2({ state: f2, options: w2, name: $, instance: h3 }) || f2);
}
}
}
}, update: hn(function() {
return new Promise(function(p2) {
h3.forceUpdate(), p2(f2);
});
}), destroy: function() {
g(), m2 = true;
} };
if (!Dt(c2, s2)) return h3;
h3.setOptions(i).then(function(p2) {
!m2 && i.onFirstUpdate && i.onFirstUpdate(p2);
});
function l2() {
f2.orderedModifiers.forEach(function(p2) {
var y = p2.name, b2 = p2.options, x2 = b2 === void 0 ? {} : b2, O2 = p2.effect;
if (typeof O2 == "function") {
var d2 = O2({ state: f2, name: y, instance: h3, options: x2 }), v2 = function() {
};
u2.push(d2 || v2);
}
});
}
function g() {
u2.forEach(function(p2) {
return p2();
}), u2 = [];
}
return h3;
};
}
var vn = we();
var yn = [Te, Ve, We, ke];
var gn = we({ defaultModifiers: yn });
var bn = [Te, Ve, We, ke, Ot, gt, $t, lt, xt];
var wn = we({ defaultModifiers: bn });
// node_modules/element-plus/es/components/popper/src/arrow.mjs
var popperArrowProps = buildProps({
arrowOffset: {
type: Number,
default: 5
}
});
var popperArrowPropsDefaults = {
arrowOffset: 5
};
var usePopperArrowProps = popperArrowProps;
// node_modules/element-plus/es/hooks/use-aria/index.mjs
var ariaProps = buildProps({
/**
* @description native `aria-label` attribute
*/
ariaLabel: String,
/**
* @description native `aria-orientation` attribute
*/
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
/**
* @description native `aria-controls` attribute
*/
ariaControls: String
});
var useAriaProps = (arias) => {
return pick_default(ariaProps, arias);
};
// node_modules/element-plus/es/components/popper/src/content.mjs
var POSITIONING_STRATEGIES = ["fixed", "absolute"];
var popperCoreConfigProps = buildProps({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: definePropType(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: true
},
/**
* @description offset of the Tooltip
*/
offset: {
type: Number,
default: 12
},
/**
* @description position of Tooltip
*/
placement: {
type: String,
values: Ee,
default: "bottom"
},
/**
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
*/
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
strategy: {
type: String,
values: POSITIONING_STRATEGIES,
default: "absolute"
}
});
var popperContentProps = buildProps({
...popperCoreConfigProps,
...popperArrowProps,
id: String,
style: {
type: definePropType([String, Array, Object])
},
className: {
type: definePropType([String, Array, Object])
},
effect: {
type: definePropType(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: true
},
pure: Boolean,
focusOnShow: Boolean,
trapping: Boolean,
popperClass: {
type: definePropType([String, Array, Object])
},
popperStyle: {
type: definePropType([String, Array, Object])
},
referenceEl: {
type: definePropType(Object)
},
triggerTargetEl: {
type: definePropType(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: true
},
virtualTriggering: Boolean,
zIndex: Number,
...useAriaProps(["ariaLabel"]),
loop: Boolean
});
var popperCoreConfigPropsDefaults = {
boundariesPadding: 0,
gpuAcceleration: true,
offset: 12,
placement: "bottom",
popperOptions: () => ({}),
strategy: "absolute"
};
var popperContentPropsDefaults = {
...popperCoreConfigPropsDefaults,
...popperArrowPropsDefaults,
effect: "dark",
enterable: true,
stopPopperMouseEvent: true,
visible: false,
pure: false,
focusOnShow: false,
trapping: false,
virtualTriggering: false,
loop: false,
style: void 0,
popperStyle: void 0
};
var popperContentEmits = {
mouseenter: (evt) => evt instanceof MouseEvent,
mouseleave: (evt) => evt instanceof MouseEvent,
focus: () => true,
blur: () => true,
close: () => true
};
var usePopperCoreConfigProps = popperCoreConfigProps;
var usePopperContentProps = popperContentProps;
var usePopperContentEmits = popperContentEmits;
// node_modules/element-plus/es/hooks/use-timeout/index.mjs
function useTimeout() {
let timeoutHandle;
const registerTimeout = (fn2, delay) => {
cancelTimeout();
timeoutHandle = window.setTimeout(fn2, delay);
};
const cancelTimeout = () => window.clearTimeout(timeoutHandle);
tryOnScopeDispose(() => cancelTimeout());
return {
registerTimeout,
cancelTimeout
};
}
// node_modules/element-plus/es/hooks/use-delayed-toggle/index.mjs
var useDelayedToggleProps = buildProps({
/**
* @description delay of appearance, in millisecond, not valid in controlled mode
*/
showAfter: {
type: Number,
default: 0
},
/**
* @description delay of disappear, in millisecond, not valid in controlled mode
*/
hideAfter: {
type: Number,
default: 200
},
/**
* @description disappear automatically, in millisecond, not valid in controlled mode
*/
autoClose: {
type: Number,
default: 0
}
});
var useDelayedTogglePropsDefaults = {
showAfter: 0,
hideAfter: 200,
autoClose: 0
};
var useDelayedToggle = ({
showAfter,
hideAfter,
autoClose,
open,
close: close2
}) => {
const { registerTimeout } = useTimeout();
const {
registerTimeout: registerTimeoutForAutoClose,
cancelTimeout: cancelTimeoutForAutoClose
} = useTimeout();
const onOpen = (event, delay = unref(showAfter)) => {
registerTimeout(() => {
open(event);
const _autoClose = unref(autoClose);
if (isNumber(_autoClose) && _autoClose > 0) {
registerTimeoutForAutoClose(() => {
close2(event);
}, _autoClose);
}
}, delay);
};
const onClose = (event, delay = unref(hideAfter)) => {
cancelTimeoutForAutoClose();
registerTimeout(() => {
close2(event);
}, delay);
};
return {
onOpen,
onClose
};
};
// node_modules/element-plus/es/components/tooltip/src/content.mjs
var useTooltipContentPropsDefaults = {
...useDelayedTogglePropsDefaults,
...popperContentPropsDefaults,
content: "",
visible: null,
teleported: true
};
var useTooltipContentProps = buildProps({
...useDelayedToggleProps,
...popperContentProps,
/**
* @description which element the tooltip CONTENT appends to
*/
appendTo: {
type: teleportProps.to.type
},
/**
* @description display content, can be overridden by `slot#content`
*/
content: {
type: String,
default: ""
},
/**
* @description whether `content` is treated as HTML string
*/
rawContent: Boolean,
/**
* @description when tooltip inactive and `persistent` is `false` , popconfirm will be destroyed
*/
persistent: Boolean,
// because model toggle prop is generated dynamically
// so the typing cannot be evaluated by typescript as type:
// [name]: { type: Boolean, default: null }
// so we need to declare that again for type checking.
/**
* @description visibility of Tooltip
*/
visible: {
type: definePropType(Boolean),
default: null
},
/**
* @description animation name
*/
transition: String,
/**
* @description whether tooltip content is teleported, if `true` it will be teleported to where `append-to` sets
*/
teleported: {
type: Boolean,
default: true
},
/**
* @description whether Tooltip is disabled
*/
disabled: Boolean,
...useAriaProps(["ariaLabel"])
});
// node_modules/element-plus/es/utils/typescript.mjs
var mutable = (val) => val;
// node_modules/element-plus/es/components/input/src/input.mjs
var inputProps = buildProps({
/**
* @description native input id
*/
id: {
type: String,
default: void 0
},
/**
* @description input box size
*/
size: useSizeProp,
/**
* @description whether to disable
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description binding value
*/
modelValue: {
type: definePropType([
String,
Number,
Object
]),
default: ""
},
/**
* @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)
*/
modelModifiers: {
type: definePropType(Object),
default: () => ({})
},
/**
* @description same as `maxlength` in native input
*/
maxlength: {
type: [String, Number]
},
/**
* @description same as `minlength` in native input
*/
minlength: {
type: [String, Number]
},
/**
* @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)
*/
type: {
type: definePropType(String),
default: "text"
},
/**
* @description control the resizability
*/
resize: {
type: String,
values: ["none", "both", "horizontal", "vertical"]
},
/**
* @description whether textarea has an adaptive height
*/
autosize: {
type: definePropType([Boolean, Object]),
default: false
},
/**
* @description native input autocomplete
*/
autocomplete: {
type: definePropType(String),
default: "off"
},
/**
* @description format content
*/
formatter: {
type: Function
},
/**
* @description parse content
*/
parser: {
type: Function
},
/**
* @description placeholder
*/
placeholder: {
type: String
},
/**
* @description native input form
*/
form: {
type: String
},
/**
* @description native input readonly
*/
readonly: Boolean,
/**
* @description whether to show clear button
*/
clearable: Boolean,
/**
* @description custom clear icon component
*/
clearIcon: {
type: iconPropType,
default: circle_close_default
},
/**
* @description toggleable password input
*/
showPassword: Boolean,
/**
* @description word count
*/
showWordLimit: Boolean,
/**
* @description word count position, valid when `show-word-limit` is true
*/
wordLimitPosition: {
type: String,
values: ["inside", "outside"],
default: "inside"
},
/**
* @description suffix icon
*/
suffixIcon: {
type: iconPropType
},
/**
* @description prefix icon
*/
prefixIcon: {
type: iconPropType
},
/**
* @description container role, internal properties provided for use by the picker component
*/
containerRole: {
type: String,
default: void 0
},
/**
* @description input tabindex
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description input or textarea element style
*/
inputStyle: {
type: definePropType([Object, Array, String]),
default: () => mutable({})
},
/**
* @description native input autofocus
*/
autofocus: Boolean,
rows: {
type: Number,
default: 2
},
...useAriaProps(["ariaLabel"]),
/**
* @description native input mode for virtual keyboards
*/
inputmode: {
type: definePropType(String),
default: void 0
},
/**
* @description same as `name` in native input
*/
name: String
});
var inputEmits = {
[UPDATE_MODEL_EVENT]: (value) => isString(value),
input: (value) => isString(value),
change: (value, evt) => isString(value) && (evt instanceof Event || evt === void 0),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true,
mouseleave: (evt) => evt instanceof MouseEvent,
mouseenter: (evt) => evt instanceof MouseEvent,
// NOTE: when autofill by browser, the keydown event is instanceof Event, not KeyboardEvent
// relative bug report https://github.com/element-plus/element-plus/issues/6665
keydown: (evt) => evt instanceof Event,
compositionstart: (evt) => evt instanceof CompositionEvent,
compositionupdate: (evt) => evt instanceof CompositionEvent,
compositionend: (evt) => evt instanceof CompositionEvent
};
var inputPropsDefaults = {
disabled: void 0,
modelValue: "",
modelModifiers: () => ({}),
type: "text",
autocomplete: "off",
clearIcon: markRaw(circle_close_default),
wordLimitPosition: "inside",
tabindex: 0,
validateEvent: true,
inputStyle: () => ({}),
rows: 2
};
// node_modules/element-plus/es/components/autocomplete/src/autocomplete.mjs
var autocompleteProps = buildProps({
...inputProps,
/**
* @description key name of the input suggestion object for display
*/
valueKey: {
type: String,
default: "value"
},
/**
* @description binding value
*/
modelValue: {
type: [String, Number],
default: ""
},
/**
* @description debounce delay when typing, in milliseconds
*/
debounce: {
type: Number,
default: 300
},
/**
* @description placement of the popup menu
*/
placement: {
type: definePropType(String),
values: [
"top",
"top-start",
"top-end",
"bottom",
"bottom-start",
"bottom-end"
],
default: "bottom-start"
},
/**
* @description a method to fetch input suggestions. When suggestions are ready, invoke `callback(data:[])` to return them to Autocomplete
*/
fetchSuggestions: {
type: definePropType([Function, Array]),
default: NOOP
},
/**
* @description custom class name for autocomplete's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for autocomplete's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description whether show suggestions when input focus
*/
triggerOnFocus: {
type: Boolean,
default: true
},
/**
* @description whether to emit a `select` event on enter when there is no autocomplete match
*/
selectWhenUnmatched: Boolean,
/**
* @description whether to hide the loading icon in remote search
*/
hideLoading: Boolean,
/**
* @description whether select dropdown is teleported to the body
*/
teleported: useTooltipContentProps.teleported,
/**
* @description which select dropdown appends to
*/
appendTo: useTooltipContentProps.appendTo,
/**
* @description whether to highlight first item in remote search suggestions by default
*/
highlightFirstItem: Boolean,
/**
* @description whether the width of the dropdown is the same as the input
*/
fitInputWidth: Boolean,
/**
* @description whether keyboard navigation loops from end to start
*/
loopNavigation: {
type: Boolean,
default: true
}
});
var autocompleteEmits = {
[UPDATE_MODEL_EVENT]: (value) => isString(value) || isNumber(value),
[INPUT_EVENT]: (value) => isString(value) || isNumber(value),
[CHANGE_EVENT]: (value) => isString(value) || isNumber(value),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true,
select: (item) => isObject(item)
};
// node_modules/element-plus/es/utils/browser.mjs
var isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
var isAndroid = () => isClient && /android/i.test(window.navigator.userAgent);
// node_modules/element-plus/es/components/input/src/utils.mjs
var hiddenTextarea = void 0;
var HIDDEN_STYLE = {
height: "0",
visibility: "hidden",
overflow: isFirefox() ? "" : "hidden",
position: "absolute",
"z-index": "-1000",
top: "0",
right: "0"
};
var CONTEXT_STYLE = [
"letter-spacing",
"line-height",
"padding-top",
"padding-bottom",
"font-family",
"font-weight",
"font-size",
"text-rendering",
"text-transform",
"width",
"text-indent",
"padding-left",
"padding-right",
"border-width",
"box-sizing",
"word-break"
];
var looseToNumber = (val) => {
const n = Number.parseFloat(val);
return Number.isNaN(n) ? val : n;
};
function calculateNodeStyling(targetElement) {
const style = window.getComputedStyle(targetElement);
const boxSizing = style.getPropertyValue("box-sizing");
const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
const contextStyle = CONTEXT_STYLE.map((name) => [
name,
style.getPropertyValue(name)
]);
return { contextStyle, paddingSize, borderSize, boxSizing };
}
function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
var _a, _b;
if (!hiddenTextarea) {
hiddenTextarea = document.createElement("textarea");
((_a = targetElement.parentNode) != null ? _a : document.body).appendChild(hiddenTextarea);
}
const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
contextStyle.forEach(
([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value)
);
Object.entries(HIDDEN_STYLE).forEach(
([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value, "important")
);
hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
let height = hiddenTextarea.scrollHeight;
const result = {};
if (boxSizing === "border-box") {
height = height + borderSize;
} else if (boxSizing === "content-box") {
height = height - paddingSize;
}
hiddenTextarea.value = "";
const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (isNumber(minRows)) {
let minHeight = singleRowHeight * minRows;
if (boxSizing === "border-box") {
minHeight = minHeight + paddingSize + borderSize;
}
height = Math.max(minHeight, height);
result.minHeight = `${minHeight}px`;
}
if (isNumber(maxRows)) {
let maxHeight = singleRowHeight * maxRows;
if (boxSizing === "border-box") {
maxHeight = maxHeight + paddingSize + borderSize;
}
height = Math.min(maxHeight, height);
}
result.height = `${height}px`;
(_b = hiddenTextarea.parentNode) == null ? void 0 : _b.removeChild(hiddenTextarea);
hiddenTextarea = void 0;
return result;
}
// node_modules/element-plus/es/hooks/use-attrs/index.mjs
var DEFAULT_EXCLUDE_KEYS = ["class", "style"];
var LISTENER_PREFIX = /^on[A-Z]/;
var useAttrs2 = (params = {}) => {
const { excludeListeners = false, excludeKeys } = params;
const allExcludeKeys = computed(() => {
return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
});
const instance = getCurrentInstance();
if (!instance) {
debugWarn(
"use-attrs",
"getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"
);
return computed(() => ({}));
}
return computed(
() => {
var _a;
return fromPairs_default(
Object.entries((_a = instance.proxy) == null ? void 0 : _a.$attrs).filter(
([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))
)
);
}
);
};
// node_modules/element-plus/es/hooks/use-prop/index.mjs
var useProp = (name) => {
const vm = getCurrentInstance();
return computed(() => {
var _a, _b;
return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];
});
};
// node_modules/element-plus/es/components/form/src/constants.mjs
var formContextKey = /* @__PURE__ */ Symbol("formContextKey");
var formItemContextKey = /* @__PURE__ */ Symbol("formItemContextKey");
// node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.mjs
var useFormSize = (fallback, ignore = {}) => {
const emptyRef = ref(void 0);
const size2 = ignore.prop ? emptyRef : useProp("size");
const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
return computed(
() => size2.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || ""
);
};
var useFormDisabled = (fallback) => {
const disabled = useProp("disabled");
const form = inject(formContextKey, void 0);
return computed(() => {
var _a, _b, _c;
return (_c = (_b = (_a = disabled.value) != null ? _a : unref(fallback)) != null ? _b : form == null ? void 0 : form.disabled) != null ? _c : false;
});
};
var useSize = useFormSize;
var useDisabled = useFormDisabled;
// node_modules/element-plus/es/utils/dom/aria.mjs
var FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
var isHTMLElement = (e) => {
if (typeof Element === "undefined") return false;
return e instanceof Element;
};
var isVisible = (element) => {
if (false) return true;
const computed2 = getComputedStyle(element);
return computed2.position === "fixed" ? false : element.offsetParent !== null;
};
var obtainAllFocusableElements = (element) => {
return Array.from(
element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
).filter((item) => isFocusable(item) && isVisible(item));
};
var isFocusable = (element) => {
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
return true;
}
if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") {
return false;
}
switch (element.nodeName) {
case "A": {
return !!element.href && element.rel !== "ignore";
}
case "INPUT": {
return !(element.type === "hidden" || element.type === "file");
}
case "BUTTON":
case "SELECT":
case "TEXTAREA": {
return true;
}
default: {
return false;
}
}
};
var triggerEvent = function(elm, name, ...opts) {
let eventName;
if (name.includes("mouse") || name.includes("click")) {
eventName = "MouseEvents";
} else if (name.includes("key")) {
eventName = "KeyboardEvent";
} else {
eventName = "HTMLEvents";
}
const evt = document.createEvent(eventName);
evt.initEvent(name, ...opts);
elm.dispatchEvent(evt);
return elm;
};
var isLeaf = (el) => !el.getAttribute("aria-owns");
var getSibling = (el, distance, elClass) => {
const { parentNode } = el;
if (!parentNode) return null;
const siblings = parentNode.querySelectorAll(elClass);
const index = Array.prototype.indexOf.call(siblings, el);
return siblings[index + distance] || null;
};
var focusElement = (el, options) => {
if (!el || !el.focus) return;
let cleanup = false;
if (isHTMLElement(el) && !isFocusable(el) && !el.getAttribute("tabindex")) {
el.setAttribute("tabindex", "-1");
cleanup = true;
}
el.focus(options);
if (isHTMLElement(el) && cleanup) {
el.removeAttribute("tabindex");
}
};
var focusNode = (el) => {
if (!el) return;
focusElement(el);
!isLeaf(el) && el.click();
};
// node_modules/element-plus/es/hooks/use-focus-controller/index.mjs
function useFocusController(target2, {
disabled,
beforeFocus,
afterFocus,
beforeBlur,
afterBlur
} = {}) {
const instance = getCurrentInstance();
const { emit } = instance;
const wrapperRef = shallowRef();
const isFocused = ref(false);
const handleFocus = (event) => {
const cancelFocus = isFunction(beforeFocus) ? beforeFocus(event) : false;
if (unref(disabled) || isFocused.value || cancelFocus) return;
isFocused.value = true;
emit("focus", event);
afterFocus == null ? void 0 : afterFocus();
};
const handleBlur = (event) => {
var _a;
const cancelBlur = isFunction(beforeBlur) ? beforeBlur(event) : false;
if (unref(disabled) || event.relatedTarget && ((_a = wrapperRef.value) == null ? void 0 : _a.contains(event.relatedTarget)) || cancelBlur)
return;
isFocused.value = false;
emit("blur", event);
afterBlur == null ? void 0 : afterBlur();
};
const handleClick = (event) => {
var _a, _b;
if (unref(disabled) || isFocusable(event.target) || ((_a = wrapperRef.value) == null ? void 0 : _a.contains(document.activeElement)) && wrapperRef.value !== document.activeElement)
return;
(_b = target2.value) == null ? void 0 : _b.focus();
};
watch([wrapperRef, () => unref(disabled)], ([el, disabled2]) => {
if (!el) return;
if (disabled2) {
el.removeAttribute("tabindex");
} else {
el.setAttribute("tabindex", "-1");
}
});
useEventListener(wrapperRef, "focus", handleFocus, true);
useEventListener(wrapperRef, "blur", handleBlur, true);
useEventListener(wrapperRef, "click", handleClick, true);
if (false) {
onMounted(() => {
const targetEl = isElement(target2.value) ? target2.value : document.querySelector("input,textarea");
if (targetEl) {
useEventListener(targetEl, "focus", handleFocus, true);
useEventListener(targetEl, "blur", handleBlur, true);
}
});
}
return {
isFocused,
/** Avoid using wrapperRef and handleFocus/handleBlur together */
wrapperRef,
handleFocus,
handleBlur
};
}
// node_modules/element-plus/es/hooks/use-id/index.mjs
var defaultIdInjection = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
};
var ID_INJECTION_KEY = /* @__PURE__ */ Symbol("elIdInjection");
var useIdInjection = () => {
return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
};
var useId = (deterministicId) => {
const idInjection = useIdInjection();
if (!isClient && idInjection === defaultIdInjection) {
debugWarn(
"IdInjection",
`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
usage: app.provide(ID_INJECTION_KEY, {
prefix: number,
current: number,
})`
);
}
const namespace = useGetDerivedNamespace();
const idRef = computedEager(
() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`
);
return idRef;
};
// node_modules/element-plus/es/components/form/src/hooks/use-form-item.mjs
var useFormItem = () => {
const form = inject(formContextKey, void 0);
const formItem = inject(formItemContextKey, void 0);
return {
form,
formItem
};
};
var useFormItemInputId = (props2, {
formItemContext,
disableIdGeneration,
disableIdManagement
}) => {
if (!disableIdGeneration) {
disableIdGeneration = ref(false);
}
if (!disableIdManagement) {
disableIdManagement = ref(false);
}
const instance = getCurrentInstance();
const inLabel = () => {
let parent = instance == null ? void 0 : instance.parent;
while (parent) {
if (parent.type.name === "ElFormItem") {
return false;
}
if (parent.type.name === "ElLabelWrap") {
return true;
}
parent = parent.parent;
}
return false;
};
const inputId = ref();
let idUnwatch = void 0;
const isLabeledByFormItem = computed(() => {
var _a;
return !!(!(props2.label || props2.ariaLabel) && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);
});
onMounted(() => {
idUnwatch = watch(
[toRef(props2, "id"), disableIdGeneration],
([id, disableIdGeneration2]) => {
const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
if (newId !== inputId.value) {
if ((formItemContext == null ? void 0 : formItemContext.removeInputId) && !inLabel()) {
inputId.value && formItemContext.removeInputId(inputId.value);
if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
formItemContext.addInputId(newId);
}
}
inputId.value = newId;
}
},
{ immediate: true }
);
});
onUnmounted(() => {
idUnwatch && idUnwatch();
if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
inputId.value && formItemContext.removeInputId(inputId.value);
}
});
return {
isLabeledByFormItem,
inputId
};
};
// node_modules/element-plus/es/utils/i18n.mjs
var isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
// node_modules/element-plus/es/hooks/use-composition/index.mjs
function useComposition({
afterComposition,
emit
}) {
const isComposing = ref(false);
const handleCompositionStart = (event) => {
emit == null ? void 0 : emit("compositionstart", event);
isComposing.value = true;
};
const handleCompositionUpdate = (event) => {
var _a;
emit == null ? void 0 : emit("compositionupdate", event);
const text = (_a = event.target) == null ? void 0 : _a.value;
const lastCharacter = text[text.length - 1] || "";
isComposing.value = !isKorean(lastCharacter);
};
const handleCompositionEnd = (event) => {
emit == null ? void 0 : emit("compositionend", event);
if (isComposing.value) {
isComposing.value = false;
nextTick(() => afterComposition(event));
}
};
const handleComposition = (event) => {
event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
};
return {
isComposing,
handleComposition,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd
};
}
// node_modules/element-plus/es/hooks/use-cursor/index.mjs
function useCursor(input) {
let selectionInfo;
function recordCursor() {
if (input.value == void 0) return;
const { selectionStart, selectionEnd, value } = input.value;
if (selectionStart == null || selectionEnd == null) return;
const beforeTxt = value.slice(0, Math.max(0, selectionStart));
const afterTxt = value.slice(Math.max(0, selectionEnd));
selectionInfo = {
selectionStart,
selectionEnd,
value,
beforeTxt,
afterTxt
};
}
function setCursor() {
if (input.value == void 0 || selectionInfo == void 0) return;
const { value } = input.value;
const { beforeTxt, afterTxt, selectionStart } = selectionInfo;
if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
return;
let startPos = value.length;
if (value.endsWith(afterTxt)) {
startPos = value.length - afterTxt.length;
} else if (value.startsWith(beforeTxt)) {
startPos = beforeTxt.length;
} else {
const beforeLastChar = beforeTxt[selectionStart - 1];
const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
if (newIndex !== -1) {
startPos = newIndex + 1;
}
}
input.value.setSelectionRange(startPos, startPos);
}
return [recordCursor, setCursor];
}
// node_modules/element-plus/es/components/input/src/input.vue2.mjs
var _hoisted_1 = ["id", "name", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "inputmode"];
var _hoisted_2 = ["id", "name", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role"];
var COMPONENT_NAME2 = "ElInput";
var _sfc_main5 = defineComponent({
...{
name: COMPONENT_NAME2,
inheritAttrs: false
},
__name: "input",
props: inputProps,
emits: inputEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const rawAttrs = useAttrs();
const attrs = useAttrs2();
const slots = useSlots();
const containerKls = computed(() => [
props2.type === "textarea" ? nsTextarea.b() : nsInput.b(),
nsInput.m(inputSize.value),
nsInput.is("disabled", inputDisabled.value),
nsInput.is("exceed", inputExceed.value),
{
[nsInput.b("group")]: slots.prepend || slots.append,
[nsInput.m("prefix")]: slots.prefix || props2.prefixIcon,
[nsInput.m("suffix")]: slots.suffix || props2.suffixIcon || props2.clearable || props2.showPassword,
[nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value,
[nsInput.b("hidden")]: props2.type === "hidden"
},
rawAttrs.class
]);
const wrapperKls = computed(() => [
nsInput.e("wrapper"),
nsInput.is("focus", isFocused.value)
]);
const { form: elForm, formItem: elFormItem } = useFormItem();
const { inputId } = useFormItemInputId(props2, {
formItemContext: elFormItem
});
const inputSize = useFormSize();
const inputDisabled = useFormDisabled();
const nsInput = useNamespace("input");
const nsTextarea = useNamespace("textarea");
const input = shallowRef();
const textarea = shallowRef();
const hovering = ref(false);
const passwordVisible = ref(false);
const countStyle = ref();
const textareaCalcStyle = shallowRef(props2.inputStyle);
const _ref = computed(() => input.value || textarea.value);
const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(
_ref,
{
disabled: inputDisabled,
afterBlur() {
var _a;
if (props2.validateEvent) {
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "blur").catch((err) => debugWarn(err));
}
}
}
);
const needStatusIcon = computed(() => {
var _a;
return (_a = elForm == null ? void 0 : elForm.statusIcon) != null ? _a : false;
});
const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
const validateIcon = computed(
() => validateState.value && ValidateComponentsMap[validateState.value]
);
const passwordIcon = computed(
() => passwordVisible.value ? view_default : hide_default
);
const containerStyle = computed(() => [
rawAttrs.style
]);
const textareaStyle = computed(() => [
props2.inputStyle,
textareaCalcStyle.value,
{ resize: props2.resize }
]);
const nativeInputValue = computed(
() => isNil_default(props2.modelValue) ? "" : String(props2.modelValue)
);
const showClear = computed(
() => props2.clearable && !inputDisabled.value && !props2.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value)
);
const showPwdVisible = computed(
() => props2.showPassword && !inputDisabled.value && !!nativeInputValue.value
);
const isWordLimitVisible = computed(
() => props2.showWordLimit && !!props2.maxlength && (props2.type === "text" || props2.type === "textarea") && !inputDisabled.value && !props2.readonly && !props2.showPassword
);
const textLength = computed(() => nativeInputValue.value.length);
const inputExceed = computed(
() => (
// show exceed style if length of initial value greater then maxlength
!!isWordLimitVisible.value && textLength.value > Number(props2.maxlength)
)
);
const suffixVisible = computed(
() => !!slots.suffix || !!props2.suffixIcon || showClear.value || props2.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value
);
const hasModelModifiers = computed(
() => !!Object.keys(props2.modelModifiers).length
);
const [recordCursor, setCursor] = useCursor(input);
useResizeObserver(textarea, (entries) => {
onceInitSizeTextarea();
if (!isWordLimitVisible.value || props2.resize !== "both" && props2.resize !== "horizontal")
return;
const entry = entries[0];
const { width } = entry.contentRect;
countStyle.value = {
/** right: 100% - width + padding(22) - right(10) */
right: `calc(100% - ${width + 22 - 10}px)`
};
});
const resizeTextarea = () => {
const { type, autosize } = props2;
if (!isClient || type !== "textarea" || !textarea.value) return;
if (autosize) {
const minRows = isObject(autosize) ? autosize.minRows : void 0;
const maxRows = isObject(autosize) ? autosize.maxRows : void 0;
const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
textareaCalcStyle.value = {
overflowY: "hidden",
...textareaStyle2
};
nextTick(() => {
textarea.value.offsetHeight;
textareaCalcStyle.value = textareaStyle2;
});
} else {
textareaCalcStyle.value = {
minHeight: calcTextareaHeight(textarea.value).minHeight
};
}
};
const createOnceInitResize = (resizeTextarea2) => {
let isInit = false;
return () => {
var _a;
if (isInit || !props2.autosize) return;
const isElHidden = ((_a = textarea.value) == null ? void 0 : _a.offsetParent) === null;
if (!isElHidden) {
setTimeout(resizeTextarea2);
isInit = true;
}
};
};
const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
const setNativeInputValue = () => {
const input2 = _ref.value;
const formatterValue = props2.formatter ? props2.formatter(nativeInputValue.value) : nativeInputValue.value;
if (!input2 || input2.value === formatterValue || props2.type === "file") return;
input2.value = formatterValue;
};
const formatValue = (value) => {
const { trim, number } = props2.modelModifiers;
if (trim) {
value = value.trim();
}
if (number) {
value = `${looseToNumber(value)}`;
}
if (props2.formatter && props2.parser) {
value = props2.parser(value);
}
return value;
};
const handleInput = async (event) => {
if (isComposing.value) return;
const { lazy } = props2.modelModifiers;
let { value } = event.target;
if (lazy) {
emit(INPUT_EVENT, value);
return;
}
value = formatValue(value);
if (String(value) === nativeInputValue.value) {
if (props2.formatter) {
setNativeInputValue();
}
return;
}
recordCursor();
emit(UPDATE_MODEL_EVENT, value);
emit(INPUT_EVENT, value);
await nextTick();
if (props2.formatter && props2.parser || !hasModelModifiers.value) {
setNativeInputValue();
}
setCursor();
};
const handleChange = async (event) => {
let { value } = event.target;
value = formatValue(value);
if (props2.modelModifiers.lazy) {
emit(UPDATE_MODEL_EVENT, value);
}
emit(CHANGE_EVENT, value, event);
await nextTick();
setNativeInputValue();
};
const {
isComposing,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd
} = useComposition({ emit, afterComposition: handleInput });
const handlePasswordVisible = () => {
passwordVisible.value = !passwordVisible.value;
};
const focus = () => {
var _a;
return (_a = _ref.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
return (_a = _ref.value) == null ? void 0 : _a.blur();
};
const handleMouseLeave = (evt) => {
hovering.value = false;
emit("mouseleave", evt);
};
const handleMouseEnter = (evt) => {
hovering.value = true;
emit("mouseenter", evt);
};
const handleKeydown = (evt) => {
emit("keydown", evt);
};
const select = () => {
var _a;
(_a = _ref.value) == null ? void 0 : _a.select();
};
const clear = () => {
emit(UPDATE_MODEL_EVENT, "");
emit(CHANGE_EVENT, "");
emit("clear");
emit(INPUT_EVENT, "");
};
watch(
() => props2.modelValue,
() => {
var _a;
nextTick(() => resizeTextarea());
if (props2.validateEvent) {
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err));
}
}
);
watch(nativeInputValue, (newValue) => {
if (!_ref.value) {
return;
}
const { trim, number } = props2.modelModifiers;
const elValue = _ref.value.value;
const displayValue = (number || props2.type === "number") && !/^0\d/.test(elValue) ? `${looseToNumber(elValue)}` : elValue;
if (displayValue === newValue) {
return;
}
if (document.activeElement === _ref.value && _ref.value.type !== "range") {
if (trim && displayValue.trim() === newValue) {
return;
}
}
setNativeInputValue();
});
watch(
() => props2.type,
async () => {
await nextTick();
setNativeInputValue();
resizeTextarea();
}
);
onMounted(() => {
if (!props2.formatter && props2.parser) {
debugWarn(
COMPONENT_NAME2,
"If you set the parser, you also need to set the formatter."
);
}
setNativeInputValue();
nextTick(resizeTextarea);
});
__expose({
/** @description HTML input element */
input,
/** @description HTML textarea element */
textarea,
/** @description HTML element, input or textarea */
ref: _ref,
/** @description style of textarea. */
textareaStyle,
/** @description from props (used on unit test) */
autosize: toRef(props2, "autosize"),
/** @description is input composing */
isComposing,
/** @description HTML input element native method */
focus,
/** @description HTML input element native method */
blur,
/** @description HTML input element native method */
select,
/** @description clear input value */
clear,
/** @description resize textarea. */
resizeTextarea
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
containerKls.value,
{
[unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
[unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend
}
]),
style: normalizeStyle(containerStyle.value),
onMouseenter: handleMouseEnter,
onMouseleave: handleMouseLeave
},
[
createCommentVNode(" input "),
__props.type !== "textarea" ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createCommentVNode(" prepend slot "),
_ctx.$slots.prepend ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(nsInput).be("group", "prepend"))
},
[
renderSlot(_ctx.$slots, "prepend")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
ref_key: "wrapperRef",
ref: wrapperRef,
class: normalizeClass(wrapperKls.value)
},
[
createCommentVNode(" prefix slot "),
_ctx.$slots.prefix || __props.prefixIcon ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(unref(nsInput).e("prefix"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(nsInput).e("prefix-inner"))
},
[
renderSlot(_ctx.$slots, "prefix"),
__props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(nsInput).e("icon"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode("input", mergeProps({
id: unref(inputId),
ref_key: "input",
ref: input,
class: unref(nsInput).e("inner")
}, unref(attrs), {
name: __props.name,
minlength: __props.minlength,
maxlength: __props.maxlength,
type: __props.showPassword ? passwordVisible.value ? "text" : "password" : __props.type,
disabled: unref(inputDisabled),
readonly: __props.readonly,
autocomplete: __props.autocomplete,
tabindex: __props.tabindex,
"aria-label": __props.ariaLabel,
placeholder: __props.placeholder,
style: __props.inputStyle,
form: __props.form,
autofocus: __props.autofocus,
role: __props.containerRole,
inputmode: __props.inputmode,
onCompositionstart: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
onCompositionupdate: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
onCompositionend: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
onInput: handleInput,
onChange: handleChange,
onKeydown: handleKeydown
}), null, 16, _hoisted_1),
createCommentVNode(" suffix slot "),
suffixVisible.value ? (openBlock(), createElementBlock(
"span",
{
key: 1,
class: normalizeClass(unref(nsInput).e("suffix"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(nsInput).e("suffix-inner"))
},
[
!showClear.value || !showPwdVisible.value || !isWordLimitVisible.value ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
renderSlot(_ctx.$slots, "suffix"),
__props.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(nsInput).e("icon"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.suffixIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true),
showClear.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
onMousedown: withModifiers(unref(NOOP), ["prevent"]),
onClick: clear
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
showPwdVisible.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 2,
class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
onClick: handlePasswordVisible,
onMousedown: withModifiers(unref(NOOP), ["prevent"]),
onMouseup: withModifiers(unref(NOOP), ["prevent"])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(passwordIcon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onMousedown", "onMouseup"])) : createCommentVNode("v-if", true),
isWordLimitVisible.value ? (openBlock(), createElementBlock(
"span",
{
key: 3,
class: normalizeClass([
unref(nsInput).e("count"),
unref(nsInput).is("outside", __props.wordLimitPosition === "outside")
])
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(nsInput).e("count-inner"))
},
toDisplayString(textLength.value) + " / " + toDisplayString(__props.maxlength),
3
/* TEXT, CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 4,
class: normalizeClass([
unref(nsInput).e("icon"),
unref(nsInput).e("validateIcon"),
unref(nsInput).is("loading", validateState.value === "validating")
])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
createCommentVNode(" append slot "),
_ctx.$slots.append ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(nsInput).be("group", "append"))
},
[
renderSlot(_ctx.$slots, "append")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
createCommentVNode(" textarea "),
createBaseVNode("textarea", mergeProps({
id: unref(inputId),
ref_key: "textarea",
ref: textarea,
class: [unref(nsTextarea).e("inner"), unref(nsInput).is("focus", unref(isFocused))]
}, unref(attrs), {
name: __props.name,
minlength: __props.minlength,
maxlength: __props.maxlength,
tabindex: __props.tabindex,
disabled: unref(inputDisabled),
readonly: __props.readonly,
autocomplete: __props.autocomplete,
style: textareaStyle.value,
"aria-label": __props.ariaLabel,
placeholder: __props.placeholder,
form: __props.form,
autofocus: __props.autofocus,
rows: __props.rows,
role: __props.containerRole,
onCompositionstart: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
onCompositionupdate: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
onCompositionend: _cache[5] || (_cache[5] = //@ts-ignore
(...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
onInput: handleInput,
onFocus: _cache[6] || (_cache[6] = //@ts-ignore
(...args) => unref(handleFocus) && unref(handleFocus)(...args)),
onBlur: _cache[7] || (_cache[7] = //@ts-ignore
(...args) => unref(handleBlur) && unref(handleBlur)(...args)),
onChange: handleChange,
onKeydown: handleKeydown
}), null, 16, _hoisted_2),
isWordLimitVisible.value ? (openBlock(), createElementBlock(
"span",
{
key: 0,
style: normalizeStyle(countStyle.value),
class: normalizeClass([
unref(nsInput).e("count"),
unref(nsInput).is("outside", __props.wordLimitPosition === "outside")
])
},
toDisplayString(textLength.value) + " / " + toDisplayString(__props.maxlength),
7
/* TEXT, CLASS, STYLE */
)) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
))
],
38
/* CLASS, STYLE, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/input/index.mjs
var ElInput = withInstall(_sfc_main5);
// node_modules/element-plus/es/components/scrollbar/src/scrollbar.mjs
var scrollbarProps = buildProps({
/**
* @description trigger distance(px)
*/
distance: {
type: Number,
default: 0
},
/**
* @description height of scrollbar
*/
height: {
type: [String, Number],
default: ""
},
/**
* @description max height of scrollbar
*/
maxHeight: {
type: [String, Number],
default: ""
},
/**
* @description whether to use the native scrollbar
*/
native: Boolean,
/**
* @description style of wrap
*/
wrapStyle: {
type: definePropType([String, Object, Array]),
default: ""
},
/**
* @description class of wrap
*/
wrapClass: {
type: [String, Array],
default: ""
},
/**
* @description class of view
*/
viewClass: {
type: [String, Array],
default: ""
},
/**
* @description style of view
*/
viewStyle: {
type: [String, Array, Object],
default: ""
},
/**
* @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance
*/
noresize: Boolean,
// 如果 container 尺寸不会发生变化,最好设置它可以优化性能
/**
* @description element tag of the view
*/
tag: {
type: String,
default: "div"
},
/**
* @description always show
*/
always: Boolean,
/**
* @description minimum size of scrollbar
*/
minSize: {
type: Number,
default: 20
},
/**
* @description Wrap tabindex
*/
tabindex: {
type: [String, Number],
default: void 0
},
/**
* @description id of view
*/
id: String,
/**
* @description role of view
*/
role: String,
...useAriaProps(["ariaLabel", "ariaOrientation"])
});
var scrollbarEmits = {
"end-reached": (direction2) => ["left", "right", "top", "bottom"].includes(direction2),
scroll: ({
scrollTop,
scrollLeft
}) => [scrollTop, scrollLeft].every(isNumber)
};
// node_modules/element-plus/es/components/scrollbar/src/bar.mjs
var barProps = buildProps({
always: {
type: Boolean,
default: true
},
minSize: {
type: Number,
required: true
}
});
// node_modules/element-plus/es/components/scrollbar/src/util.mjs
var GAP = 4;
var BAR_MAP = {
vertical: {
offset: "offsetHeight",
scroll: "scrollTop",
scrollSize: "scrollHeight",
size: "height",
key: "vertical",
axis: "Y",
client: "clientY",
direction: "top"
},
horizontal: {
offset: "offsetWidth",
scroll: "scrollLeft",
scrollSize: "scrollWidth",
size: "width",
key: "horizontal",
axis: "X",
client: "clientX",
direction: "left"
}
};
var renderThumbStyle = ({
move,
size: size2,
bar
}) => ({
[bar.size]: size2,
transform: `translate${bar.axis}(${move}%)`
});
// node_modules/element-plus/es/components/scrollbar/src/thumb.mjs
var thumbProps = buildProps({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: true
},
always: Boolean
});
// node_modules/element-plus/es/components/scrollbar/src/constants.mjs
var scrollbarContextKey = /* @__PURE__ */ Symbol(
"scrollbarContextKey"
);
// node_modules/element-plus/es/components/scrollbar/src/thumb.vue2.mjs
var COMPONENT_NAME3 = "Thumb";
var _sfc_main6 = defineComponent({
__name: "thumb",
props: thumbProps,
setup(__props) {
const props2 = __props;
const scrollbar = inject(scrollbarContextKey);
const ns = useNamespace("scrollbar");
if (!scrollbar) throwError(COMPONENT_NAME3, "can not inject scrollbar context");
const instance = ref();
const thumb = ref();
const thumbState = ref({});
const visible = ref(false);
let cursorDown = false;
let cursorLeave = false;
let baseScrollHeight = 0;
let baseScrollWidth = 0;
let originalOnSelectStart = isClient ? document.onselectstart : null;
const bar = computed(() => BAR_MAP[props2.vertical ? "vertical" : "horizontal"]);
const thumbStyle = computed(
() => renderThumbStyle({
size: props2.size,
move: props2.move,
bar: bar.value
})
);
const offsetRatio = computed(
() => (
// offsetRatioX = original width of thumb / current width of thumb / ratioX
// offsetRatioY = original height of thumb / current height of thumb / ratioY
// instance height = wrap height - GAP
instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props2.ratio / thumb.value[bar.value.offset]
)
);
const clickThumbHandler = (e) => {
var _a;
e.stopPropagation();
if (e.ctrlKey || [1, 2].includes(e.button)) return;
(_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
startDrag(e);
const el = e.currentTarget;
if (!el) return;
thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
};
const clickTrackHandler = (e) => {
if (!thumb.value || !instance.value || !scrollbar.wrapElement) return;
const offset3 = Math.abs(
e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]
);
const thumbHalf = thumb.value[bar.value.offset] / 2;
const thumbPositionPercentage = (offset3 - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
};
const startDrag = (e) => {
e.stopImmediatePropagation();
cursorDown = true;
baseScrollHeight = scrollbar.wrapElement.scrollHeight;
baseScrollWidth = scrollbar.wrapElement.scrollWidth;
document.addEventListener("mousemove", mouseMoveDocumentHandler);
document.addEventListener("mouseup", mouseUpDocumentHandler);
originalOnSelectStart = document.onselectstart;
document.onselectstart = () => false;
};
const mouseMoveDocumentHandler = (e) => {
if (!instance.value || !thumb.value) return;
if (cursorDown === false) return;
const prevPage = thumbState.value[bar.value.axis];
if (!prevPage) return;
const offset3 = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
const thumbPositionPercentage = (offset3 - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
if (bar.value.scroll === "scrollLeft") {
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollWidth / 100;
} else {
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollHeight / 100;
}
};
const mouseUpDocumentHandler = () => {
cursorDown = false;
thumbState.value[bar.value.axis] = 0;
document.removeEventListener("mousemove", mouseMoveDocumentHandler);
document.removeEventListener("mouseup", mouseUpDocumentHandler);
restoreOnselectstart();
if (cursorLeave) visible.value = false;
};
const mouseMoveScrollbarHandler = () => {
cursorLeave = false;
visible.value = !!props2.size;
};
const mouseLeaveScrollbarHandler = () => {
cursorLeave = true;
visible.value = cursorDown;
};
onBeforeUnmount(() => {
restoreOnselectstart();
document.removeEventListener("mouseup", mouseUpDocumentHandler);
});
const restoreOnselectstart = () => {
if (document.onselectstart !== originalOnSelectStart)
document.onselectstart = originalOnSelectStart;
};
useEventListener(
toRef(scrollbar, "scrollbarElement"),
"mousemove",
mouseMoveScrollbarHandler
);
useEventListener(
toRef(scrollbar, "scrollbarElement"),
"mouseleave",
mouseLeaveScrollbarHandler
);
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, {
name: unref(ns).b("fade"),
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createBaseVNode(
"div",
{
ref_key: "instance",
ref: instance,
class: normalizeClass([unref(ns).e("bar"), unref(ns).is(bar.value.key)]),
onMousedown: clickTrackHandler,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
},
[
createBaseVNode(
"div",
{
ref_key: "thumb",
ref: thumb,
class: normalizeClass(unref(ns).e("thumb")),
style: normalizeStyle(thumbStyle.value),
onMousedown: clickThumbHandler
},
null,
38
/* CLASS, STYLE, NEED_HYDRATION */
)
],
34
/* CLASS, NEED_HYDRATION */
), [
[vShow, __props.always || visible.value]
])
]),
_: 1
/* STABLE */
}, 8, ["name"]);
};
}
});
// node_modules/element-plus/es/components/scrollbar/src/bar.vue2.mjs
var _sfc_main7 = defineComponent({
__name: "bar",
props: barProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const scrollbar = inject(scrollbarContextKey);
const moveX = ref(0);
const moveY = ref(0);
const sizeWidth = ref("");
const sizeHeight = ref("");
const ratioY = ref(1);
const ratioX = ref(1);
const handleScroll2 = (wrap) => {
if (wrap) {
const offsetHeight = wrap.offsetHeight - GAP;
const offsetWidth = wrap.offsetWidth - GAP;
moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
}
};
const update = () => {
const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
if (!wrap) return;
const offsetHeight = wrap.offsetHeight - GAP;
const offsetWidth = wrap.offsetWidth - GAP;
const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
const height = Math.max(originalHeight, props2.minSize);
const width = Math.max(originalWidth, props2.minSize);
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
};
__expose({
handleScroll: handleScroll2,
update
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
Fragment,
null,
[
createVNode(_sfc_main6, {
move: moveX.value,
ratio: ratioX.value,
size: sizeWidth.value,
always: __props.always
}, null, 8, ["move", "ratio", "size", "always"]),
createVNode(_sfc_main6, {
move: moveY.value,
ratio: ratioY.value,
size: sizeHeight.value,
vertical: "",
always: __props.always
}, null, 8, ["move", "ratio", "size", "always"])
],
64
/* STABLE_FRAGMENT */
);
};
}
});
// node_modules/element-plus/es/components/scrollbar/src/scrollbar.vue2.mjs
var _hoisted_12 = ["tabindex"];
var COMPONENT_NAME4 = "ElScrollbar";
var _sfc_main8 = defineComponent({
...{
name: COMPONENT_NAME4
},
__name: "scrollbar",
props: scrollbarProps,
emits: scrollbarEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("scrollbar");
let stopResizeObserver = void 0;
let stopWrapResizeObserver = void 0;
let stopResizeListener = void 0;
let wrapScrollTop = 0;
let wrapScrollLeft = 0;
let direction2 = "";
const distanceScrollState = {
bottom: false,
top: false,
right: false,
left: false
};
const scrollbarRef = ref();
const wrapRef = ref();
const resizeRef = ref();
const barRef = ref();
const wrapStyle = computed(() => {
const style = {};
const height = addUnit(props2.height);
const maxHeight = addUnit(props2.maxHeight);
if (height) style.height = height;
if (maxHeight) style.maxHeight = maxHeight;
return [props2.wrapStyle, style];
});
const wrapKls = computed(() => {
return [
props2.wrapClass,
ns.e("wrap"),
{ [ns.em("wrap", "hidden-default")]: !props2.native }
];
});
const resizeKls = computed(() => {
return [ns.e("view"), props2.viewClass];
});
const shouldSkipDirection = (direction22) => {
var _a;
return (_a = distanceScrollState[direction22]) != null ? _a : false;
};
const DIRECTION_PAIRS = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
};
const updateTriggerStatus = (arrivedStates) => {
const oppositeDirection = DIRECTION_PAIRS[direction2];
if (!oppositeDirection) return;
const arrived = arrivedStates[direction2];
const oppositeArrived = arrivedStates[oppositeDirection];
if (arrived && !distanceScrollState[direction2]) {
distanceScrollState[direction2] = true;
}
if (!oppositeArrived && distanceScrollState[oppositeDirection]) {
distanceScrollState[oppositeDirection] = false;
}
};
const handleScroll2 = () => {
var _a;
if (wrapRef.value) {
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
const prevTop = wrapScrollTop;
const prevLeft = wrapScrollLeft;
wrapScrollTop = wrapRef.value.scrollTop;
wrapScrollLeft = wrapRef.value.scrollLeft;
const arrivedStates = {
bottom: wrapScrollTop + wrapRef.value.clientHeight >= wrapRef.value.scrollHeight - props2.distance,
top: wrapScrollTop <= props2.distance && prevTop !== 0,
right: wrapScrollLeft + wrapRef.value.clientWidth >= wrapRef.value.scrollWidth - props2.distance && prevLeft !== wrapScrollLeft,
left: wrapScrollLeft <= props2.distance && prevLeft !== 0
};
emit("scroll", {
scrollTop: wrapScrollTop,
scrollLeft: wrapScrollLeft
});
if (prevTop !== wrapScrollTop) {
direction2 = wrapScrollTop > prevTop ? "bottom" : "top";
}
if (prevLeft !== wrapScrollLeft) {
direction2 = wrapScrollLeft > prevLeft ? "right" : "left";
}
if (props2.distance > 0) {
if (shouldSkipDirection(direction2)) {
return;
}
updateTriggerStatus(arrivedStates);
}
if (arrivedStates[direction2]) emit("end-reached", direction2);
}
};
function scrollTo2(arg1, arg2) {
if (isObject(arg1)) {
wrapRef.value.scrollTo(arg1);
} else if (isNumber(arg1) && isNumber(arg2)) {
wrapRef.value.scrollTo(arg1, arg2);
}
}
const setScrollTop = (value) => {
if (!isNumber(value)) {
debugWarn(COMPONENT_NAME4, "value must be a number");
return;
}
wrapRef.value.scrollTop = value;
};
const setScrollLeft = (value) => {
if (!isNumber(value)) {
debugWarn(COMPONENT_NAME4, "value must be a number");
return;
}
wrapRef.value.scrollLeft = value;
};
const update = () => {
var _a;
(_a = barRef.value) == null ? void 0 : _a.update();
distanceScrollState[direction2] = false;
};
watch(
() => props2.noresize,
(noresize) => {
if (noresize) {
stopResizeObserver == null ? void 0 : stopResizeObserver();
stopWrapResizeObserver == null ? void 0 : stopWrapResizeObserver();
stopResizeListener == null ? void 0 : stopResizeListener();
} else {
({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
({ stop: stopWrapResizeObserver } = useResizeObserver(wrapRef, update));
stopResizeListener = useEventListener("resize", update);
}
},
{ immediate: true }
);
watch(
() => [props2.maxHeight, props2.height],
() => {
if (!props2.native)
nextTick(() => {
var _a;
update();
if (wrapRef.value) {
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
}
});
}
);
provide(
scrollbarContextKey,
reactive({
scrollbarElement: scrollbarRef,
wrapElement: wrapRef
})
);
onActivated(() => {
if (wrapRef.value) {
wrapRef.value.scrollTop = wrapScrollTop;
wrapRef.value.scrollLeft = wrapScrollLeft;
}
});
onMounted(() => {
if (!props2.native)
nextTick(() => {
update();
});
});
onUpdated(() => update());
__expose({
/** @description scrollbar wrap ref */
wrapRef,
/** @description update scrollbar state manually */
update,
/** @description scrolls to a particular set of coordinates */
scrollTo: scrollTo2,
/** @description set distance to scroll top */
setScrollTop,
/** @description set distance to scroll left */
setScrollLeft,
/** @description handle scroll event */
handleScroll: handleScroll2
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "scrollbarRef",
ref: scrollbarRef,
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode("div", {
ref_key: "wrapRef",
ref: wrapRef,
class: normalizeClass(wrapKls.value),
style: normalizeStyle(wrapStyle.value),
tabindex: __props.tabindex,
onScroll: handleScroll2
}, [
(openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
id: __props.id,
ref_key: "resizeRef",
ref: resizeRef,
class: normalizeClass(resizeKls.value),
style: normalizeStyle(__props.viewStyle),
role: __props.role,
"aria-label": __props.ariaLabel,
"aria-orientation": __props.ariaOrientation
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, _hoisted_12),
!__props.native ? (openBlock(), createBlock(_sfc_main7, {
key: 0,
ref_key: "barRef",
ref: barRef,
always: __props.always,
"min-size": __props.minSize
}, null, 8, ["always", "min-size"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/scrollbar/index.mjs
var ElScrollbar = withInstall(_sfc_main8);
// node_modules/element-plus/es/components/popper/src/trigger.mjs
var popperTriggerProps = buildProps({
/** @description Indicates the reference element to which the popper is attached */
virtualRef: {
type: definePropType(Object)
},
/** @description Indicates whether virtual triggering is enabled */
virtualTriggering: Boolean,
onMouseenter: {
type: definePropType(Function)
},
onMouseleave: {
type: definePropType(Function)
},
onClick: {
type: definePropType(Function)
},
onKeydown: {
type: definePropType(Function)
},
onFocus: {
type: definePropType(Function)
},
onBlur: {
type: definePropType(Function)
},
onContextmenu: {
type: definePropType(Function)
},
id: String,
open: Boolean
});
var usePopperTriggerProps = popperTriggerProps;
// node_modules/element-plus/es/constants/aria.mjs
var EVENT_CODE = {
tab: "Tab",
enter: "Enter",
space: "Space",
left: "ArrowLeft",
// 37
up: "ArrowUp",
// 38
right: "ArrowRight",
// 39
down: "ArrowDown",
// 40
esc: "Escape",
delete: "Delete",
backspace: "Backspace",
numpadEnter: "NumpadEnter",
pageUp: "PageUp",
pageDown: "PageDown",
home: "Home",
end: "End"
};
// node_modules/element-plus/es/components/tooltip/src/trigger.mjs
var useTooltipTriggerPropsDefaults = {
trigger: "hover",
triggerKeys: () => [
EVENT_CODE.enter,
EVENT_CODE.numpadEnter,
EVENT_CODE.space
]
};
var useTooltipTriggerProps = buildProps({
...popperTriggerProps,
/**
* @description whether Tooltip is disabled
*/
disabled: Boolean,
/**
* @description How should the tooltip be triggered (to show), not valid in controlled mode
*/
trigger: {
type: definePropType([String, Array]),
default: "hover"
},
/**
* @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard, not valid in controlled mode
*/
triggerKeys: {
type: definePropType(Array),
default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
},
/**
* @description when triggering tooltips through hover, whether to focus the trigger element, which improves accessibility
*/
focusOnTarget: Boolean
});
// node_modules/element-plus/es/hooks/use-model-toggle/index.mjs
var _prop = buildProp({
type: definePropType(Boolean),
default: null
});
var _event = buildProp({
type: definePropType(Function)
});
var createModelToggleComposable = (name) => {
const updateEventKey = `update:${name}`;
const updateEventKeyRaw2 = `onUpdate:${name}`;
const useModelToggleEmits2 = [updateEventKey];
const useModelToggleProps2 = {
[name]: _prop,
[updateEventKeyRaw2]: _event
};
const useModelToggle2 = ({
indicator,
toggleReason,
shouldHideWhenRouteChanges,
shouldProceed,
onShow,
onHide
}) => {
const instance = getCurrentInstance();
const { emit } = instance;
const props2 = instance.props;
const hasUpdateHandler = computed(
() => isFunction(props2[updateEventKeyRaw2])
);
const isModelBindingAbsent = computed(() => props2[name] === null);
const doShow = (event) => {
if (indicator.value === true) {
return;
}
indicator.value = true;
if (toggleReason) {
toggleReason.value = event;
}
if (isFunction(onShow)) {
onShow(event);
}
};
const doHide = (event) => {
if (indicator.value === false) {
return;
}
indicator.value = false;
if (toggleReason) {
toggleReason.value = event;
}
if (isFunction(onHide)) {
onHide(event);
}
};
const show = (event) => {
if (props2.disabled === true || isFunction(shouldProceed) && !shouldProceed())
return;
const shouldEmit = hasUpdateHandler.value && isClient;
if (shouldEmit) {
emit(updateEventKey, true);
}
if (isModelBindingAbsent.value || !shouldEmit) {
doShow(event);
}
};
const hide2 = (event) => {
if (props2.disabled === true || !isClient) return;
const shouldEmit = hasUpdateHandler.value && isClient;
if (shouldEmit) {
emit(updateEventKey, false);
}
if (isModelBindingAbsent.value || !shouldEmit) {
doHide(event);
}
};
const onChange = (val) => {
if (!isBoolean(val)) return;
if (props2.disabled && val) {
if (hasUpdateHandler.value) {
emit(updateEventKey, false);
}
} else if (indicator.value !== val) {
if (val) {
doShow();
} else {
doHide();
}
}
};
const toggle = () => {
if (indicator.value) {
hide2();
} else {
show();
}
};
watch(() => props2[name], onChange);
if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
watch(
() => ({
...instance.proxy.$route
}),
() => {
if (shouldHideWhenRouteChanges.value && indicator.value) {
hide2();
}
}
);
}
onMounted(() => {
onChange(props2[name]);
});
return {
hide: hide2,
show,
toggle,
hasUpdateHandler
};
};
return {
useModelToggle: useModelToggle2,
useModelToggleProps: useModelToggleProps2,
useModelToggleEmits: useModelToggleEmits2
};
};
var { useModelToggle, useModelToggleProps, useModelToggleEmits } = createModelToggleComposable("modelValue");
// node_modules/element-plus/es/components/popper/src/popper.mjs
var Effect = {
LIGHT: "light",
DARK: "dark"
};
var roleTypes = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
];
var popperProps = buildProps({
role: {
type: String,
values: roleTypes,
default: "tooltip"
}
});
var usePopperProps = popperProps;
// node_modules/element-plus/es/components/tooltip/src/tooltip.mjs
var {
useModelToggleProps: useTooltipModelToggleProps,
useModelToggleEmits: useTooltipModelToggleEmits,
useModelToggle: useTooltipModelToggle
} = createModelToggleComposable("visible");
var useTooltipProps = buildProps({
...popperProps,
...useTooltipModelToggleProps,
...useTooltipContentProps,
...useTooltipTriggerProps,
...popperArrowProps,
/**
* @description whether the tooltip content has an arrow
*/
showArrow: {
type: Boolean,
default: true
}
});
var tooltipEmits = [
...useTooltipModelToggleEmits,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
];
// node_modules/element-plus/es/components/popper/src/constants.mjs
var POPPER_INJECTION_KEY = /* @__PURE__ */ Symbol("popper");
var POPPER_CONTENT_INJECTION_KEY = /* @__PURE__ */ Symbol("popperContent");
// node_modules/element-plus/es/components/popper/src/popper.vue2.mjs
var _sfc_main9 = defineComponent({
...{
name: "ElPopper",
inheritAttrs: false
},
__name: "popper",
props: popperProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const triggerRef2 = ref();
const popperInstanceRef = ref();
const contentRef = ref();
const referenceRef = ref();
const role = computed(() => props2.role);
const popperProvides = {
/**
* @description trigger element
*/
triggerRef: triggerRef2,
/**
* @description popperjs instance
*/
popperInstanceRef,
/**
* @description popper content element
*/
contentRef,
/**
* @description popper reference element
*/
referenceRef,
/**
* @description role determines how aria attributes are distributed
*/
role
};
__expose(popperProvides);
provide(POPPER_INJECTION_KEY, popperProvides);
return (_ctx, _cache) => {
return renderSlot(_ctx.$slots, "default");
};
}
});
// node_modules/element-plus/es/components/popper/src/arrow.vue2.mjs
var _sfc_main10 = defineComponent({
...{
name: "ElPopperArrow",
inheritAttrs: false
},
__name: "arrow",
setup(__props, { expose: __expose }) {
const ns = useNamespace("popper");
const { arrowRef, arrowStyle } = inject(
POPPER_CONTENT_INJECTION_KEY,
void 0
);
onBeforeUnmount(() => {
arrowRef.value = void 0;
});
__expose({
/**
* @description Arrow element
*/
arrowRef
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"span",
{
ref_key: "arrowRef",
ref: arrowRef,
class: normalizeClass(unref(ns).e("arrow")),
style: normalizeStyle(unref(arrowStyle)),
"data-popper-arrow": ""
},
null,
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/hooks/use-forward-ref/index.mjs
var FORWARD_REF_INJECTION_KEY = /* @__PURE__ */ Symbol("elForwardRef");
var useForwardRef = (forwardRef) => {
const setForwardRef = ((el) => {
forwardRef.value = el;
});
provide(FORWARD_REF_INJECTION_KEY, {
setForwardRef
});
};
var useForwardRefDirective = (setForwardRef) => {
return {
mounted(el) {
setForwardRef(el);
},
updated(el) {
setForwardRef(el);
},
unmounted() {
setForwardRef(null);
}
};
};
// node_modules/element-plus/es/components/slot/src/only-child.mjs
var NAME = "ElOnlyChild";
var OnlyChild = defineComponent({
name: NAME,
setup(_2, {
slots,
attrs
}) {
var _a;
const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
const forwardRefDirective = useForwardRefDirective((_a = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a : NOOP);
return () => {
var _a2;
const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots, attrs);
if (!defaultSlot) return null;
const [firstLegitNode, length] = findFirstLegitChild(defaultSlot);
if (!firstLegitNode) {
debugWarn(NAME, "no valid child node found");
return null;
}
if (length > 1) {
debugWarn(NAME, "requires exact only one valid child.");
}
return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
};
}
});
function findFirstLegitChild(node) {
if (!node) return [null, 0];
const children = node;
const len = children.filter((c2) => c2.type !== Comment).length;
for (const child of children) {
if (isObject(child)) {
switch (child.type) {
case Comment:
continue;
case Text:
case "svg":
return [wrapTextContent(child), len];
case Fragment:
return findFirstLegitChild(child.children);
default:
return [child, len];
}
}
return [wrapTextContent(child), len];
}
return [null, 0];
}
function wrapTextContent(s2) {
const ns = useNamespace("only-child");
return createVNode("span", {
"class": ns.e("content")
}, [s2]);
}
// node_modules/element-plus/es/components/popper/src/trigger.vue2.mjs
var _sfc_main11 = defineComponent({
...{
name: "ElPopperTrigger",
inheritAttrs: false
},
__name: "trigger",
props: popperTriggerProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const { role, triggerRef: triggerRef2 } = inject(POPPER_INJECTION_KEY, void 0);
useForwardRef(triggerRef2);
const ariaControls = computed(() => {
return ariaHaspopup.value ? props2.id : void 0;
});
const ariaDescribedby = computed(() => {
if (role && role.value === "tooltip") {
return props2.open && props2.id ? props2.id : void 0;
}
return void 0;
});
const ariaHaspopup = computed(() => {
if (role && role.value !== "tooltip") {
return role.value;
}
return void 0;
});
const ariaExpanded = computed(() => {
return ariaHaspopup.value ? `${props2.open}` : void 0;
});
let virtualTriggerAriaStopWatch = void 0;
const TRIGGER_ELE_EVENTS = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
onMounted(() => {
watch(
() => props2.virtualRef,
(virtualEl) => {
if (virtualEl) {
triggerRef2.value = unrefElement(virtualEl);
}
},
{
immediate: true
}
);
watch(
triggerRef2,
(el, prevEl) => {
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
virtualTriggerAriaStopWatch = void 0;
if (isElement(prevEl)) {
TRIGGER_ELE_EVENTS.forEach((eventName) => {
const handler = props2[eventName];
if (handler) {
prevEl.removeEventListener(
eventName.slice(2).toLowerCase(),
handler,
["onFocus", "onBlur"].includes(eventName)
);
}
});
}
if (isElement(el)) {
TRIGGER_ELE_EVENTS.forEach((eventName) => {
const handler = props2[eventName];
if (handler) {
el.addEventListener(
eventName.slice(2).toLowerCase(),
handler,
["onFocus", "onBlur"].includes(eventName)
);
}
});
if (isFocusable(el)) {
virtualTriggerAriaStopWatch = watch(
[ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded],
(watches) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((key, idx) => {
isNil_default(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
});
},
{ immediate: true }
);
}
}
if (isElement(prevEl) && isFocusable(prevEl)) {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((key) => prevEl.removeAttribute(key));
}
},
{
immediate: true
}
);
});
onBeforeUnmount(() => {
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
virtualTriggerAriaStopWatch = void 0;
if (triggerRef2.value && isElement(triggerRef2.value)) {
const el = triggerRef2.value;
TRIGGER_ELE_EVENTS.forEach((eventName) => {
const handler = props2[eventName];
if (handler) {
el.removeEventListener(
eventName.slice(2).toLowerCase(),
handler,
["onFocus", "onBlur"].includes(eventName)
);
}
});
triggerRef2.value = void 0;
}
});
__expose({
/**
* @description trigger element
*/
triggerRef: triggerRef2
});
return (_ctx, _cache) => {
return !__props.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
"aria-controls": ariaControls.value,
"aria-describedby": ariaDescribedby.value,
"aria-expanded": ariaExpanded.value,
"aria-haspopup": ariaHaspopup.value
}), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
};
}
});
// node_modules/element-plus/es/components/focus-trap/src/tokens.mjs
var FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
var FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
var FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
var FOCUS_AFTER_TRAPPED_OPTS = {
cancelable: true,
bubbles: false
};
var FOCUSOUT_PREVENTED_OPTS = {
cancelable: true,
bubbles: false
};
var ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
var ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
var FOCUS_TRAP_INJECTION_KEY = /* @__PURE__ */ Symbol("elFocusTrap");
// node_modules/element-plus/es/components/focus-trap/src/utils.mjs
var focusReason = ref();
var lastUserFocusTimestamp = ref(0);
var lastAutomatedFocusTimestamp = ref(0);
var focusReasonUserCount = 0;
var obtainAllFocusableElements2 = (element) => {
const nodes = [];
const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
acceptNode: (node) => {
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
if (node.disabled || node.hidden || isHiddenInput)
return NodeFilter.FILTER_SKIP;
return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
while (walker.nextNode()) nodes.push(walker.currentNode);
return nodes;
};
var getVisibleElement = (elements, container) => {
for (const element of elements) {
if (!isHidden(element, container)) return element;
}
};
var isHidden = (element, container) => {
if (false) return false;
if (getComputedStyle(element).visibility === "hidden") return true;
while (element) {
if (container && element === container) return false;
if (getComputedStyle(element).display === "none") return true;
element = element.parentElement;
}
return false;
};
var getEdges = (container) => {
const focusable = obtainAllFocusableElements2(container);
const first = getVisibleElement(focusable, container);
const last = getVisibleElement(focusable.reverse(), container);
return [first, last];
};
var isSelectable = (element) => {
return element instanceof HTMLInputElement && "select" in element;
};
var tryFocus = (element, shouldSelect) => {
if (element) {
const prevFocusedElement = document.activeElement;
focusElement(element, { preventScroll: true });
lastAutomatedFocusTimestamp.value = window.performance.now();
if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
element.select();
}
}
};
function removeFromStack(list, item) {
const copy = [...list];
const idx = list.indexOf(item);
if (idx !== -1) {
copy.splice(idx, 1);
}
return copy;
}
var createFocusableStack = () => {
let stack = [];
const push = (layer) => {
const currentLayer = stack[0];
if (currentLayer && layer !== currentLayer) {
currentLayer.pause();
}
stack = removeFromStack(stack, layer);
stack.unshift(layer);
};
const remove = (layer) => {
var _a, _b;
stack = removeFromStack(stack, layer);
(_b = (_a = stack[0]) == null ? void 0 : _a.resume) == null ? void 0 : _b.call(_a);
};
return {
push,
remove
};
};
var focusFirstDescendant = (elements, shouldSelect = false) => {
const prevFocusedElement = document.activeElement;
for (const element of elements) {
tryFocus(element, shouldSelect);
if (document.activeElement !== prevFocusedElement) return;
}
};
var focusableStack = createFocusableStack();
var isFocusCausedByUserEvent = () => {
return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
};
var notifyFocusReasonPointer = () => {
focusReason.value = "pointer";
lastUserFocusTimestamp.value = window.performance.now();
};
var notifyFocusReasonKeydown = () => {
focusReason.value = "keyboard";
lastUserFocusTimestamp.value = window.performance.now();
};
var useFocusReason = () => {
onMounted(() => {
if (focusReasonUserCount === 0) {
document.addEventListener("mousedown", notifyFocusReasonPointer);
document.addEventListener("touchstart", notifyFocusReasonPointer);
document.addEventListener("keydown", notifyFocusReasonKeydown);
}
focusReasonUserCount++;
});
onBeforeUnmount(() => {
focusReasonUserCount--;
if (focusReasonUserCount <= 0) {
document.removeEventListener("mousedown", notifyFocusReasonPointer);
document.removeEventListener("touchstart", notifyFocusReasonPointer);
document.removeEventListener("keydown", notifyFocusReasonKeydown);
}
});
return {
focusReason,
lastUserFocusTimestamp,
lastAutomatedFocusTimestamp
};
};
var createFocusOutPreventedEvent = (detail) => {
return new CustomEvent(FOCUSOUT_PREVENTED, {
...FOCUSOUT_PREVENTED_OPTS,
detail
});
};
// node_modules/element-plus/es/utils/dom/event.mjs
var composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
const handleEvent = (event) => {
const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
if (checkForDefaultPrevented === false || !shouldPrevent) {
return oursHandler == null ? void 0 : oursHandler(event);
}
};
return handleEvent;
};
var whenMouse = (handler) => {
return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
};
var getEventCode = (event) => {
if (event.code && event.code !== "Unidentified") return event.code;
const key = getEventKey(event);
if (key) {
if (Object.values(EVENT_CODE).includes(key)) return key;
switch (key) {
case " ":
return EVENT_CODE.space;
default:
return "";
}
}
return "";
};
var getEventKey = (event) => {
let key = event.key && event.key !== "Unidentified" ? event.key : "";
if (!key && event.type === "keyup" && isAndroid()) {
const target2 = event.target;
key = target2.value.charAt(target2.selectionStart - 1);
}
return key;
};
// node_modules/element-plus/es/hooks/use-escape-keydown/index.mjs
var registeredEscapeHandlers = [];
var cachedHandler = (event) => {
const code = getEventCode(event);
if (code === EVENT_CODE.esc) {
registeredEscapeHandlers.forEach(
(registeredHandler) => registeredHandler(event)
);
}
};
var useEscapeKeydown = (handler) => {
onMounted(() => {
if (registeredEscapeHandlers.length === 0) {
document.addEventListener("keydown", cachedHandler);
}
if (isClient) registeredEscapeHandlers.push(handler);
});
onBeforeUnmount(() => {
registeredEscapeHandlers = registeredEscapeHandlers.filter(
(registeredHandler) => registeredHandler !== handler
);
if (registeredEscapeHandlers.length === 0) {
if (isClient) document.removeEventListener("keydown", cachedHandler);
}
});
};
// node_modules/element-plus/es/components/focus-trap/src/focus-trap.vue2.mjs
var _sfc_main12 = defineComponent({
name: "ElFocusTrap",
inheritAttrs: false,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
ON_TRAP_FOCUS_EVT,
ON_RELEASE_FOCUS_EVT,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(props2, { emit }) {
const forwardRef = ref();
let lastFocusBeforeTrapped;
let lastFocusAfterTrapped;
const { focusReason: focusReason2 } = useFocusReason();
useEscapeKeydown((event) => {
if (props2.trapped && !focusLayer.paused) {
emit("release-requested", event);
}
});
const focusLayer = {
paused: false,
pause() {
this.paused = true;
},
resume() {
this.paused = false;
}
};
const onKeydown = (e) => {
if (!props2.loop && !props2.trapped) return;
if (focusLayer.paused) return;
const { altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
const { loop } = props2;
const code = getEventCode(e);
const isTabbing = code === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
const currentFocusingEl = document.activeElement;
if (isTabbing && currentFocusingEl) {
const container = currentTarget;
const [first, last] = getEdges(container);
const isTabbable = first && last;
if (!isTabbable) {
if (currentFocusingEl === container) {
const focusoutPreventedEvent = createFocusOutPreventedEvent({
focusReason: focusReason2.value
});
emit("focusout-prevented", focusoutPreventedEvent);
if (!focusoutPreventedEvent.defaultPrevented) {
e.preventDefault();
}
}
} else {
if (!shiftKey && currentFocusingEl === last) {
const focusoutPreventedEvent = createFocusOutPreventedEvent({
focusReason: focusReason2.value
});
emit("focusout-prevented", focusoutPreventedEvent);
if (!focusoutPreventedEvent.defaultPrevented) {
e.preventDefault();
if (loop) tryFocus(first, true);
}
} else if (shiftKey && [first, container].includes(currentFocusingEl)) {
const focusoutPreventedEvent = createFocusOutPreventedEvent({
focusReason: focusReason2.value
});
emit("focusout-prevented", focusoutPreventedEvent);
if (!focusoutPreventedEvent.defaultPrevented) {
e.preventDefault();
if (loop) tryFocus(last, true);
}
}
}
}
};
provide(FOCUS_TRAP_INJECTION_KEY, {
focusTrapRef: forwardRef,
onKeydown
});
watch(
() => props2.focusTrapEl,
(focusTrapEl) => {
if (focusTrapEl) {
forwardRef.value = focusTrapEl;
}
},
{ immediate: true }
);
watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
if (forwardRef2) {
forwardRef2.addEventListener("keydown", onKeydown);
forwardRef2.addEventListener("focusin", onFocusIn);
forwardRef2.addEventListener("focusout", onFocusOut);
}
if (oldForwardRef) {
oldForwardRef.removeEventListener("keydown", onKeydown);
oldForwardRef.removeEventListener("focusin", onFocusIn);
oldForwardRef.removeEventListener("focusout", onFocusOut);
}
});
const trapOnFocus = (e) => {
emit(ON_TRAP_FOCUS_EVT, e);
};
const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
const onFocusIn = (e) => {
const trapContainer = unref(forwardRef);
if (!trapContainer) return;
const target2 = e.target;
const relatedTarget = e.relatedTarget;
const isFocusedInTrap = target2 && trapContainer.contains(target2);
if (!props2.trapped) {
const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
if (!isPrevFocusedInTrap) {
lastFocusBeforeTrapped = relatedTarget;
}
}
if (isFocusedInTrap) emit("focusin", e);
if (focusLayer.paused) return;
if (props2.trapped) {
if (isFocusedInTrap) {
lastFocusAfterTrapped = target2;
} else {
tryFocus(lastFocusAfterTrapped, true);
}
}
};
const onFocusOut = (e) => {
const trapContainer = unref(forwardRef);
if (focusLayer.paused || !trapContainer) return;
if (props2.trapped) {
const relatedTarget = e.relatedTarget;
if (!isNil_default(relatedTarget) && !trapContainer.contains(relatedTarget)) {
setTimeout(() => {
if (!focusLayer.paused && props2.trapped) {
const focusoutPreventedEvent = createFocusOutPreventedEvent({
focusReason: focusReason2.value
});
emit("focusout-prevented", focusoutPreventedEvent);
if (!focusoutPreventedEvent.defaultPrevented) {
tryFocus(lastFocusAfterTrapped, true);
}
}
}, 0);
}
} else {
const target2 = e.target;
const isFocusedInTrap = target2 && trapContainer.contains(target2);
if (!isFocusedInTrap) emit("focusout", e);
}
};
async function startTrap() {
await nextTick();
const trapContainer = unref(forwardRef);
if (trapContainer) {
focusableStack.push(focusLayer);
const prevFocusedElement = trapContainer.contains(
document.activeElement
) ? lastFocusBeforeTrapped : document.activeElement;
lastFocusBeforeTrapped = prevFocusedElement;
const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
if (!isPrevFocusContained) {
const focusEvent = new Event(
FOCUS_AFTER_TRAPPED,
FOCUS_AFTER_TRAPPED_OPTS
);
trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
trapContainer.dispatchEvent(focusEvent);
if (!focusEvent.defaultPrevented) {
nextTick(() => {
let focusStartEl = props2.focusStartEl;
if (!isString(focusStartEl)) {
tryFocus(focusStartEl);
if (document.activeElement !== focusStartEl) {
focusStartEl = "first";
}
}
if (focusStartEl === "first") {
focusFirstDescendant(
obtainAllFocusableElements2(trapContainer),
true
);
}
if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
tryFocus(trapContainer);
}
});
}
}
}
}
function stopTrap() {
const trapContainer = unref(forwardRef);
if (trapContainer) {
trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
...FOCUS_AFTER_TRAPPED_OPTS,
detail: {
focusReason: focusReason2.value
}
});
trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
trapContainer.dispatchEvent(releasedEvent);
if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
}
trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
focusableStack.remove(focusLayer);
lastFocusBeforeTrapped = null;
lastFocusAfterTrapped = null;
}
}
onMounted(() => {
if (props2.trapped) {
startTrap();
}
watch(
() => props2.trapped,
(trapped) => {
if (trapped) {
startTrap();
} else {
stopTrap();
}
}
);
});
onBeforeUnmount(() => {
if (props2.trapped) {
stopTrap();
}
if (forwardRef.value) {
forwardRef.value.removeEventListener("keydown", onKeydown);
forwardRef.value.removeEventListener("focusin", onFocusIn);
forwardRef.value.removeEventListener("focusout", onFocusOut);
forwardRef.value = void 0;
}
lastFocusBeforeTrapped = null;
lastFocusAfterTrapped = null;
});
return {
onKeydown
};
}
});
// node_modules/element-plus/es/_virtual/_plugin-vue_export-helper.mjs
var _export_sfc = (sfc, props2) => {
const target2 = sfc.__vccOpts || sfc;
for (const [key, val] of props2) {
target2[key] = val;
}
return target2;
};
// node_modules/element-plus/es/components/focus-trap/src/focus-trap.vue.mjs
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
}
var ElFocusTrap = _export_sfc(_sfc_main12, [["render", _sfc_render]]);
// node_modules/element-plus/es/components/popper/src/composables/use-focus-trap.mjs
var usePopperContentFocusTrap = (props2, emit) => {
const trapped = ref(false);
const focusStartRef = ref();
const onFocusAfterTrapped = () => {
emit("focus");
};
const onFocusAfterReleased = (event) => {
var _a;
if (((_a = event.detail) == null ? void 0 : _a.focusReason) !== "pointer") {
focusStartRef.value = "first";
emit("blur");
}
};
const onFocusInTrap = (event) => {
if (props2.visible && !trapped.value) {
if (event.target) {
focusStartRef.value = event.target;
}
trapped.value = true;
}
};
const onFocusoutPrevented = (event) => {
if (!props2.trapping) {
if (event.detail.focusReason === "pointer") {
event.preventDefault();
}
trapped.value = false;
}
};
const onReleaseRequested = () => {
trapped.value = false;
emit("close");
};
onBeforeUnmount(() => {
focusStartRef.value = void 0;
});
return {
focusStartRef,
trapped,
onFocusAfterReleased,
onFocusAfterTrapped,
onFocusInTrap,
onFocusoutPrevented,
onReleaseRequested
};
};
// node_modules/element-plus/es/components/popper/src/utils.mjs
var buildPopperOptions = (props2, modifiers = []) => {
const { placement, strategy, popperOptions } = props2;
const options = {
placement,
strategy,
...popperOptions,
modifiers: [...genModifiers(props2), ...modifiers]
};
deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers);
return options;
};
var unwrapMeasurableEl = ($el) => {
if (!isClient) return;
return unrefElement($el);
};
function genModifiers(options) {
const { offset: offset3, gpuAcceleration, fallbackPlacements } = options;
return [
{
name: "offset",
options: {
offset: [0, offset3 != null ? offset3 : 12]
}
},
{
name: "preventOverflow",
options: {
padding: {
top: 0,
bottom: 0,
left: 0,
right: 0
}
}
},
{
name: "flip",
options: {
padding: 5,
fallbackPlacements
}
},
{
name: "computeStyles",
options: {
gpuAcceleration
}
}
];
}
function deriveExtraModifiers(options, modifiers) {
if (modifiers) {
options.modifiers = [...options.modifiers, ...modifiers != null ? modifiers : []];
}
}
// node_modules/element-plus/es/hooks/use-popper/index.mjs
var usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
const stateUpdater = {
name: "updateState",
enabled: true,
phase: "write",
fn: ({ state }) => {
const derivedState = deriveState(state);
Object.assign(states.value, derivedState);
},
requires: ["computeStyles"]
};
const options = computed(() => {
const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
return {
onFirstUpdate,
placement: placement || "bottom",
strategy: strategy || "absolute",
modifiers: [
...modifiers || [],
stateUpdater,
{ name: "applyStyles", enabled: false }
]
};
});
const instanceRef = shallowRef();
const states = ref({
styles: {
popper: {
position: unref(options).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
});
const destroy = () => {
if (!instanceRef.value) return;
instanceRef.value.destroy();
instanceRef.value = void 0;
};
watch(
options,
(newOptions) => {
const instance = unref(instanceRef);
if (instance) {
instance.setOptions(newOptions);
}
},
{
deep: true
}
);
watch(
[referenceElementRef, popperElementRef],
([referenceElement, popperElement]) => {
destroy();
if (!referenceElement || !popperElement) return;
instanceRef.value = wn(
referenceElement,
popperElement,
unref(options)
);
}
);
onBeforeUnmount(() => {
destroy();
});
return {
state: computed(() => {
var _a;
return { ...((_a = unref(instanceRef)) == null ? void 0 : _a.state) || {} };
}),
styles: computed(() => unref(states).styles),
attributes: computed(() => unref(states).attributes),
update: () => {
var _a;
return (_a = unref(instanceRef)) == null ? void 0 : _a.update();
},
forceUpdate: () => {
var _a;
return (_a = unref(instanceRef)) == null ? void 0 : _a.forceUpdate();
},
// Preventing end users from modifying the instance.
instanceRef: computed(() => unref(instanceRef))
};
};
function deriveState(state) {
const elements = Object.keys(state.elements);
const styles = fromPairs_default(
elements.map(
(element) => [element, state.styles[element] || {}]
)
);
const attributes2 = fromPairs_default(
elements.map(
(element) => [element, state.attributes[element]]
)
);
return {
styles,
attributes: attributes2
};
}
// node_modules/element-plus/es/components/popper/src/composables/use-content.mjs
var DEFAULT_ARROW_OFFSET = 0;
var usePopperContent = (props2) => {
const { popperInstanceRef, contentRef, triggerRef: triggerRef2, role } = inject(
POPPER_INJECTION_KEY,
void 0
);
const arrowRef = ref();
const arrowOffset = computed(() => props2.arrowOffset);
const eventListenerModifier = computed(() => {
return {
name: "eventListeners",
enabled: !!props2.visible
};
});
const arrowModifier = computed(() => {
var _a;
const arrowEl = unref(arrowRef);
const offset3 = (_a = unref(arrowOffset)) != null ? _a : DEFAULT_ARROW_OFFSET;
return {
name: "arrow",
enabled: !isUndefined_default(arrowEl),
options: {
element: arrowEl,
padding: offset3
}
};
});
const options = computed(() => {
return {
onFirstUpdate: () => {
update();
},
...buildPopperOptions(props2, [
unref(arrowModifier),
unref(eventListenerModifier)
])
};
});
const computedReference = computed(
() => unwrapMeasurableEl(props2.referenceEl) || unref(triggerRef2)
);
const { attributes: attributes2, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options);
watch(instanceRef, (instance) => popperInstanceRef.value = instance, {
flush: "sync"
});
onMounted(() => {
watch(
() => {
var _a, _b;
return (_b = (_a = unref(computedReference)) == null ? void 0 : _a.getBoundingClientRect) == null ? void 0 : _b.call(_a);
},
() => {
update();
}
);
});
onBeforeUnmount(() => {
popperInstanceRef.value = void 0;
});
return {
attributes: attributes2,
arrowRef,
contentRef,
instanceRef,
state,
styles,
role,
forceUpdate,
update
};
};
// node_modules/element-plus/es/components/popper/src/composables/use-content-dom.mjs
var usePopperContentDOM = (props2, {
attributes: attributes2,
styles,
role
}) => {
const { nextZIndex } = useZIndex();
const ns = useNamespace("popper");
const contentAttrs = computed(() => unref(attributes2).popper);
const contentZIndex = ref(
isNumber(props2.zIndex) ? props2.zIndex : nextZIndex()
);
const contentClass = computed(() => [
ns.b(),
ns.is("pure", props2.pure),
ns.is(props2.effect),
props2.popperClass
]);
const contentStyle = computed(() => {
return [
{ zIndex: unref(contentZIndex) },
unref(styles).popper,
props2.popperStyle || {}
];
});
const ariaModal = computed(
() => role.value === "dialog" ? "false" : void 0
);
const arrowStyle = computed(
() => unref(styles).arrow || {}
);
const updateZIndex = () => {
contentZIndex.value = isNumber(props2.zIndex) ? props2.zIndex : nextZIndex();
};
return {
ariaModal,
arrowStyle,
contentAttrs,
contentClass,
contentStyle,
contentZIndex,
updateZIndex
};
};
// node_modules/element-plus/es/components/popper/src/content.vue2.mjs
var _sfc_main13 = defineComponent({
...{
name: "ElPopperContent"
},
__name: "content",
props: popperContentProps,
emits: popperContentEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const emit = __emit;
const props2 = __props;
const {
focusStartRef,
trapped,
onFocusAfterReleased,
onFocusAfterTrapped,
onFocusInTrap,
onFocusoutPrevented,
onReleaseRequested
} = usePopperContentFocusTrap(props2, emit);
const { attributes: attributes2, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props2);
const {
ariaModal,
arrowStyle,
contentAttrs,
contentClass,
contentStyle,
updateZIndex
} = usePopperContentDOM(props2, {
styles,
attributes: attributes2,
role
});
const formItemContext = inject(formItemContextKey, void 0);
provide(POPPER_CONTENT_INJECTION_KEY, {
arrowStyle,
arrowRef
});
if (formItemContext) {
provide(formItemContextKey, {
...formItemContext,
addInputId: NOOP,
removeInputId: NOOP
});
}
let triggerTargetAriaStopWatch = void 0;
const updatePopper = (shouldUpdateZIndex = true) => {
update();
shouldUpdateZIndex && updateZIndex();
};
const togglePopperAlive = () => {
updatePopper(false);
if (props2.visible && props2.focusOnShow) {
trapped.value = true;
} else if (props2.visible === false) {
trapped.value = false;
}
};
onMounted(() => {
watch(
() => props2.triggerTargetEl,
(triggerTargetEl, prevTriggerTargetEl) => {
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
triggerTargetAriaStopWatch = void 0;
const el = unref(triggerTargetEl || contentRef.value);
const prevEl = unref(prevTriggerTargetEl || contentRef.value);
if (isElement(el)) {
triggerTargetAriaStopWatch = watch(
[role, () => props2.ariaLabel, ariaModal, () => props2.id],
(watches) => {
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
isNil_default(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
});
},
{ immediate: true }
);
}
if (prevEl !== el && isElement(prevEl)) {
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
prevEl.removeAttribute(key);
});
}
},
{ immediate: true }
);
watch(() => props2.visible, togglePopperAlive, { immediate: true });
});
onBeforeUnmount(() => {
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
triggerTargetAriaStopWatch = void 0;
contentRef.value = void 0;
});
__expose({
/**
* @description popper content element
*/
popperContentRef: contentRef,
/**
* @description popperjs instance
*/
popperInstanceRef: instanceRef,
/**
* @description method for updating popper
*/
updatePopper,
/**
* @description content style
*/
contentStyle
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
mergeProps({
ref_key: "contentRef",
ref: contentRef
}, unref(contentAttrs), {
style: unref(contentStyle),
class: unref(contentClass),
tabindex: "-1",
onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
}),
[
createVNode(unref(ElFocusTrap), {
loop: __props.loop,
trapped: unref(trapped),
"trap-on-focus-in": true,
"focus-trap-el": unref(contentRef),
"focus-start-el": unref(focusStartRef),
onFocusAfterTrapped: unref(onFocusAfterTrapped),
onFocusAfterReleased: unref(onFocusAfterReleased),
onFocusin: unref(onFocusInTrap),
onFocusoutPrevented: unref(onFocusoutPrevented),
onReleaseRequested: unref(onReleaseRequested)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["loop", "trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
],
16
/* FULL_PROPS */
);
};
}
});
// node_modules/element-plus/es/components/popper/index.mjs
var ElPopper = withInstall(_sfc_main9);
// node_modules/element-plus/es/components/tooltip/src/constants.mjs
var TOOLTIP_INJECTION_KEY = /* @__PURE__ */ Symbol("elTooltip");
// node_modules/element-plus/es/components/tooltip/src/utils.mjs
var isTriggerType = (trigger, type) => {
if (isArray(trigger)) {
return trigger.includes(type);
}
return trigger === type;
};
var whenTrigger = (trigger, type, handler) => {
return (e) => {
isTriggerType(unref(trigger), type) && handler(e);
};
};
// node_modules/element-plus/es/components/tooltip/src/trigger.vue2.mjs
var _sfc_main14 = defineComponent({
...{
name: "ElTooltipTrigger"
},
__name: "trigger",
props: useTooltipTriggerProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const ns = useNamespace("tooltip");
const { controlled, id, open, onOpen, onClose, onToggle } = inject(
TOOLTIP_INJECTION_KEY,
void 0
);
const triggerRef2 = ref(null);
const stopWhenControlledOrDisabled = () => {
if (unref(controlled) || props2.disabled) {
return true;
}
};
const trigger = toRef(props2, "trigger");
const onMouseenter = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "hover", (e) => {
onOpen(e);
if (props2.focusOnTarget && e.target) {
nextTick(() => {
focusElement(e.target, { preventScroll: true });
});
}
})
);
const onMouseleave = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "hover", onClose)
);
const onClick = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "click", (e) => {
if (e.button === 0) {
onToggle(e);
}
})
);
const onFocus = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "focus", onOpen)
);
const onBlur = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "focus", onClose)
);
const onContextMenu = composeEventHandlers(
stopWhenControlledOrDisabled,
whenTrigger(trigger, "contextmenu", (e) => {
e.preventDefault();
onToggle(e);
})
);
const onKeydown = composeEventHandlers(
stopWhenControlledOrDisabled,
(e) => {
const code = getEventCode(e);
if (props2.triggerKeys.includes(code)) {
e.preventDefault();
onToggle(e);
}
}
);
__expose({
/**
* @description trigger element
*/
triggerRef: triggerRef2
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(_sfc_main11), {
id: unref(id),
"virtual-ref": __props.virtualRef,
open: unref(open),
"virtual-triggering": __props.virtualTriggering,
class: normalizeClass(unref(ns).e("trigger")),
onBlur: unref(onBlur),
onClick: unref(onClick),
onContextmenu: unref(onContextMenu),
onFocus: unref(onFocus),
onMouseenter: unref(onMouseenter),
onMouseleave: unref(onMouseleave),
onKeydown: unref(onKeydown)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
};
}
});
// node_modules/element-plus/es/hooks/use-popper-container/index.mjs
var usePopperContainerId = () => {
const namespace = useGetDerivedNamespace();
const idInjection = useIdInjection();
const id = computed(() => {
return `${namespace.value}-popper-container-${idInjection.prefix}`;
});
const selector = computed(() => `#${id.value}`);
return {
id,
selector
};
};
var createContainer = (id) => {
const container = document.createElement("div");
container.id = id;
document.body.appendChild(container);
return container;
};
var usePopperContainer = () => {
const { id, selector } = usePopperContainerId();
onBeforeMount(() => {
if (!isClient) return;
if (!document.body.querySelector(selector.value)) {
createContainer(id.value);
}
});
return {
id,
selector
};
};
// node_modules/element-plus/es/utils/arrays.mjs
var unique = (arr) => [...new Set(arr)];
var extractFirst = (arr) => {
return isArray(arr) ? arr[0] : arr;
};
var castArray = (arr) => {
if (!arr && arr !== 0) return [];
return isArray(arr) ? arr : [arr];
};
// node_modules/element-plus/es/components/tooltip/src/content.vue2.mjs
var _sfc_main15 = defineComponent({
...{
name: "ElTooltipContent",
inheritAttrs: false
},
__name: "content",
props: useTooltipContentProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const { selector } = usePopperContainerId();
const ns = useNamespace("tooltip");
const contentRef = ref();
const popperContentRef = computedEager(() => {
var _a;
return (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
});
let stopHandle;
const {
controlled,
id,
open,
trigger,
onClose,
onOpen,
onShow,
onHide,
onBeforeShow,
onBeforeHide
} = inject(TOOLTIP_INJECTION_KEY, void 0);
const transitionClass = computed(() => {
return props2.transition || `${ns.namespace.value}-fade-in-linear`;
});
const persistentRef = computed(() => {
if (false) {
if (!process.env.RUN_TEST_WITH_PERSISTENT) {
return true;
}
}
return props2.persistent;
});
onBeforeUnmount(() => {
stopHandle == null ? void 0 : stopHandle();
});
const shouldRender = computed(() => {
return unref(persistentRef) ? true : unref(open);
});
const shouldShow = computed(() => {
return props2.disabled ? false : unref(open);
});
const appendTo = computed(() => {
return props2.appendTo || selector.value;
});
const contentStyle = computed(() => {
var _a;
return (_a = props2.style) != null ? _a : {};
});
const ariaHidden = ref(true);
const onTransitionLeave = () => {
onHide();
isFocusInsideContent() && focusElement(document.body, { preventScroll: true });
ariaHidden.value = true;
};
const stopWhenControlled = () => {
if (unref(controlled)) return true;
};
const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
if (props2.enterable && isTriggerType(unref(trigger), "hover")) {
onOpen();
}
});
const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
if (isTriggerType(unref(trigger), "hover")) {
onClose();
}
});
const onBeforeEnter = () => {
var _a, _b;
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
onBeforeShow == null ? void 0 : onBeforeShow();
};
const onBeforeLeave = () => {
onBeforeHide == null ? void 0 : onBeforeHide();
};
const onAfterShow = () => {
onShow();
};
const onBlur = () => {
if (!props2.virtualTriggering) {
onClose();
}
};
const isFocusInsideContent = (event) => {
var _a;
const popperContent = (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
const activeElement = (event == null ? void 0 : event.relatedTarget) || document.activeElement;
return popperContent == null ? void 0 : popperContent.contains(activeElement);
};
watch(
() => unref(open),
(val) => {
if (!val) {
stopHandle == null ? void 0 : stopHandle();
} else {
ariaHidden.value = false;
stopHandle = onClickOutside(
popperContentRef,
() => {
if (unref(controlled)) return;
const needClose = castArray(unref(trigger)).every((item) => {
return item !== "hover" && item !== "focus";
});
if (needClose) {
onClose();
}
},
{ detectIframe: true }
);
}
},
{
flush: "post"
}
);
watch(
() => props2.content,
() => {
var _a, _b;
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
}
);
__expose({
/**
* @description el-popper-content component instance
*/
contentRef,
/**
* @description validate current focus event is trigger inside el-popper-content
*/
isFocusInsideContent
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTeleport), {
disabled: !__props.teleported,
to: appendTo.value
}, {
default: withCtx(() => [
shouldRender.value || !ariaHidden.value ? (openBlock(), createBlock(Transition, {
key: 0,
name: transitionClass.value,
appear: !persistentRef.value,
onAfterLeave: onTransitionLeave,
onBeforeEnter,
onAfterEnter: onAfterShow,
onBeforeLeave,
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createVNode(unref(_sfc_main13), mergeProps({
id: unref(id),
ref_key: "contentRef",
ref: contentRef
}, _ctx.$attrs, {
"aria-label": __props.ariaLabel,
"aria-hidden": ariaHidden.value,
"boundaries-padding": __props.boundariesPadding,
"fallback-placements": __props.fallbackPlacements,
"gpu-acceleration": __props.gpuAcceleration,
offset: __props.offset,
placement: __props.placement,
"popper-options": __props.popperOptions,
"arrow-offset": __props.arrowOffset,
strategy: __props.strategy,
effect: __props.effect,
enterable: __props.enterable,
pure: __props.pure,
"popper-class": __props.popperClass,
"popper-style": [__props.popperStyle, contentStyle.value],
"reference-el": __props.referenceEl,
"trigger-target-el": __props.triggerTargetEl,
visible: shouldShow.value,
"z-index": __props.zIndex,
loop: __props.loop,
onMouseenter: unref(onContentEnter),
onMouseleave: unref(onContentLeave),
onBlur,
onClose: unref(onClose)
}), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "arrow-offset", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "loop", "onMouseenter", "onMouseleave", "onClose"]), [
[vShow, shouldShow.value]
])
]),
_: 3
/* FORWARDED */
}, 8, ["name", "appear"])) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "to"]);
};
}
});
// node_modules/element-plus/es/components/tooltip/src/tooltip.vue2.mjs
var _hoisted_13 = ["innerHTML"];
var _hoisted_22 = { key: 1 };
var _sfc_main16 = defineComponent({
...{
name: "ElTooltip"
},
__name: "tooltip",
props: useTooltipProps,
emits: tooltipEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
usePopperContainer();
const ns = useNamespace("tooltip");
const id = useId();
const popperRef = ref();
const contentRef = ref();
const updatePopper = () => {
var _a;
const popperComponent = unref(popperRef);
if (popperComponent) {
(_a = popperComponent.popperInstanceRef) == null ? void 0 : _a.update();
}
};
const open = ref(false);
const toggleReason = ref();
const { show, hide: hide2, hasUpdateHandler } = useTooltipModelToggle({
indicator: open,
toggleReason
});
const { onOpen, onClose } = useDelayedToggle({
showAfter: toRef(props2, "showAfter"),
hideAfter: toRef(props2, "hideAfter"),
autoClose: toRef(props2, "autoClose"),
open: show,
close: hide2
});
const controlled = computed(
() => isBoolean(props2.visible) && !hasUpdateHandler.value
);
const kls = computed(() => {
return [ns.b(), props2.popperClass];
});
provide(TOOLTIP_INJECTION_KEY, {
controlled,
id,
open: readonly(open),
trigger: toRef(props2, "trigger"),
onOpen,
onClose,
onToggle: (event) => {
if (unref(open)) {
onClose(event);
} else {
onOpen(event);
}
},
onShow: () => {
emit("show", toggleReason.value);
},
onHide: () => {
emit("hide", toggleReason.value);
},
onBeforeShow: () => {
emit("before-show", toggleReason.value);
},
onBeforeHide: () => {
emit("before-hide", toggleReason.value);
},
updatePopper
});
watch(
() => props2.disabled,
(disabled) => {
if (disabled && open.value) {
open.value = false;
}
}
);
const isFocusInsideContent = (event) => {
var _a;
return (_a = contentRef.value) == null ? void 0 : _a.isFocusInsideContent(event);
};
onDeactivated(() => open.value && hide2());
onBeforeUnmount(() => {
toggleReason.value = void 0;
});
__expose({
/**
* @description el-popper component instance
*/
popperRef,
/**
* @description el-tooltip-content component instance
*/
contentRef,
/**
* @description validate current focus event is trigger inside el-tooltip-content
*/
isFocusInsideContent,
/**
* @description update el-popper component instance
*/
updatePopper,
/**
* @description expose onOpen function to mange el-tooltip open state
*/
onOpen,
/**
* @description expose onClose function to manage el-tooltip close state
*/
onClose,
/**
* @description expose hide function
*/
hide: hide2
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElPopper), {
ref_key: "popperRef",
ref: popperRef,
role: __props.role
}, {
default: withCtx(() => [
createVNode(_sfc_main14, {
disabled: __props.disabled,
trigger: __props.trigger,
"trigger-keys": __props.triggerKeys,
"virtual-ref": __props.virtualRef,
"virtual-triggering": __props.virtualTriggering,
"focus-on-target": __props.focusOnTarget
}, {
default: withCtx(() => [
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering", "focus-on-target"]),
createVNode(_sfc_main15, {
ref_key: "contentRef",
ref: contentRef,
"aria-label": __props.ariaLabel,
"boundaries-padding": __props.boundariesPadding,
content: __props.content,
disabled: __props.disabled,
effect: __props.effect,
enterable: __props.enterable,
"fallback-placements": __props.fallbackPlacements,
"hide-after": __props.hideAfter,
"gpu-acceleration": __props.gpuAcceleration,
offset: __props.offset,
persistent: __props.persistent,
"popper-class": kls.value,
"popper-style": __props.popperStyle,
placement: __props.placement,
"popper-options": __props.popperOptions,
"arrow-offset": __props.arrowOffset,
pure: __props.pure,
"raw-content": __props.rawContent,
"reference-el": __props.referenceEl,
"trigger-target-el": __props.triggerTargetEl,
"show-after": __props.showAfter,
strategy: __props.strategy,
teleported: __props.teleported,
transition: __props.transition,
"virtual-triggering": __props.virtualTriggering,
"z-index": __props.zIndex,
"append-to": __props.appendTo,
loop: __props.loop
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "content", {}, () => [
__props.rawContent ? (openBlock(), createElementBlock("span", {
key: 0,
innerHTML: __props.content
}, null, 8, _hoisted_13)) : (openBlock(), createElementBlock(
"span",
_hoisted_22,
toDisplayString(__props.content),
1
/* TEXT */
))
]),
__props.showArrow ? (openBlock(), createBlock(unref(_sfc_main10), { key: 0 })) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "arrow-offset", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to", "loop"])
]),
_: 3
/* FORWARDED */
}, 8, ["role"]);
};
}
});
// node_modules/element-plus/es/components/tooltip/index.mjs
var ElTooltip = withInstall(_sfc_main16);
// node_modules/element-plus/es/components/autocomplete/src/autocomplete.vue2.mjs
var _hoisted_14 = ["aria-expanded", "aria-owns"];
var _hoisted_23 = { key: 0 };
var _hoisted_3 = ["id", "aria-selected", "onClick"];
var COMPONENT_NAME5 = "ElAutocomplete";
var _sfc_main17 = defineComponent({
...{
name: COMPONENT_NAME5,
inheritAttrs: false
},
__name: "autocomplete",
props: autocompleteProps,
emits: autocompleteEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const passInputProps = computed(() => pick_default(props2, Object.keys(inputProps)));
const rawAttrs = useAttrs();
const disabled = useFormDisabled();
const ns = useNamespace("autocomplete");
const inputRef = ref();
const regionRef = ref();
const popperRef = ref();
const listboxRef = ref();
let readonly2 = false;
let ignoreFocusEvent = false;
const suggestions = ref([]);
const highlightedIndex = ref(-1);
const dropdownWidth = ref("");
const activated = ref(false);
const suggestionDisabled = ref(false);
const loading = ref(false);
const listboxId = useId();
const styles = computed(() => rawAttrs.style);
const suggestionVisible = computed(() => {
const isValidData = suggestions.value.length > 0;
return (isValidData || loading.value) && activated.value;
});
const suggestionLoading = computed(() => !props2.hideLoading && loading.value);
const refInput = computed(() => {
if (inputRef.value) {
return Array.from(
inputRef.value.$el.querySelectorAll("input")
);
}
return [];
});
const onSuggestionShow = () => {
if (suggestionVisible.value) {
dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
}
};
const onHide = () => {
highlightedIndex.value = -1;
};
const getData = async (queryString) => {
if (suggestionDisabled.value) return;
const cb = (suggestionList) => {
loading.value = false;
if (suggestionDisabled.value) return;
if (isArray(suggestionList)) {
suggestions.value = suggestionList;
highlightedIndex.value = props2.highlightFirstItem ? 0 : -1;
} else {
throwError(COMPONENT_NAME5, "autocomplete suggestions must be an array");
}
};
loading.value = true;
if (isArray(props2.fetchSuggestions)) {
cb(props2.fetchSuggestions);
} else {
const result = await props2.fetchSuggestions(queryString, cb);
if (isArray(result)) cb(result);
}
};
const debounce = computed(() => props2.debounce);
const debouncedGetData = useDebounceFn(getData, debounce);
const handleInput = (value) => {
const valuePresented = !!value;
emit(INPUT_EVENT, value);
emit(UPDATE_MODEL_EVENT, value);
suggestionDisabled.value = false;
activated.value || (activated.value = valuePresented);
if (!props2.triggerOnFocus && !value) {
suggestionDisabled.value = true;
suggestions.value = [];
return;
}
debouncedGetData(value);
};
const handleMouseDown = (event) => {
var _a;
if (disabled.value) return;
if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
activated.value = true;
}
};
const handleChange = (value) => {
emit(CHANGE_EVENT, value);
};
const handleFocus = (evt) => {
var _a;
if (!ignoreFocusEvent) {
activated.value = true;
emit("focus", evt);
const queryString = (_a = props2.modelValue) != null ? _a : "";
if (props2.triggerOnFocus && !readonly2) {
debouncedGetData(String(queryString));
}
} else {
ignoreFocusEvent = false;
}
};
const handleBlur = (evt) => {
setTimeout(() => {
var _a;
if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) {
ignoreFocusEvent = true;
return;
}
activated.value && close2();
emit("blur", evt);
});
};
const handleClear = () => {
activated.value = false;
emit(UPDATE_MODEL_EVENT, "");
emit("clear");
};
const handleKeyEnter = async () => {
var _a;
if ((_a = inputRef.value) == null ? void 0 : _a.isComposing) {
return;
}
if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) {
handleSelect(suggestions.value[highlightedIndex.value]);
} else {
if (props2.selectWhenUnmatched) {
emit("select", { value: props2.modelValue });
suggestions.value = [];
highlightedIndex.value = -1;
}
activated.value = true;
debouncedGetData(String(props2.modelValue));
}
};
const handleKeyEscape = (evt) => {
if (suggestionVisible.value) {
evt.preventDefault();
evt.stopPropagation();
close2();
}
};
const close2 = () => {
activated.value = false;
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
const handleSelect = async (item) => {
emit(INPUT_EVENT, item[props2.valueKey]);
emit(UPDATE_MODEL_EVENT, item[props2.valueKey]);
emit("select", item);
suggestions.value = [];
highlightedIndex.value = -1;
};
const highlight = (index) => {
var _a, _b;
if (!suggestionVisible.value || loading.value) return;
if (index < 0) {
if (!props2.loopNavigation) {
highlightedIndex.value = -1;
return;
}
index = suggestions.value.length - 1;
}
if (index >= suggestions.value.length) {
index = props2.loopNavigation ? 0 : suggestions.value.length - 1;
}
const [suggestion, suggestionList] = getSuggestionContext();
const highlightItem = suggestionList[index];
const scrollTop = suggestion.scrollTop;
const { offsetTop, scrollHeight } = highlightItem;
if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) {
suggestion.scrollTop = offsetTop + scrollHeight - suggestion.clientHeight;
}
if (offsetTop < scrollTop) {
suggestion.scrollTop = offsetTop;
}
highlightedIndex.value = index;
(_b = (_a = inputRef.value) == null ? void 0 : _a.ref) == null ? void 0 : _b.setAttribute(
"aria-activedescendant",
`${listboxId.value}-item-${highlightedIndex.value}`
);
};
const getSuggestionContext = () => {
const suggestion = regionRef.value.querySelector(
`.${ns.be("suggestion", "wrap")}`
);
const suggestionList = suggestion.querySelectorAll(
`.${ns.be("suggestion", "list")} li`
);
return [suggestion, suggestionList];
};
const stopHandle = onClickOutside(listboxRef, () => {
var _a;
if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) return;
suggestionVisible.value && close2();
});
const handleKeydown = (e) => {
const code = getEventCode(e);
switch (code) {
case EVENT_CODE.up:
e.preventDefault();
highlight(highlightedIndex.value - 1);
break;
case EVENT_CODE.down:
e.preventDefault();
highlight(highlightedIndex.value + 1);
break;
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
e.preventDefault();
handleKeyEnter();
break;
case EVENT_CODE.tab:
close2();
break;
case EVENT_CODE.esc:
handleKeyEscape(e);
break;
case EVENT_CODE.home:
e.preventDefault();
highlight(0);
break;
case EVENT_CODE.end:
e.preventDefault();
highlight(suggestions.value.length - 1);
break;
case EVENT_CODE.pageUp:
e.preventDefault();
highlight(Math.max(0, highlightedIndex.value - 10));
break;
case EVENT_CODE.pageDown:
e.preventDefault();
highlight(
Math.min(suggestions.value.length - 1, highlightedIndex.value + 10)
);
break;
}
};
onBeforeUnmount(() => {
stopHandle == null ? void 0 : stopHandle();
});
onMounted(() => {
var _a;
const inputElement = (_a = inputRef.value) == null ? void 0 : _a.ref;
if (!inputElement) return;
[
{ key: "role", value: "textbox" },
{ key: "aria-autocomplete", value: "list" },
{ key: "aria-controls", value: listboxId.value },
{
key: "aria-activedescendant",
value: `${listboxId.value}-item-${highlightedIndex.value}`
}
].forEach(({ key, value }) => inputElement.setAttribute(key, value));
readonly2 = inputElement.hasAttribute("readonly");
});
__expose({
/** @description the index of the currently highlighted item */
highlightedIndex,
/** @description autocomplete whether activated */
activated,
/** @description remote search loading status */
loading,
/** @description el-input component instance */
inputRef,
/** @description el-tooltip component instance */
popperRef,
/** @description fetch suggestions result */
suggestions,
/** @description triggers when a suggestion is clicked */
handleSelect,
/** @description handle keyboard enter event */
handleKeyEnter,
/** @description focus the input element */
focus,
/** @description blur the input element */
blur,
/** @description close suggestion */
close: close2,
/** @description highlight an item in a suggestion */
highlight,
/** @description loading suggestion list */
getData
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), {
ref_key: "popperRef",
ref: popperRef,
visible: suggestionVisible.value,
placement: __props.placement,
"fallback-placements": ["bottom-start", "top-start"],
"popper-class": [unref(ns).e("popper"), __props.popperClass],
"popper-style": __props.popperStyle,
teleported: __props.teleported,
"append-to": __props.appendTo,
"gpu-acceleration": false,
pure: "",
"manual-mode": "",
effect: "light",
trigger: "click",
transition: `${unref(ns).namespace.value}-zoom-in-top`,
persistent: "",
role: "listbox",
onBeforeShow: onSuggestionShow,
onHide
}, {
content: withCtx(() => [
createBaseVNode(
"div",
{
ref_key: "regionRef",
ref: regionRef,
class: normalizeClass([unref(ns).b("suggestion"), unref(ns).is("loading", suggestionLoading.value)]),
style: normalizeStyle({
[__props.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
outline: "none"
}),
role: "region"
},
[
_ctx.$slots.header ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).be("suggestion", "header")),
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "header")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createVNode(unref(ElScrollbar), {
id: unref(listboxId),
tag: "ul",
"wrap-class": unref(ns).be("suggestion", "wrap"),
"view-class": unref(ns).be("suggestion", "list"),
role: "listbox"
}, {
default: withCtx(() => [
suggestionLoading.value ? (openBlock(), createElementBlock("li", _hoisted_23, [
renderSlot(_ctx.$slots, "loading", {}, () => [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(ns).is("loading"))
}, {
default: withCtx(() => [
createVNode(unref(loading_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])
])
])) : (openBlock(true), createElementBlock(
Fragment,
{ key: 1 },
renderList(suggestions.value, (item, index) => {
return openBlock(), createElementBlock("li", {
id: `${unref(listboxId)}-item-${index}`,
key: index,
class: normalizeClass({ highlighted: highlightedIndex.value === index }),
role: "option",
"aria-selected": highlightedIndex.value === index,
onClick: ($event) => handleSelect(item)
}, [
renderSlot(_ctx.$slots, "default", { item }, () => [
createTextVNode(
toDisplayString(item[__props.valueKey]),
1
/* TEXT */
)
])
], 10, _hoisted_3);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 3
/* FORWARDED */
}, 8, ["id", "wrap-class", "view-class"]),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).be("suggestion", "footer")),
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)
]),
default: withCtx(() => [
createBaseVNode("div", {
ref_key: "listboxRef",
ref: listboxRef,
class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]),
style: normalizeStyle(styles.value),
role: "combobox",
"aria-haspopup": "listbox",
"aria-expanded": suggestionVisible.value,
"aria-owns": unref(listboxId)
}, [
createVNode(unref(ElInput), mergeProps({
ref_key: "inputRef",
ref: inputRef
}, mergeProps(passInputProps.value, _ctx.$attrs), {
"model-value": __props.modelValue,
disabled: unref(disabled),
onInput: handleInput,
onChange: handleChange,
onFocus: handleFocus,
onBlur: handleBlur,
onClear: handleClear,
onKeydown: handleKeydown,
onMousedown: handleMouseDown
}), createSlots({
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.prepend ? {
name: "prepend",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "prepend")
]),
key: "0"
} : void 0,
_ctx.$slots.append ? {
name: "append",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "append")
]),
key: "1"
} : void 0,
_ctx.$slots.prefix ? {
name: "prefix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "prefix")
]),
key: "2"
} : void 0,
_ctx.$slots.suffix ? {
name: "suffix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "suffix")
]),
key: "3"
} : void 0
]), 1040, ["model-value", "disabled"])
], 14, _hoisted_14)
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "placement", "popper-class", "popper-style", "teleported", "append-to", "transition"]);
};
}
});
// node_modules/element-plus/es/components/autocomplete/index.mjs
var ElAutocomplete = withInstall(_sfc_main17);
// node_modules/element-plus/es/components/avatar/src/avatar.mjs
var avatarProps = buildProps({
/**
* @description avatar size.
*/
size: {
type: [Number, String],
values: componentSizes,
validator: (val) => isNumber(val)
},
/**
* @description avatar shape.
*/
shape: {
type: String,
values: ["circle", "square"]
},
/**
* @description representation type to icon, more info on icon component.
*/
icon: {
type: iconPropType
},
/**
* @description the source of the image for an image avatar.
*/
src: {
type: String,
default: ""
},
/**
* @description native attribute `alt` of image avatar.
*/
alt: String,
/**
* @description native attribute srcset of image avatar.
*/
srcSet: String,
/**
* @description set how the image fit its container for an image avatar.
*/
fit: {
type: definePropType(String),
default: "cover"
}
});
var avatarEmits = {
error: (evt) => evt instanceof Event
};
// node_modules/element-plus/es/components/avatar/src/constants.mjs
var avatarGroupContextKey = /* @__PURE__ */ Symbol(
"avatarGroupContextKey"
);
// node_modules/element-plus/es/components/avatar/src/avatar.vue2.mjs
var _hoisted_15 = ["src", "alt", "srcset"];
var _sfc_main18 = defineComponent({
...{
name: "ElAvatar"
},
__name: "avatar",
props: avatarProps,
emits: avatarEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const avatarGroupContext = inject(avatarGroupContextKey, void 0);
const ns = useNamespace("avatar");
const hasLoadError = ref(false);
const size2 = computed(() => {
var _a;
return (_a = props2.size) != null ? _a : avatarGroupContext == null ? void 0 : avatarGroupContext.size;
});
const shape = computed(
() => {
var _a, _b;
return (_b = (_a = props2.shape) != null ? _a : avatarGroupContext == null ? void 0 : avatarGroupContext.shape) != null ? _b : "circle";
}
);
const avatarClass = computed(() => {
const { icon } = props2;
const classList = [ns.b()];
if (isString(size2.value)) classList.push(ns.m(size2.value));
if (icon) classList.push(ns.m("icon"));
if (shape.value) classList.push(ns.m(shape.value));
return classList;
});
const sizeStyle = computed(() => {
return isNumber(size2.value) ? ns.cssVarBlock({
size: addUnit(size2.value)
}) : void 0;
});
const fitStyle = computed(() => ({
objectFit: props2.fit
}));
watch(
() => [props2.src, props2.srcSet],
() => hasLoadError.value = false
);
function handleError(e) {
hasLoadError.value = true;
emit("error", e);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"span",
{
class: normalizeClass(avatarClass.value),
style: normalizeStyle(sizeStyle.value)
},
[
(__props.src || __props.srcSet) && !hasLoadError.value ? (openBlock(), createElementBlock("img", {
key: 0,
src: __props.src,
alt: __props.alt,
srcset: __props.srcSet,
style: normalizeStyle(fitStyle.value),
onError: handleError
}, null, 44, _hoisted_15)) : __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
})) : renderSlot(_ctx.$slots, "default", { key: 2 })
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/avatar/src/avatar-group-props.mjs
var avatarGroupProps = {
/**
* @description control the size of avatars in this avatar-group
*/
size: {
type: definePropType([Number, String]),
values: componentSizes,
validator: (val) => isNumber(val)
},
/**
* @description control the shape of avatars in this avatar-group
*/
shape: {
type: definePropType(String),
values: ["circle", "square"]
},
/**
* @description whether to collapse avatars
*/
collapseAvatars: Boolean,
/**
* @description whether show all collapsed avatars when mouse hover text of the collapse-avatar. To use this, `collapse-avatars` must be true
*/
collapseAvatarsTooltip: Boolean,
/**
* @description the max avatars number to be shown. To use this, `collapse-avatars` must be true
*/
maxCollapseAvatars: {
type: Number,
default: 1
},
/**
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description placement of tooltip
*/
placement: {
type: definePropType(String),
values: Ee,
default: "top"
},
/**
* @description custom class name for tooltip
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for tooltip
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description custom class name for the collapse-avatar
*/
collapseClass: String,
/**
* @description custom style for the collapse-avatar
*/
collapseStyle: {
type: definePropType([String, Array, Object])
}
};
// node_modules/element-plus/es/components/avatar/src/avatar-group.mjs
var AvatarGroup = defineComponent({
name: "ElAvatarGroup",
props: avatarGroupProps,
setup(props2, {
slots
}) {
const ns = useNamespace("avatar-group");
provide(avatarGroupContextKey, reactive({
size: toRef(props2, "size"),
shape: toRef(props2, "shape")
}));
return () => {
var _a, _b;
const avatars = flattedChildren((_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : []);
let visibleAvatars = avatars;
const showCollapseAvatar = props2.collapseAvatars && avatars.length > props2.maxCollapseAvatars;
if (showCollapseAvatar) {
visibleAvatars = avatars.slice(0, props2.maxCollapseAvatars);
const hiddenAvatars = avatars.slice(props2.maxCollapseAvatars);
visibleAvatars.push(createVNode(ElTooltip, {
"popperClass": props2.popperClass,
"popperStyle": props2.popperStyle,
"placement": props2.placement,
"effect": props2.effect,
"disabled": !props2.collapseAvatarsTooltip
}, {
default: () => createVNode(_sfc_main18, {
"size": props2.size,
"shape": props2.shape,
"class": props2.collapseClass,
"style": props2.collapseStyle
}, {
default: () => [createTextVNode("+ "), hiddenAvatars.length]
}),
content: () => createVNode("div", {
"class": ns.e("collapse-avatars")
}, [hiddenAvatars.map((node, idx) => {
var _a2;
return isVNode(node) ? cloneVNode(node, {
key: (_a2 = node.key) != null ? _a2 : idx
}) : node;
})])
}));
}
return createVNode("div", {
"class": ns.b()
}, [visibleAvatars]);
};
}
});
// node_modules/element-plus/es/components/avatar/index.mjs
var ElAvatar = withInstall(_sfc_main18, {
AvatarGroup
});
var ElAvatarGroup = withNoopInstall(AvatarGroup);
// node_modules/element-plus/es/components/backtop/src/backtop.mjs
var backtopProps = {
/**
* @description the button will not show until the scroll height reaches this value.
*/
visibilityHeight: {
type: Number,
default: 200
},
/**
* @description the target to trigger scroll.
*/
target: {
type: String,
default: ""
},
/**
* @description right distance.
*/
right: {
type: Number,
default: 40
},
/**
* @description bottom distance.
*/
bottom: {
type: Number,
default: 40
}
};
var backtopEmits = {
click: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/backtop/src/use-backtop.mjs
var useBackTop = (props2, emit, componentName2) => {
const el = shallowRef();
const container = shallowRef();
const visible = ref(false);
const handleScroll2 = () => {
if (el.value) visible.value = el.value.scrollTop >= props2.visibilityHeight;
};
const handleClick = (event) => {
var _a;
(_a = el.value) == null ? void 0 : _a.scrollTo({ top: 0, behavior: "smooth" });
emit("click", event);
};
const handleScrollThrottled = useThrottleFn(handleScroll2, 300, true);
useEventListener(container, "scroll", handleScrollThrottled);
onMounted(() => {
var _a;
container.value = document;
el.value = document.documentElement;
if (props2.target) {
el.value = (_a = document.querySelector(props2.target)) != null ? _a : void 0;
if (!el.value) {
throwError(componentName2, `target does not exist: ${props2.target}`);
}
container.value = el.value;
}
handleScroll2();
});
return {
visible,
handleClick
};
};
// node_modules/element-plus/es/components/backtop/src/backtop.vue2.mjs
var COMPONENT_NAME6 = "ElBacktop";
var _sfc_main19 = defineComponent({
...{
name: COMPONENT_NAME6
},
__name: "backtop",
props: backtopProps,
emits: backtopEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("backtop");
const { handleClick, visible } = useBackTop(props2, emit, COMPONENT_NAME6);
const backTopStyle = computed(() => ({
right: `${props2.right}px`,
bottom: `${props2.bottom}px`
}));
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, {
name: `${unref(ns).namespace.value}-fade-in`
}, {
default: withCtx(() => [
unref(visible) ? (openBlock(), createElementBlock(
"div",
{
key: 0,
style: normalizeStyle(backTopStyle.value),
class: normalizeClass(unref(ns).b()),
onClick: _cache[0] || (_cache[0] = withModifiers(
//@ts-ignore
(...args) => unref(handleClick) && unref(handleClick)(...args),
["stop"]
))
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(ns).e("icon"))
}, {
default: withCtx(() => [
createVNode(unref(caret_top_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])
])
],
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["name"]);
};
}
});
// node_modules/element-plus/es/components/backtop/index.mjs
var ElBacktop = withInstall(_sfc_main19);
// node_modules/element-plus/es/components/badge/src/badge.mjs
var badgeProps = buildProps({
/**
* @description display value.
*/
value: {
type: [String, Number],
default: ""
},
/**
* @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.
*/
max: {
type: Number,
default: 99
},
/**
* @description if a little dot is displayed.
*/
isDot: Boolean,
/**
* @description hidden badge.
*/
hidden: Boolean,
/**
* @description badge type.
*/
type: {
type: String,
values: ["primary", "success", "warning", "info", "danger"],
default: "danger"
},
/**
* @description whether to show badge when value is zero.
*/
showZero: {
type: Boolean,
default: true
},
/**
* @description customize dot background color
*/
color: String,
/**
* @description CSS style of badge
*/
badgeStyle: {
type: definePropType([String, Object, Array])
},
/**
* @description set offset of the badge
*/
offset: {
type: definePropType(Array),
default: () => [0, 0]
},
/**
* @description custom class name of badge
*/
badgeClass: {
type: String
}
});
// node_modules/element-plus/es/components/badge/src/badge.vue2.mjs
var _sfc_main20 = defineComponent({
...{
name: "ElBadge"
},
__name: "badge",
props: badgeProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const ns = useNamespace("badge");
const content = computed(() => {
if (props2.isDot) return "";
if (isNumber(props2.value) && isNumber(props2.max)) {
return props2.max < props2.value ? `${props2.max}+` : `${props2.value}`;
}
return `${props2.value}`;
});
const style = computed(() => {
var _a;
return [
{
backgroundColor: props2.color,
marginRight: addUnit(-props2.offset[0]),
marginTop: addUnit(props2.offset[1])
},
(_a = props2.badgeStyle) != null ? _a : {}
];
});
__expose({
/** @description badge content */
content
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
renderSlot(_ctx.$slots, "default"),
createVNode(Transition, {
name: `${unref(ns).namespace.value}-zoom-in-center`,
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createBaseVNode(
"sup",
{
class: normalizeClass([
unref(ns).e("content"),
unref(ns).em("content", __props.type),
unref(ns).is("fixed", !!_ctx.$slots.default),
unref(ns).is("dot", __props.isDot),
unref(ns).is("hide-zero", !__props.showZero && __props.value === 0),
__props.badgeClass
]),
style: normalizeStyle(style.value)
},
[
renderSlot(_ctx.$slots, "content", { value: content.value }, () => [
createTextVNode(
toDisplayString(content.value),
1
/* TEXT */
)
])
],
6
/* CLASS, STYLE */
), [
[vShow, !__props.hidden && (content.value || __props.isDot || _ctx.$slots.content)]
])
]),
_: 3
/* FORWARDED */
}, 8, ["name"])
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/badge/index.mjs
var ElBadge = withInstall(_sfc_main20);
// node_modules/element-plus/es/components/breadcrumb/src/breadcrumb.mjs
var breadcrumbProps = buildProps({
/**
* @description separator character
*/
separator: {
type: String,
default: "/"
},
/**
* @description icon component of icon separator
*/
separatorIcon: {
type: iconPropType
}
});
// node_modules/element-plus/es/components/breadcrumb/src/constants.mjs
var breadcrumbKey = /* @__PURE__ */ Symbol("breadcrumbKey");
// node_modules/element-plus/es/components/breadcrumb/src/breadcrumb.vue2.mjs
var _hoisted_16 = ["aria-label"];
var _sfc_main21 = defineComponent({
...{
name: "ElBreadcrumb"
},
__name: "breadcrumb",
props: breadcrumbProps,
setup(__props) {
const { t } = useLocale();
const props2 = __props;
const ns = useNamespace("breadcrumb");
const breadcrumb = ref();
provide(breadcrumbKey, props2);
onMounted(() => {
const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
if (items.length) {
items[items.length - 1].setAttribute("aria-current", "page");
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "breadcrumb",
ref: breadcrumb,
class: normalizeClass(unref(ns).b()),
"aria-label": unref(t)("el.breadcrumb.label"),
role: "navigation"
}, [
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_16);
};
}
});
// node_modules/element-plus/es/components/breadcrumb/src/breadcrumb-item.mjs
var breadcrumbItemProps = buildProps({
/**
* @description target route of the link, same as `to` of `vue-router`
*/
to: {
type: definePropType([String, Object]),
default: ""
},
/**
* @description if `true`, the navigation will not leave a history record
*/
replace: Boolean
});
// node_modules/element-plus/es/components/breadcrumb/src/breadcrumb-item.vue2.mjs
var _sfc_main22 = defineComponent({
...{
name: "ElBreadcrumbItem"
},
__name: "breadcrumb-item",
props: breadcrumbItemProps,
setup(__props) {
const props2 = __props;
const instance = getCurrentInstance();
const breadcrumbContext = inject(breadcrumbKey, void 0);
const ns = useNamespace("breadcrumb");
const router = instance.appContext.config.globalProperties.$router;
const onClick = () => {
if (!props2.to || !router) return;
props2.replace ? router.replace(props2.to) : router.push(props2.to);
};
return (_ctx, _cache) => {
var _a, _b;
return openBlock(), createElementBlock(
"span",
{
class: normalizeClass(unref(ns).e("item"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!__props.to)]),
role: "link",
onClick
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
((_a = unref(breadcrumbContext)) == null ? void 0 : _a.separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("separator"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(unref(breadcrumbContext).separatorIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : (openBlock(), createElementBlock(
"span",
{
key: 1,
class: normalizeClass(unref(ns).e("separator")),
role: "presentation"
},
toDisplayString((_b = unref(breadcrumbContext)) == null ? void 0 : _b.separator),
3
/* TEXT, CLASS */
))
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/breadcrumb/index.mjs
var ElBreadcrumb = withInstall(_sfc_main21, {
BreadcrumbItem: _sfc_main22
});
var ElBreadcrumbItem = withNoopInstall(_sfc_main22);
// node_modules/element-plus/es/components/button/src/button.mjs
var buttonTypes = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
/**
* @deprecated
* Text type will be deprecated in the next major version (3.0.0)
*/
"text",
""
];
var buttonNativeTypes = ["button", "submit", "reset"];
var buttonProps = buildProps({
/**
* @description button size
*/
size: useSizeProp,
/**
* @description disable the button
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description button type
*/
type: {
type: String,
values: buttonTypes,
default: ""
},
/**
* @description icon component
*/
icon: {
type: iconPropType
},
/**
* @description native button type
*/
nativeType: {
type: String,
values: buttonNativeTypes,
default: "button"
},
/**
* @description determine whether it's loading
*/
loading: Boolean,
/**
* @description customize loading icon component
*/
loadingIcon: {
type: iconPropType,
default: () => loading_default
},
/**
* @description determine whether it's a plain button
*/
plain: {
type: Boolean,
default: void 0
},
/**
* @description determine whether it's a text button
*/
text: {
type: Boolean,
default: void 0
},
/**
* @description determine whether it's a link button
*/
link: Boolean,
/**
* @description determine whether the text button background color is always on
*/
bg: Boolean,
/**
* @description native button autofocus
*/
autofocus: Boolean,
/**
* @description determine whether it's a round button
*/
round: {
type: Boolean,
default: void 0
},
/**
* @description determine whether it's a circle button
*/
circle: Boolean,
/**
* @description custom button color, automatically calculate `hover` and `active` color
*/
color: String,
/**
* @description dark mode, which automatically converts `color` to dark mode colors
*/
dark: Boolean,
/**
* @description automatically insert a space between two chinese characters
*/
autoInsertSpace: {
type: Boolean,
default: void 0
},
/**
* @description custom element tag
*/
tag: {
type: definePropType([String, Object]),
default: "button"
}
});
var buttonEmits = {
click: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/button/src/constants.mjs
var buttonGroupContextKey = /* @__PURE__ */ Symbol(
"buttonGroupContextKey"
);
// node_modules/element-plus/es/hooks/use-deprecated/index.mjs
var useDeprecated = ({ from, replacement, scope, version: version4, ref: ref2, type = "API" }, condition) => {
watch(
() => unref(condition),
(val) => {
if (val) {
debugWarn(
scope,
`[${type}] ${from} is about to be deprecated in version ${version4}, please use ${replacement} instead.
For more detail, please visit: ${ref2}
`
);
}
},
{
immediate: true
}
);
};
// node_modules/element-plus/es/components/button/src/use-button.mjs
var useButton = (props2, emit) => {
useDeprecated(
{
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
},
computed(() => props2.type === "text")
);
const buttonGroupContext = inject(buttonGroupContextKey, void 0);
const globalConfig2 = useGlobalConfig("button");
const { form } = useFormItem();
const _size = useFormSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
const _disabled = useFormDisabled();
const _ref = ref();
const slots = useSlots();
const _type = computed(
() => {
var _a;
return props2.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || ((_a = globalConfig2.value) == null ? void 0 : _a.type) || "";
}
);
const autoInsertSpace = computed(
() => {
var _a, _b, _c;
return (_c = (_b = props2.autoInsertSpace) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
}
);
const _plain = computed(
() => {
var _a, _b, _c;
return (_c = (_b = props2.plain) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.plain) != null ? _c : false;
}
);
const _round = computed(
() => {
var _a, _b, _c;
return (_c = (_b = props2.round) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.round) != null ? _c : false;
}
);
const _text = computed(() => {
var _a, _b, _c;
return (_c = (_b = props2.text) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.text) != null ? _c : false;
});
const _props = computed(() => {
if (props2.tag === "button") {
return {
ariaDisabled: _disabled.value || props2.loading,
disabled: _disabled.value || props2.loading,
autofocus: props2.autofocus,
type: props2.nativeType
};
}
return {};
});
const shouldAddSpace = computed(() => {
var _a;
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
const slot = defaultSlot[0];
if ((slot == null ? void 0 : slot.type) === Text) {
const text = slot.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(text.trim());
}
}
return false;
});
const handleClick = (evt) => {
if (_disabled.value || props2.loading) {
evt.stopPropagation();
return;
}
if (props2.nativeType === "reset") {
form == null ? void 0 : form.resetFields();
}
emit("click", evt);
};
return {
_disabled,
_size,
_type,
_ref,
_props,
_plain,
_round,
_text,
shouldAddSpace,
handleClick
};
};
// node_modules/element-plus/es/components/button/src/button-custom.mjs
function darken(color, amount = 20) {
return color.mix("#141414", amount).toString();
}
function useButtonCustomStyle(props2) {
const _disabled = useFormDisabled();
const ns = useNamespace("button");
return computed(() => {
let styles = {};
let buttonColor = props2.color;
if (buttonColor) {
const match = buttonColor.match(/var\((.*?)\)/);
if (match) {
buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
}
const color = new TinyColor(buttonColor);
const activeBgColor = props2.dark ? color.tint(20).toString() : darken(color, 20);
if (props2.plain) {
styles = ns.cssVarBlock({
"bg-color": props2.dark ? darken(color, 90) : color.tint(90).toString(),
"text-color": buttonColor,
"border-color": props2.dark ? darken(color, 50) : color.tint(50).toString(),
"hover-text-color": `var(${ns.cssVarName("color-white")})`,
"hover-bg-color": buttonColor,
"hover-border-color": buttonColor,
"active-bg-color": activeBgColor,
"active-text-color": `var(${ns.cssVarName("color-white")})`,
"active-border-color": activeBgColor
});
if (_disabled.value) {
styles[ns.cssVarBlockName("disabled-bg-color")] = props2.dark ? darken(color, 90) : color.tint(90).toString();
styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? darken(color, 50) : color.tint(50).toString();
styles[ns.cssVarBlockName("disabled-border-color")] = props2.dark ? darken(color, 80) : color.tint(80).toString();
}
} else {
const hoverBgColor = props2.dark ? darken(color, 30) : color.tint(30).toString();
const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
styles = ns.cssVarBlock({
"bg-color": buttonColor,
"text-color": textColor,
"border-color": buttonColor,
"hover-bg-color": hoverBgColor,
"hover-text-color": textColor,
"hover-border-color": hoverBgColor,
"active-bg-color": activeBgColor,
"active-border-color": activeBgColor
});
if (_disabled.value) {
const disabledButtonColor = props2.dark ? darken(color, 50) : color.tint(50).toString();
styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
}
}
}
return styles;
});
}
// node_modules/element-plus/es/components/button/src/button.vue2.mjs
var _sfc_main23 = defineComponent({
...{
name: "ElButton"
},
__name: "button",
props: buttonProps,
emits: buttonEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const buttonStyle = useButtonCustomStyle(props2);
const ns = useNamespace("button");
const {
_ref,
_size,
_type,
_disabled,
_props,
_plain,
_round,
_text,
shouldAddSpace,
handleClick
} = useButton(props2, emit);
const buttonKls = computed(() => [
ns.b(),
ns.m(_type.value),
ns.m(_size.value),
ns.is("disabled", _disabled.value),
ns.is("loading", props2.loading),
ns.is("plain", _plain.value),
ns.is("round", _round.value),
ns.is("circle", props2.circle),
ns.is("text", _text.value),
ns.is("link", props2.link),
ns.is("has-bg", props2.bg)
]);
__expose({
/** @description button html element */
ref: _ref,
/** @description button size */
size: _size,
/** @description button type */
type: _type,
/** @description button disabled */
disabled: _disabled,
/** @description whether adding space */
shouldAddSpace
});
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({
ref_key: "_ref",
ref: _ref
}, unref(_props), {
class: buttonKls.value,
style: unref(buttonStyle),
onClick: unref(handleClick)
}), {
default: withCtx(() => [
__props.loading ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass(unref(ns).is("loading"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.loadingIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"]))
],
64
/* STABLE_FRAGMENT */
)) : __props.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
default: withCtx(() => [
__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
]),
_: 3
/* FORWARDED */
})) : createCommentVNode("v-if", true),
_ctx.$slots.default ? (openBlock(), createElementBlock(
"span",
{
key: 2,
class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 16, ["class", "style", "onClick"]);
};
}
});
// node_modules/element-plus/es/components/button/src/button-group.mjs
var buttonGroupProps = {
/**
* @description control the size of buttons in this button-group
*/
size: buttonProps.size,
/**
* @description control the type of buttons in this button-group
*/
type: buttonProps.type,
/**
* @description display direction
*/
direction: {
type: definePropType(String),
values: ["horizontal", "vertical"],
default: "horizontal"
}
};
// node_modules/element-plus/es/components/button/src/button-group.vue2.mjs
var _sfc_main24 = defineComponent({
...{
name: "ElButtonGroup"
},
__name: "button-group",
props: buttonGroupProps,
setup(__props) {
const props2 = __props;
provide(
buttonGroupContextKey,
reactive({
size: toRef(props2, "size"),
type: toRef(props2, "type")
})
);
const ns = useNamespace("button");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b("group"), unref(ns).bm("group", props2.direction)])
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/button/index.mjs
var ElButton = withInstall(_sfc_main23, {
ButtonGroup: _sfc_main24
});
var ElButtonGroup = withNoopInstall(_sfc_main24);
// node_modules/element-plus/es/components/calendar/src/calendar.mjs
var isValidRange = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item));
var calendarProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: Date
},
/**
* @description time range, including start time and end time.
* Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.
*/
range: {
type: definePropType(Array),
validator: isValidRange
},
/**
* @description type of the controller for the Calendar header
*/
controllerType: {
type: String,
values: ["button", "select"],
default: "button"
},
/**
* @description format label when `controller-type` is 'select'
*/
formatter: {
type: definePropType(Function)
}
});
var calendarEmits = {
[UPDATE_MODEL_EVENT]: (value) => isDate(value),
[INPUT_EVENT]: (value) => isDate(value)
};
// node_modules/element-plus/es/components/time-picker/src/utils.mjs
var import_dayjs = __toESM(require_dayjs_min(), 1);
var buildTimeList = (value, bound) => {
return [
value > 0 ? value - 1 : void 0,
value,
value < bound ? value + 1 : void 0
];
};
var rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
var extractDateFormat = (format) => {
return format.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
};
var extractTimeFormat = (format) => {
return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim();
};
var dateEquals = function(a2, b2) {
const aIsDate = isDate(a2);
const bIsDate = isDate(b2);
if (aIsDate && bIsDate) {
return a2.getTime() === b2.getTime();
}
if (!aIsDate && !bIsDate) {
return a2 === b2;
}
return false;
};
var valueEquals = function(a2, b2) {
const aIsArray = isArray(a2);
const bIsArray = isArray(b2);
if (aIsArray && bIsArray) {
if (a2.length !== b2.length) {
return false;
}
return a2.every((item, index) => dateEquals(item, b2[index]));
}
if (!aIsArray && !bIsArray) {
return dateEquals(a2, b2);
}
return false;
};
var parseDate = function(date, format, lang) {
const day = isEmpty(format) || format === "x" ? (0, import_dayjs.default)(date).locale(lang) : (0, import_dayjs.default)(date, format).locale(lang);
return day.isValid() ? day : void 0;
};
var formatter = function(date, format, lang) {
if (isEmpty(format)) return date;
if (format === "x") return +date;
return (0, import_dayjs.default)(date).locale(lang).format(format);
};
var makeList = (total2, method) => {
var _a;
const arr = [];
const disabledArr = method == null ? void 0 : method();
for (let i = 0; i < total2; i++) {
arr.push((_a = disabledArr == null ? void 0 : disabledArr.includes(i)) != null ? _a : false);
}
return arr;
};
var dayOrDaysToDate = (dayOrDays) => {
return isArray(dayOrDays) ? dayOrDays.map((d2) => d2.toDate()) : dayOrDays.toDate();
};
// node_modules/element-plus/es/components/calendar/src/date-table.mjs
var getPrevMonthLastDays = (date, count) => {
const lastDay = date.subtract(1, "month").endOf("month").date();
return rangeArr(count).map((_2, index) => lastDay - (count - index - 1));
};
var getMonthDays = (date) => {
const days = date.daysInMonth();
return rangeArr(days).map((_2, index) => index + 1);
};
var toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
const start = index * 7;
return days.slice(start, start + 7);
});
var dateTableProps = buildProps({
selectedDay: {
type: definePropType(Object)
},
range: {
type: definePropType(Array)
},
date: {
type: definePropType(Object),
required: true
},
hideHeader: {
type: Boolean
}
});
var dateTableEmits = {
pick: (value) => isObject(value)
};
// node_modules/element-plus/es/components/calendar/src/use-date-table.mjs
var import_dayjs2 = __toESM(require_dayjs_min(), 1);
var import_localeData = __toESM(require_localeData(), 1);
// node_modules/element-plus/es/constants/date.mjs
var datePickTypes = [
"year",
"years",
"month",
"months",
"date",
"dates",
"week",
"datetime",
"datetimerange",
"daterange",
"monthrange",
"yearrange"
];
var WEEK_DAYS = [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
];
// node_modules/element-plus/es/components/calendar/src/use-date-table.mjs
var useDateTable = (props2, emit) => {
import_dayjs2.default.extend(import_localeData.default);
const firstDayOfWeek = import_dayjs2.default.localeData().firstDayOfWeek();
const { t, lang } = useLocale();
const now = (0, import_dayjs2.default)().locale(lang.value);
const isInRange = computed(() => !!props2.range && !!props2.range.length);
const rows = computed(() => {
let days = [];
if (isInRange.value) {
const [start, end] = props2.range;
const currentMonthRange = rangeArr(
end.date() - start.date() + 1
).map((index) => ({
text: start.date() + index,
type: "current"
}));
let remaining = currentMonthRange.length % 7;
remaining = remaining === 0 ? 0 : 7 - remaining;
const nextMonthRange = rangeArr(remaining).map(
(_2, index) => ({
text: index + 1,
type: "next"
})
);
days = currentMonthRange.concat(nextMonthRange);
} else {
const firstDay = props2.date.startOf("month").day();
const prevMonthDays = getPrevMonthLastDays(
props2.date,
(firstDay - firstDayOfWeek + 7) % 7
).map((day) => ({
text: day,
type: "prev"
}));
const currentMonthDays = getMonthDays(props2.date).map(
(day) => ({
text: day,
type: "current"
})
);
days = [...prevMonthDays, ...currentMonthDays];
const remaining = 7 - (days.length % 7 || 7);
const nextMonthDays = rangeArr(remaining).map(
(_2, index) => ({
text: index + 1,
type: "next"
})
);
days = days.concat(nextMonthDays);
}
return toNestedArr(days);
});
const weekDays = computed(() => {
const start = firstDayOfWeek;
if (start === 0) {
return WEEK_DAYS.map((_2) => t(`el.datepicker.weeks.${_2}`));
} else {
return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_2) => t(`el.datepicker.weeks.${_2}`));
}
});
const getFormattedDate = (day, type) => {
switch (type) {
case "prev":
return props2.date.startOf("month").subtract(1, "month").date(day);
case "next":
return props2.date.startOf("month").add(1, "month").date(day);
case "current":
return props2.date.date(day);
}
};
const handlePickDay = ({ text, type }) => {
const date = getFormattedDate(text, type);
emit("pick", date);
};
const getSlotData = ({ text, type }) => {
const day = getFormattedDate(text, type);
return {
isSelected: day.isSame(props2.selectedDay),
type: `${type}-month`,
day: day.format("YYYY-MM-DD"),
date: day.toDate()
};
};
return {
now,
isInRange,
rows,
weekDays,
getFormattedDate,
handlePickDay,
getSlotData
};
};
// node_modules/element-plus/es/components/calendar/src/date-table.vue2.mjs
var _hoisted_17 = { key: 0 };
var _hoisted_24 = ["onClick"];
var _sfc_main25 = defineComponent({
...{
name: "DateTable"
},
__name: "date-table",
props: dateTableProps,
emits: dateTableEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const {
isInRange,
now,
rows,
weekDays,
getFormattedDate,
handlePickDay,
getSlotData
} = useDateTable(props2, emit);
const nsTable = useNamespace("calendar-table");
const nsDay = useNamespace("calendar-day");
const getCellClass = ({ text, type }) => {
const classes = [type];
if (type === "current") {
const date = getFormattedDate(text, type);
if (date.isSame(props2.selectedDay, "day")) {
classes.push(nsDay.is("selected"));
}
if (date.isSame(now, "day")) {
classes.push(nsDay.is("today"));
}
}
return classes;
};
__expose({
/** @description toggle date panel */
getFormattedDate
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"table",
{
class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
cellspacing: "0",
cellpadding: "0"
},
[
!__props.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_17, [
createBaseVNode("tr", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(weekDays), (day) => {
return openBlock(), createElementBlock(
"th",
{
key: day,
scope: "col"
},
toDisplayString(day),
1
/* TEXT */
);
}),
128
/* KEYED_FRAGMENT */
))
])
])) : createCommentVNode("v-if", true),
createBaseVNode("tbody", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(rows), (row, index) => {
return openBlock(), createElementBlock(
"tr",
{
key: index,
class: normalizeClass({
[unref(nsTable).e("row")]: true,
[unref(nsTable).em("row", "hide-border")]: index === 0 && __props.hideHeader
})
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(row, (cell, key) => {
return openBlock(), createElementBlock("td", {
key,
class: normalizeClass(getCellClass(cell)),
onClick: ($event) => unref(handlePickDay)(cell)
}, [
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsDay).b())
},
[
renderSlot(_ctx.$slots, "date-cell", {
data: unref(getSlotData)(cell)
}, () => [
createBaseVNode(
"span",
null,
toDisplayString(cell.text),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
], 10, _hoisted_24);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
])
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/calendar/src/use-calendar.mjs
var import_dayjs3 = __toESM(require_dayjs_min(), 1);
var adjacentMonth = (start, end) => {
const firstMonthLastDay = start.endOf("month");
const lastMonthFirstDay = end.startOf("month");
const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
return [
[start, firstMonthLastDay],
[lastMonthStartDay.startOf("week"), end]
];
};
var threeConsecutiveMonth = (start, end) => {
const firstMonthLastDay = start.endOf("month");
const secondMonthFirstDay = start.add(1, "month").startOf("month");
const secondMonthStartDay = firstMonthLastDay.isSame(
secondMonthFirstDay,
"week"
) ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
const secondMonthLastDay = secondMonthStartDay.endOf("month");
const lastMonthFirstDay = end.startOf("month");
const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
return [
[start, firstMonthLastDay],
[secondMonthStartDay.startOf("week"), secondMonthLastDay],
[lastMonthStartDay.startOf("week"), end]
];
};
var useCalendar = (props2, emit, componentName2) => {
const { lang } = useLocale();
const selectedDay = ref();
const now = (0, import_dayjs3.default)().locale(lang.value);
const realSelectedDay = computed({
get() {
if (!props2.modelValue) return selectedDay.value;
return date.value;
},
set(val) {
if (!val) return;
selectedDay.value = val;
const result = val.toDate();
emit(INPUT_EVENT, result);
emit(UPDATE_MODEL_EVENT, result);
}
});
const validatedRange = computed(() => {
if (!props2.range || !isArray(props2.range) || props2.range.length !== 2 || props2.range.some((item) => !isDate(item)))
return [];
const rangeArrDayjs = props2.range.map((_2) => (0, import_dayjs3.default)(_2).locale(lang.value));
const [startDayjs, endDayjs] = rangeArrDayjs;
if (startDayjs.isAfter(endDayjs)) {
debugWarn(componentName2, "end time should be greater than start time");
return [];
}
if (startDayjs.isSame(endDayjs, "month")) {
return calculateValidatedDateRange(startDayjs, endDayjs);
} else {
if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
debugWarn(
componentName2,
"start time and end time interval must not exceed two months"
);
return [];
}
return calculateValidatedDateRange(startDayjs, endDayjs);
}
});
const date = computed(() => {
if (!props2.modelValue) {
return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
} else {
return (0, import_dayjs3.default)(props2.modelValue).locale(lang.value);
}
});
const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
const nextYearDayjs = computed(() => date.value.add(1, "year").date(1));
const calculateValidatedDateRange = (startDayjs, endDayjs) => {
const firstDay = startDayjs.startOf("week");
const lastDay = endDayjs.endOf("week");
const firstMonth = firstDay.get("month");
const lastMonth = lastDay.get("month");
if (firstMonth === lastMonth) {
return [[firstDay, lastDay]];
} else if ((firstMonth + 1) % 12 === lastMonth) {
return adjacentMonth(firstDay, lastDay);
} else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
return threeConsecutiveMonth(firstDay, lastDay);
} else {
debugWarn(
componentName2,
"start time and end time interval must not exceed two months"
);
return [];
}
};
const pickDay = (day) => {
realSelectedDay.value = day;
};
const selectDate = (type) => {
const dateMap = {
"prev-month": prevMonthDayjs.value,
"next-month": nextMonthDayjs.value,
"prev-year": prevYearDayjs.value,
"next-year": nextYearDayjs.value,
today: now
};
const day = dateMap[type];
if (!day.isSame(date.value, "day")) {
pickDay(day);
}
};
const handleDateChange = (date2) => {
if (date2 === "today") {
selectDate("today");
} else {
pickDay(date2);
}
};
return {
calculateValidatedDateRange,
date,
realSelectedDay,
pickDay,
selectDate,
validatedRange,
handleDateChange
};
};
// node_modules/element-plus/es/components/calendar/src/select-controller.mjs
var selectControllerProps = buildProps({
date: {
type: definePropType(Object),
required: true
},
formatter: {
type: definePropType(Function)
}
});
var selectControllerEmits = {
"date-change": (date) => isObject(date) || isString(date)
};
// node_modules/element-plus/es/components/calendar/src/select-controller.vue2.mjs
var import_dayjs4 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/tag/src/tag.mjs
var tagProps = buildProps({
/**
* @description type of Tag
*/
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
},
/**
* @description whether Tag can be removed
*/
closable: Boolean,
/**
* @description whether to disable animations
*/
disableTransitions: Boolean,
/**
* @description whether Tag has a highlighted border
*/
hit: Boolean,
/**
* @description background color of the Tag
*/
color: String,
/**
* @description size of Tag
*/
size: {
type: String,
values: componentSizes
},
/**
* @description theme of Tag
*/
effect: {
type: String,
values: ["dark", "light", "plain"],
default: "light"
},
/**
* @description whether Tag is rounded
*/
round: Boolean
});
var tagEmits = {
close: (evt) => evt instanceof MouseEvent,
click: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/tag/src/tag.vue2.mjs
var _hoisted_18 = ["aria-label"];
var _hoisted_25 = ["aria-label"];
var _sfc_main26 = defineComponent({
...{
name: "ElTag"
},
__name: "tag",
props: tagProps,
emits: tagEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const tagSize = useFormSize();
const { t } = useLocale();
const ns = useNamespace("tag");
const containerKls = computed(() => {
const { type, hit, effect, closable, round: round2 } = props2;
return [
ns.b(),
ns.is("closable", closable),
ns.m(type || "primary"),
ns.m(tagSize.value),
ns.m(effect),
ns.is("hit", hit),
ns.is("round", round2)
];
});
const handleClose = (event) => {
emit("close", event);
};
const handleClick = (event) => {
emit("click", event);
};
const handleVNodeMounted = (vnode) => {
var _a, _b, _c;
if ((_c = (_b = (_a = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a.subTree) == null ? void 0 : _b.component) == null ? void 0 : _c.bum) {
vnode.component.subTree.component.bum = null;
}
};
return (_ctx, _cache) => {
return __props.disableTransitions ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(containerKls.value),
style: normalizeStyle({ backgroundColor: __props.color }),
onClick: handleClick
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("content"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
__props.closable ? (openBlock(), createElementBlock("button", {
key: 0,
"aria-label": unref(t)("el.tag.close"),
class: normalizeClass(unref(ns).e("close")),
type: "button",
onClick: withModifiers(handleClose, ["stop"])
}, [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
})
], 10, _hoisted_18)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : (openBlock(), createBlock(Transition, {
key: 1,
name: `${unref(ns).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: handleVNodeMounted
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(containerKls.value),
style: normalizeStyle({ backgroundColor: __props.color }),
onClick: handleClick
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("content"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
__props.closable ? (openBlock(), createElementBlock("button", {
key: 0,
"aria-label": unref(t)("el.tag.close"),
class: normalizeClass(unref(ns).e("close")),
type: "button",
onClick: withModifiers(handleClose, ["stop"])
}, [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
})
], 10, _hoisted_25)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)
]),
_: 3
/* FORWARDED */
}, 8, ["name"]));
};
}
});
// node_modules/element-plus/es/components/tag/index.mjs
var ElTag = withInstall(_sfc_main26);
// node_modules/element-plus/es/components/select-v2/src/useProps.mjs
var defaultProps = {
label: "label",
value: "value",
disabled: "disabled",
options: "options"
};
function useProps(props2) {
const aliasProps = ref({ ...defaultProps, ...props2.props });
let cache2 = { ...props2.props };
watch(
() => props2.props,
(val) => {
if (!isEqual_default(val, cache2)) {
aliasProps.value = { ...defaultProps, ...val };
cache2 = { ...val };
}
},
{ deep: true }
);
const getLabel = (option) => get_default(option, aliasProps.value.label);
const getValue = (option) => get_default(option, aliasProps.value.value);
const getDisabled = (option) => get_default(option, aliasProps.value.disabled);
const getOptions = (option) => get_default(option, aliasProps.value.options);
return {
aliasProps,
getLabel,
getValue,
getDisabled,
getOptions
};
}
// node_modules/element-plus/es/components/select/src/token.mjs
var selectGroupKey = /* @__PURE__ */ Symbol("ElSelectGroup");
var selectKey = /* @__PURE__ */ Symbol("ElSelect");
// node_modules/element-plus/es/components/select/src/option.mjs
var COMPONENT_NAME7 = "ElOption";
var optionProps = buildProps({
/**
* @description value of option
*/
value: {
type: [String, Number, Boolean, Object],
required: true
},
/**
* @description label of option, same as `value` if omitted
*/
label: {
type: [String, Number]
},
created: Boolean,
/**
* @description whether option is disabled
*/
disabled: Boolean
});
// node_modules/element-plus/es/utils/strings.mjs
var escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
var capitalize2 = (str) => capitalize(str);
// node_modules/element-plus/es/components/select/src/useOption.mjs
function useOption(props2, states) {
const select = inject(selectKey);
if (!select) {
throwError(COMPONENT_NAME7, "usage: ");
}
const selectGroup = inject(selectGroupKey, { disabled: false });
const itemSelected = computed(() => {
return contains(castArray_default(select.props.modelValue), props2.value);
});
const limitReached = computed(() => {
var _a;
if (select.props.multiple) {
const modelValue = castArray_default((_a = select.props.modelValue) != null ? _a : []);
return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
} else {
return false;
}
});
const currentLabel = computed(() => {
var _a;
return (_a = props2.label) != null ? _a : isObject(props2.value) ? "" : props2.value;
});
const currentValue = computed(() => {
return props2.value || props2.label || "";
});
const isDisabled = computed(() => {
return props2.disabled || states.groupDisabled || limitReached.value;
});
const instance = getCurrentInstance();
const contains = (arr = [], target2) => {
if (!isObject(props2.value)) {
return arr && arr.includes(target2);
} else {
const valueKey = select.props.valueKey;
return arr && arr.some((item) => {
return toRaw(get_default(item, valueKey)) === get_default(target2, valueKey);
});
}
};
const hoverItem = () => {
if (!isDisabled.value) {
select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy);
}
};
const updateOption = (query) => {
const regexp = new RegExp(escapeStringRegexp(query), "i");
states.visible = regexp.test(String(currentLabel.value)) || props2.created;
};
watch(
() => currentLabel.value,
() => {
if (!props2.created && !select.props.remote) select.setSelected();
}
);
watch(
() => props2.value,
(val, oldVal) => {
const { remote, valueKey } = select.props;
const shouldUpdate = remote ? val !== oldVal : !isEqual_default(val, oldVal);
if (shouldUpdate) {
select.onOptionDestroy(oldVal, instance.proxy);
select.onOptionCreate(instance.proxy);
}
if (!props2.created && !remote) {
if (valueKey && isObject(val) && isObject(oldVal) && val[valueKey] === oldVal[valueKey]) {
return;
}
select.setSelected();
}
}
);
watch(
() => selectGroup.disabled,
() => {
states.groupDisabled = selectGroup.disabled;
},
{ immediate: true }
);
return {
select,
currentLabel,
currentValue,
itemSelected,
isDisabled,
hoverItem,
updateOption
};
}
// node_modules/element-plus/es/components/select/src/option.vue2.mjs
var _sfc_main27 = defineComponent({
name: COMPONENT_NAME7,
componentName: COMPONENT_NAME7,
props: optionProps,
setup(props2) {
const ns = useNamespace("select");
const id = useId();
const containerKls = computed(() => [
ns.be("dropdown", "item"),
ns.is("disabled", unref(isDisabled)),
ns.is("selected", unref(itemSelected)),
ns.is("hovering", unref(hover))
]);
const states = reactive({
index: -1,
groupDisabled: false,
visible: true,
hover: false
});
const {
currentLabel,
itemSelected,
isDisabled,
select,
hoverItem,
updateOption
} = useOption(props2, states);
const { visible, hover } = toRefs(states);
const vm = getCurrentInstance().proxy;
select.onOptionCreate(vm);
onBeforeUnmount(() => {
const key = vm.value;
nextTick(() => {
const { selected: selectedOptions } = select.states;
const doesSelected = selectedOptions.some((item) => {
return item.value === vm.value;
});
if (select.states.cachedOptions.get(key) === vm && !doesSelected) {
select.states.cachedOptions.delete(key);
}
});
select.onOptionDestroy(key, vm);
});
function selectOptionClick() {
if (!isDisabled.value) {
select.handleOptionSelect(vm);
}
}
return {
ns,
id,
containerKls,
currentLabel,
itemSelected,
isDisabled,
select,
visible,
hover,
states,
hoverItem,
updateOption,
selectOptionClick
};
}
});
// node_modules/element-plus/es/components/select/src/option.vue.mjs
var _hoisted_19 = ["id", "aria-disabled", "aria-selected"];
function _sfc_render2(_ctx, _cache, $props, $setup, $data, $options) {
return withDirectives((openBlock(), createElementBlock("li", {
id: _ctx.id,
class: normalizeClass(_ctx.containerKls),
role: "option",
"aria-disabled": _ctx.isDisabled || void 0,
"aria-selected": _ctx.itemSelected,
onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.currentLabel),
1
/* TEXT */
)
])
], 42, _hoisted_19)), [
[vShow, _ctx.visible]
]);
}
var Option = _export_sfc(_sfc_main27, [["render", _sfc_render2]]);
// node_modules/element-plus/es/constants/form.mjs
var MINIMUM_INPUT_WIDTH = 11;
var BORDER_HORIZONTAL_WIDTH = 2;
// node_modules/element-plus/es/components/select/src/select-dropdown.vue2.mjs
var _sfc_main28 = defineComponent({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const select = inject(selectKey);
const ns = useNamespace("select");
const popperClass = computed(() => select.props.popperClass);
const isMultiple = computed(() => select.props.multiple);
const isFitInputWidth = computed(() => select.props.fitInputWidth);
const minWidth = ref("");
function updateMinWidth() {
var _a;
const offsetWidth = (_a = select.selectRef) == null ? void 0 : _a.offsetWidth;
if (offsetWidth) {
minWidth.value = `${offsetWidth - BORDER_HORIZONTAL_WIDTH}px`;
} else {
minWidth.value = "";
}
}
onMounted(() => {
updateMinWidth();
useResizeObserver(select.selectRef, updateMinWidth);
});
return {
ns,
minWidth,
popperClass,
isMultiple,
isFitInputWidth
};
}
});
// node_modules/element-plus/es/components/select/src/select-dropdown.vue.mjs
function _sfc_render3(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
},
[
_ctx.$slots.header ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(_ctx.ns.be("dropdown", "header"))
},
[
renderSlot(_ctx.$slots, "header")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default"),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(_ctx.ns.be("dropdown", "footer"))
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
);
}
var ElSelectMenu = _export_sfc(_sfc_main28, [["render", _sfc_render3]]);
// node_modules/element-plus/es/components/select/src/useSelect.mjs
var useSelect = (props2, emit) => {
const { t } = useLocale();
const slots = useSlots();
const contentId = useId();
const nsSelect = useNamespace("select");
const nsInput = useNamespace("input");
const states = reactive({
inputValue: "",
options: /* @__PURE__ */ new Map(),
cachedOptions: /* @__PURE__ */ new Map(),
optionValues: [],
// sorted value of options
selected: [],
selectionWidth: 0,
collapseItemWidth: 0,
selectedLabel: "",
hoveringIndex: -1,
previousQuery: null,
inputHovering: false,
menuVisibleOnFocus: false,
isBeforeHide: false
});
const selectRef = ref();
const selectionRef = ref();
const tooltipRef = ref();
const tagTooltipRef = ref();
const inputRef = ref();
const prefixRef = ref();
const suffixRef = ref();
const menuRef = ref();
const tagMenuRef = ref();
const collapseItemRef = ref();
const scrollbarRef = ref();
const expanded = ref(false);
const hoverOption = ref();
const debouncing = ref(false);
const { form, formItem } = useFormItem();
const { inputId } = useFormItemInputId(props2, {
formItemContext: formItem
});
const { valueOnClear, isEmptyValue } = useEmptyValues(props2);
const {
isComposing,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd
} = useComposition({
afterComposition: (e) => onInput(e)
});
const selectDisabled = useFormDisabled();
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
disabled: selectDisabled,
afterFocus() {
if (props2.automaticDropdown && !expanded.value) {
expanded.value = true;
states.menuVisibleOnFocus = true;
}
},
beforeBlur(event) {
var _a, _b;
return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
},
afterBlur() {
var _a;
expanded.value = false;
states.menuVisibleOnFocus = false;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
}
}
});
const hasModelValue = computed(() => {
return isArray(props2.modelValue) ? props2.modelValue.length > 0 : !isEmptyValue(props2.modelValue);
});
const needStatusIcon = computed(() => {
var _a;
return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
});
const showClearBtn = computed(() => {
return props2.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
});
const iconComponent = computed(
() => props2.remote && props2.filterable && !props2.remoteShowSuffix ? "" : props2.suffixIcon
);
const iconReverse = computed(
() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value))
);
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
const validateIcon = computed(
() => validateState.value && ValidateComponentsMap[validateState.value]
);
const debounce = computed(() => props2.remote ? props2.debounce : 0);
const isRemoteSearchEmpty = computed(
() => props2.remote && !states.inputValue && states.options.size === 0
);
const emptyText = computed(() => {
if (props2.loading) {
return props2.loadingText || t("el.select.loading");
} else {
if (props2.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) {
return props2.noMatchText || t("el.select.noMatch");
}
if (states.options.size === 0) {
return props2.noDataText || t("el.select.noData");
}
}
return null;
});
const filteredOptionsCount = computed(
() => optionsArray.value.filter((option) => option.visible).length
);
const optionsArray = computed(() => {
const list = Array.from(states.options.values());
const newList = [];
states.optionValues.forEach((item) => {
const index = list.findIndex((i) => i.value === item);
if (index > -1) {
newList.push(list[index]);
}
});
return newList.length >= list.length ? newList : list;
});
const cachedOptionsArray = computed(
() => Array.from(states.cachedOptions.values())
);
const showNewOption = computed(() => {
const hasExistingOption = optionsArray.value.filter((option) => {
return !option.created;
}).some((option) => {
return option.currentLabel === states.inputValue;
});
return props2.filterable && props2.allowCreate && states.inputValue !== "" && !hasExistingOption;
});
const updateOptions2 = () => {
if (props2.filterable && isFunction(props2.filterMethod)) return;
if (props2.filterable && props2.remote && isFunction(props2.remoteMethod))
return;
optionsArray.value.forEach((option) => {
var _a;
(_a = option.updateOption) == null ? void 0 : _a.call(option, states.inputValue);
});
};
const selectSize = useFormSize();
const collapseTagSize = computed(
() => ["small"].includes(selectSize.value) ? "small" : "default"
);
const dropdownMenuVisible = computed({
get() {
return expanded.value && (props2.loading || !isRemoteSearchEmpty.value || props2.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
},
set(val) {
expanded.value = val;
}
});
const shouldShowPlaceholder = computed(() => {
if (props2.multiple && !isUndefined(props2.modelValue)) {
return castArray_default(props2.modelValue).length === 0 && !states.inputValue;
}
const value = isArray(props2.modelValue) ? props2.modelValue[0] : props2.modelValue;
return props2.filterable || isUndefined(value) ? !states.inputValue : true;
});
const currentPlaceholder = computed(() => {
var _a;
const _placeholder = (_a = props2.placeholder) != null ? _a : t("el.select.placeholder");
return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
});
const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter");
watch(
() => props2.modelValue,
(val, oldVal) => {
if (props2.multiple) {
if (props2.filterable && !props2.reserveKeyword) {
states.inputValue = "";
handleQueryChange("");
}
}
setSelected();
if (!isEqual_default(val, oldVal) && props2.validateEvent) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
},
{
flush: "post",
deep: true
}
);
watch(
() => expanded.value,
(val) => {
if (val) {
handleQueryChange(states.inputValue);
} else {
states.inputValue = "";
states.previousQuery = null;
states.isBeforeHide = true;
states.menuVisibleOnFocus = false;
}
}
);
watch(
// fix `Array.prototype.push/splice/..` cannot trigger non-deep watcher
// https://github.com/vuejs/vue-next/issues/2116
() => states.options.entries(),
() => {
if (!isClient) return;
setSelected();
if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) {
checkDefaultFirstOption();
}
},
{
flush: "post"
}
);
watch([() => states.hoveringIndex, optionsArray], ([val]) => {
if (isNumber(val) && val > -1) {
hoverOption.value = optionsArray.value[val] || {};
} else {
hoverOption.value = {};
}
optionsArray.value.forEach((option) => {
option.hover = hoverOption.value === option;
});
});
watchEffect(() => {
if (states.isBeforeHide) return;
updateOptions2();
});
const handleQueryChange = (val) => {
if (states.previousQuery === val || isComposing.value) {
return;
}
states.previousQuery = val;
if (props2.filterable && isFunction(props2.filterMethod)) {
props2.filterMethod(val);
} else if (props2.filterable && props2.remote && isFunction(props2.remoteMethod)) {
props2.remoteMethod(val);
}
if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) {
nextTick(checkDefaultFirstOption);
} else {
nextTick(updateHoveringIndex);
}
};
const checkDefaultFirstOption = () => {
const optionsInDropdown = optionsArray.value.filter(
(n) => n.visible && !n.disabled && !n.states.groupDisabled
);
const userCreatedOption = optionsInDropdown.find((n) => n.created);
const firstOriginOption = optionsInDropdown[0];
const valueList = optionsArray.value.map((item) => item.value);
states.hoveringIndex = getValueIndex(
valueList,
userCreatedOption || firstOriginOption
);
};
const setSelected = () => {
if (!props2.multiple) {
const value = isArray(props2.modelValue) ? props2.modelValue[0] : props2.modelValue;
const option = getOption(value);
states.selectedLabel = option.currentLabel;
states.selected = [option];
return;
} else {
states.selectedLabel = "";
}
const result = [];
if (!isUndefined(props2.modelValue)) {
castArray_default(props2.modelValue).forEach((value) => {
result.push(getOption(value));
});
}
states.selected = result;
};
const getOption = (value) => {
let option;
const isObjectValue = isPlainObject(value);
for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
const cachedOption = cachedOptionsArray.value[i];
const isEqualValue = isObjectValue ? get_default(cachedOption.value, props2.valueKey) === get_default(value, props2.valueKey) : cachedOption.value === value;
if (isEqualValue) {
option = {
index: optionsArray.value.filter((opt) => !opt.created).indexOf(cachedOption),
value,
currentLabel: cachedOption.currentLabel,
get isDisabled() {
return cachedOption.isDisabled;
}
};
break;
}
}
if (option) return option;
const label = isObjectValue ? value.label : value != null ? value : "";
const newOption = {
index: -1,
value,
currentLabel: label
};
return newOption;
};
const updateHoveringIndex = () => {
const length = states.selected.length;
if (length > 0) {
const lastOption = states.selected[length - 1];
states.hoveringIndex = optionsArray.value.findIndex(
(item) => getValueKey(lastOption) === getValueKey(item)
);
} else {
states.hoveringIndex = -1;
}
};
const resetSelectionWidth = () => {
states.selectionWidth = Number.parseFloat(
window.getComputedStyle(selectionRef.value).width
);
};
const resetCollapseItemWidth = () => {
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
};
const updateTooltip = () => {
var _a, _b;
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
};
const updateTagTooltip = () => {
var _a, _b;
(_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
};
const onInputChange = () => {
if (states.inputValue.length > 0 && !expanded.value) {
expanded.value = true;
}
handleQueryChange(states.inputValue);
};
const onInput = (event) => {
states.inputValue = event.target.value;
if (props2.remote) {
debouncing.value = true;
debouncedOnInputChange();
} else {
return onInputChange();
}
};
const debouncedOnInputChange = useDebounceFn(() => {
onInputChange();
debouncing.value = false;
}, debounce);
const emitChange = (val) => {
if (!isEqual_default(props2.modelValue, val)) {
emit(CHANGE_EVENT, val);
}
};
const getLastNotDisabledIndex = (value) => findLastIndex_default(value, (it2) => {
const option = states.cachedOptions.get(it2);
return !(option == null ? void 0 : option.disabled) && !(option == null ? void 0 : option.states.groupDisabled);
});
const deletePrevTag = (e) => {
const code = getEventCode(e);
if (!props2.multiple) return;
if (code === EVENT_CODE.delete) return;
if (e.target.value.length <= 0) {
const value = castArray_default(props2.modelValue).slice();
const lastNotDisabledIndex = getLastNotDisabledIndex(value);
if (lastNotDisabledIndex < 0) return;
const removeTagValue = value[lastNotDisabledIndex];
value.splice(lastNotDisabledIndex, 1);
emit(UPDATE_MODEL_EVENT, value);
emitChange(value);
emit("remove-tag", removeTagValue);
}
};
const deleteTag = (event, tag) => {
const index = states.selected.indexOf(tag);
if (index > -1 && !selectDisabled.value) {
const value = castArray_default(props2.modelValue).slice();
value.splice(index, 1);
emit(UPDATE_MODEL_EVENT, value);
emitChange(value);
emit("remove-tag", tag.value);
}
event.stopPropagation();
focus();
};
const deleteSelected = (event) => {
event.stopPropagation();
const value = props2.multiple ? [] : valueOnClear.value;
if (props2.multiple) {
for (const item of states.selected) {
if (item.isDisabled) value.push(item.value);
}
}
emit(UPDATE_MODEL_EVENT, value);
emitChange(value);
states.hoveringIndex = -1;
expanded.value = false;
emit("clear");
focus();
};
const handleOptionSelect = (option) => {
var _a;
if (props2.multiple) {
const value = castArray_default((_a = props2.modelValue) != null ? _a : []).slice();
const optionIndex = getValueIndex(value, option);
if (optionIndex > -1) {
value.splice(optionIndex, 1);
} else if (props2.multipleLimit <= 0 || value.length < props2.multipleLimit) {
value.push(option.value);
}
emit(UPDATE_MODEL_EVENT, value);
emitChange(value);
if (option.created) {
handleQueryChange("");
}
if (props2.filterable && !props2.reserveKeyword) {
states.inputValue = "";
}
} else {
!isEqual_default(props2.modelValue, option.value) && emit(UPDATE_MODEL_EVENT, option.value);
emitChange(option.value);
expanded.value = false;
}
focus();
if (expanded.value) return;
nextTick(() => {
scrollToOption(option);
});
};
const getValueIndex = (arr, option) => {
if (isUndefined(option)) return -1;
if (!isObject(option.value)) return arr.indexOf(option.value);
return arr.findIndex((item) => {
return isEqual_default(get_default(item, props2.valueKey), getValueKey(option));
});
};
const scrollToOption = (option) => {
var _a, _b, _c, _d, _e;
const targetOption = isArray(option) ? option[option.length - 1] : option;
let target2 = null;
if (!isNil_default(targetOption == null ? void 0 : targetOption.value)) {
const options = optionsArray.value.filter(
(item) => item.value === targetOption.value
);
if (options.length > 0) {
target2 = options[0].$el;
}
}
if (tooltipRef.value && target2) {
const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(
_c,
`.${nsSelect.be("dropdown", "wrap")}`
);
if (menu) {
scrollIntoView(menu, target2);
}
}
(_e = scrollbarRef.value) == null ? void 0 : _e.handleScroll();
};
const onOptionCreate = (vm) => {
states.options.set(vm.value, vm);
states.cachedOptions.set(vm.value, vm);
};
const onOptionDestroy = (key, vm) => {
if (states.options.get(key) === vm) {
states.options.delete(key);
}
};
const popperRef = computed(() => {
var _a, _b;
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
});
const handleMenuEnter = () => {
states.isBeforeHide = false;
nextTick(() => {
var _a;
(_a = scrollbarRef.value) == null ? void 0 : _a.update();
scrollToOption(states.selected);
});
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
if (expanded.value) {
expanded.value = false;
nextTick(() => {
var _a2;
return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
});
return;
}
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
const handleClearClick = (event) => {
deleteSelected(event);
};
const handleClickOutside = (event) => {
expanded.value = false;
if (isFocused.value) {
const _event2 = new FocusEvent("blur", event);
nextTick(() => handleBlur(_event2));
}
};
const handleEsc = () => {
if (states.inputValue.length > 0) {
states.inputValue = "";
} else {
expanded.value = false;
}
};
const toggleMenu = (event) => {
var _a;
if (selectDisabled.value || props2.filterable && expanded.value && event && !((_a = suffixRef.value) == null ? void 0 : _a.contains(event.target)))
return;
if (isIOS) states.inputHovering = true;
if (states.menuVisibleOnFocus) {
states.menuVisibleOnFocus = false;
} else {
expanded.value = !expanded.value;
}
};
const selectOption = () => {
if (!expanded.value) {
toggleMenu();
} else {
const option = optionsArray.value[states.hoveringIndex];
if (option && !option.isDisabled) {
handleOptionSelect(option);
}
}
};
const getValueKey = (item) => {
return isObject(item.value) ? get_default(item.value, props2.valueKey) : item.value;
};
const optionsAllDisabled = computed(
() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled)
);
const showTagList = computed(() => {
if (!props2.multiple) {
return [];
}
return props2.collapseTags ? states.selected.slice(0, props2.maxCollapseTags) : states.selected;
});
const collapseTagList = computed(() => {
if (!props2.multiple) {
return [];
}
return props2.collapseTags ? states.selected.slice(props2.maxCollapseTags) : [];
});
const navigateOptions = (direction2) => {
if (!expanded.value) {
expanded.value = true;
return;
}
if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value)
return;
if (!optionsAllDisabled.value) {
if (direction2 === "next") {
states.hoveringIndex++;
if (states.hoveringIndex === states.options.size) {
states.hoveringIndex = 0;
}
} else if (direction2 === "prev") {
states.hoveringIndex--;
if (states.hoveringIndex < 0) {
states.hoveringIndex = states.options.size - 1;
}
}
const option = optionsArray.value[states.hoveringIndex];
if (option.isDisabled || !option.visible) {
navigateOptions(direction2);
}
nextTick(() => scrollToOption(hoverOption.value));
}
};
const findFocusableIndex = (arr, start, step2, len) => {
for (let i = start; i >= 0 && i < len; i += step2) {
const obj = arr[i];
if (!(obj == null ? void 0 : obj.isDisabled) && (obj == null ? void 0 : obj.visible)) {
return i;
}
}
return null;
};
const focusOption = (targetIndex, mode) => {
var _a;
const len = states.options.size;
if (len === 0) return;
const start = clamp_default(targetIndex, 0, len - 1);
const options = optionsArray.value;
const direction2 = mode === "up" ? -1 : 1;
const newIndex = (_a = findFocusableIndex(options, start, direction2, len)) != null ? _a : findFocusableIndex(options, start - direction2, -direction2, len);
if (newIndex != null) {
states.hoveringIndex = newIndex;
nextTick(() => scrollToOption(hoverOption.value));
}
};
const handleKeydown = (e) => {
const code = getEventCode(e);
let isPreventDefault = true;
switch (code) {
case EVENT_CODE.up:
navigateOptions("prev");
break;
case EVENT_CODE.down:
navigateOptions("next");
break;
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
if (!isComposing.value) {
selectOption();
}
break;
case EVENT_CODE.esc:
handleEsc();
break;
case EVENT_CODE.backspace:
isPreventDefault = false;
deletePrevTag(e);
return;
case EVENT_CODE.home:
if (!expanded.value) return;
focusOption(0, "down");
break;
case EVENT_CODE.end:
if (!expanded.value) return;
focusOption(states.options.size - 1, "up");
break;
case EVENT_CODE.pageUp:
if (!expanded.value) return;
focusOption(states.hoveringIndex - 10, "up");
break;
case EVENT_CODE.pageDown:
if (!expanded.value) return;
focusOption(states.hoveringIndex + 10, "down");
break;
default:
isPreventDefault = false;
break;
}
if (isPreventDefault) {
e.preventDefault();
e.stopPropagation();
}
};
const getGapWidth = () => {
if (!selectionRef.value) return 0;
const style = window.getComputedStyle(selectionRef.value);
return Number.parseFloat(style.gap || "6px");
};
const tagStyle = computed(() => {
const gapWidth = getGapWidth();
const inputSlotWidth = props2.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth;
return { maxWidth: `${maxWidth}px` };
});
const collapseTagStyle = computed(() => {
return { maxWidth: `${states.selectionWidth}px` };
});
const popupScroll = (data) => {
emit("popup-scroll", data);
};
useResizeObserver(selectionRef, resetSelectionWidth);
useResizeObserver(wrapperRef, updateTooltip);
useResizeObserver(tagMenuRef, updateTagTooltip);
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
let stop;
watch(
() => dropdownMenuVisible.value,
(newVal) => {
if (newVal) {
stop = useResizeObserver(menuRef, updateTooltip).stop;
} else {
stop == null ? void 0 : stop();
stop = void 0;
}
emit("visible-change", newVal);
}
);
onMounted(() => {
setSelected();
});
return {
inputId,
contentId,
nsSelect,
nsInput,
states,
isFocused,
expanded,
optionsArray,
hoverOption,
selectSize,
filteredOptionsCount,
updateTooltip,
updateTagTooltip,
debouncedOnInputChange,
onInput,
deletePrevTag,
deleteTag,
deleteSelected,
handleOptionSelect,
scrollToOption,
hasModelValue,
shouldShowPlaceholder,
currentPlaceholder,
mouseEnterEventName,
needStatusIcon,
showClearBtn,
iconComponent,
iconReverse,
validateState,
validateIcon,
showNewOption,
updateOptions: updateOptions2,
collapseTagSize,
setSelected,
selectDisabled,
emptyText,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd,
handleKeydown,
onOptionCreate,
onOptionDestroy,
handleMenuEnter,
focus,
blur,
handleClearClick,
handleClickOutside,
handleEsc,
toggleMenu,
selectOption,
getValueKey,
navigateOptions,
dropdownMenuVisible,
showTagList,
collapseTagList,
popupScroll,
getOption,
// computed style
tagStyle,
collapseTagStyle,
// DOM ref
popperRef,
inputRef,
tooltipRef,
tagTooltipRef,
prefixRef,
suffixRef,
selectRef,
wrapperRef,
selectionRef,
scrollbarRef,
menuRef,
tagMenuRef,
collapseItemRef
};
};
// node_modules/element-plus/es/components/select/src/options.mjs
var ElOptions = defineComponent({
name: "ElOptions",
setup(_2, { slots }) {
const select = inject(selectKey);
let cachedValueList = [];
return () => {
var _a, _b;
const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
const valueList = [];
function filterOptions(children2) {
if (!isArray(children2)) return;
children2.forEach((item) => {
var _a2, _b2, _c, _d;
const name = (_a2 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a2.name;
if (name === "ElOptionGroup") {
filterOptions(
!isString(item.children) && !isArray(item.children) && isFunction((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children
);
} else if (name === "ElOption") {
valueList.push((_d = item.props) == null ? void 0 : _d.value);
} else if (isArray(item.children)) {
filterOptions(item.children);
}
});
}
if (children.length) {
filterOptions((_b = children[0]) == null ? void 0 : _b.children);
}
if (!isEqual_default(valueList, cachedValueList)) {
cachedValueList = valueList;
if (select) {
select.states.optionValues = valueList;
}
}
return children;
};
}
});
// node_modules/element-plus/es/components/select/src/select.mjs
var selectProps = buildProps({
/**
* @description the name attribute of select input
*/
name: String,
/**
* @description native input id
*/
id: String,
/**
* @description binding value
*/
modelValue: {
type: definePropType([
Array,
String,
Number,
Boolean,
Object
]),
default: void 0
},
/**
* @description the autocomplete attribute of select input
*/
autocomplete: {
type: String,
default: "off"
},
/**
* @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused
*/
automaticDropdown: Boolean,
/**
* @description size of Input
*/
size: useSizeProp,
/**
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description whether Select is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether select can be cleared
*/
clearable: Boolean,
/**
* @description whether Select is filterable
*/
filterable: Boolean,
/**
* @description whether creating new items is allowed. To use this, `filterable` must be true
*/
allowCreate: Boolean,
/**
* @description whether Select is loading data from server
*/
loading: Boolean,
/**
* @description custom class name for Select's dropdown
*/
popperClass: {
type: String,
default: ""
},
/**
* @description custom style for Select's dropdown
*/
popperStyle: {
type: definePropType([String, Object])
},
/**
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
*/
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
/**
* @description whether options are loaded from server
*/
remote: Boolean,
/**
* @description debounce delay during remote search, in milliseconds
*/
debounce: {
type: Number,
default: 300
},
/**
* @description displayed text while loading data from server, default is 'Loading'
*/
loadingText: String,
/**
* @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'
*/
noMatchText: String,
/**
* @description displayed text when there is no options, you can also use slot `empty`, default is 'No data'
*/
noDataText: String,
/**
* @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true
*/
remoteMethod: {
type: definePropType(Function)
},
/**
* @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true
*/
filterMethod: {
type: definePropType(Function)
},
/**
* @description whether multiple-select is activated
*/
multiple: Boolean,
/**
* @description maximum number of options user can select when `multiple` is `true`. No limit when set to 0
*/
multipleLimit: {
type: Number,
default: 0
},
/**
* @description placeholder, default is 'Select'
*/
placeholder: {
type: String
},
/**
* @description select first matching option on enter key. Use with `filterable` or `remote`
*/
defaultFirstOption: Boolean,
/**
* @description when `multiple` and `filter` is true, whether to reserve current keyword after selecting an option
*/
reserveKeyword: {
type: Boolean,
default: true
},
/**
* @description unique identity key name for value, required when value is an object
*/
valueKey: {
type: String,
default: "value"
},
/**
* @description whether to collapse tags to a text when multiple selecting
*/
collapseTags: Boolean,
/**
* @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
*/
collapseTagsTooltip: Boolean,
/**
* @description the max tags number to be shown. To use this, `collapse-tags` must be true
*/
maxCollapseTags: {
type: Number,
default: 1
},
/**
* @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets
*/
teleported: useTooltipContentProps.teleported,
/**
* @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
/**
* @description custom clear icon component
*/
clearIcon: {
type: iconPropType,
default: circle_close_default
},
/**
* @description whether the width of the dropdown is the same as the input
*/
fitInputWidth: Boolean,
/**
* @description custom suffix icon component
*/
suffixIcon: {
type: iconPropType,
default: arrow_down_default
},
/**
* @description tag type
*/
tagType: { ...tagProps.type, default: "info" },
/**
* @description tag effect
*/
tagEffect: { ...tagProps.effect, default: "light" },
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description in remote search method show suffix icon
*/
remoteShowSuffix: Boolean,
/**
* @description determines whether the arrow is displayed
*/
showArrow: {
type: Boolean,
default: true
},
/**
* @description offset of the dropdown
*/
offset: {
type: Number,
default: 12
},
/**
* @description position of dropdown
*/
placement: {
type: definePropType(String),
values: Ee,
default: "bottom-start"
},
/**
* @description list of possible positions for dropdown
*/
fallbackPlacements: {
type: definePropType(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
/**
* @description tabindex for input
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description which element the selection dropdown appends to
*/
appendTo: useTooltipContentProps.appendTo,
options: {
type: definePropType(Array)
},
props: {
type: definePropType(Object),
default: () => defaultProps
},
...useEmptyValuesProps,
...useAriaProps(["ariaLabel"])
});
var selectEmits = {
[UPDATE_MODEL_EVENT]: (val) => true,
[CHANGE_EVENT]: (val) => true,
"popup-scroll": scrollbarEmits.scroll,
"remove-tag": (val) => true,
"visible-change": (visible) => true,
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true
};
// node_modules/element-plus/es/components/select/src/option-group.vue2.mjs
var _sfc_main29 = defineComponent({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
/**
* @description name of the group
*/
label: String,
/**
* @description whether to disable all options in this group
*/
disabled: Boolean
},
setup(props2) {
const ns = useNamespace("select");
const groupRef = ref();
const instance = getCurrentInstance();
const children = ref([]);
provide(
selectGroupKey,
reactive({
...toRefs(props2)
})
);
const visible = computed(
() => children.value.some((option) => option.visible === true)
);
const isOption = (node) => {
var _a;
return node.type.name === "ElOption" && !!((_a = node.component) == null ? void 0 : _a.proxy);
};
const flattedChildren2 = (node) => {
const nodes = castArray_default(node);
const children2 = [];
nodes.forEach((child) => {
var _a;
if (!isVNode(child)) return;
if (isOption(child)) {
children2.push(child.component.proxy);
} else if (isArray(child.children) && child.children.length) {
children2.push(...flattedChildren2(child.children));
} else if ((_a = child.component) == null ? void 0 : _a.subTree) {
children2.push(...flattedChildren2(child.component.subTree));
}
});
return children2;
};
const updateChildren = () => {
children.value = flattedChildren2(instance.subTree);
};
onMounted(() => {
updateChildren();
});
useMutationObserver(groupRef, updateChildren, {
attributes: true,
subtree: true,
childList: true
});
return {
groupRef,
visible,
ns
};
}
});
// node_modules/element-plus/es/components/select/src/option-group.vue.mjs
function _sfc_render4(_ctx, _cache, $props, $setup, $data, $options) {
return withDirectives((openBlock(), createElementBlock(
"ul",
{
ref: "groupRef",
class: normalizeClass(_ctx.ns.be("group", "wrap"))
},
[
createBaseVNode(
"li",
{
class: normalizeClass(_ctx.ns.be("group", "title"))
},
toDisplayString(_ctx.label),
3
/* TEXT, CLASS */
),
createBaseVNode("li", null, [
createBaseVNode(
"ul",
{
class: normalizeClass(_ctx.ns.b("group"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)
])
],
2
/* CLASS */
)), [
[vShow, _ctx.visible]
]);
}
var OptionGroup = _export_sfc(_sfc_main29, [["render", _sfc_render4]]);
// node_modules/element-plus/es/directives/click-outside/index.mjs
var nodeList = /* @__PURE__ */ new Map();
if (isClient) {
let startClick;
document.addEventListener("mousedown", (e) => startClick = e);
document.addEventListener("mouseup", (e) => {
if (startClick) {
for (const handlers2 of nodeList.values()) {
for (const { documentHandler } of handlers2) {
documentHandler(e, startClick);
}
}
startClick = void 0;
}
});
}
function createDocumentHandler(el, binding) {
let excludes = [];
if (isArray(binding.arg)) {
excludes = binding.arg;
} else if (isElement(binding.arg)) {
excludes.push(binding.arg);
}
return function(mouseup, mousedown) {
const popperRef = binding.instance.popperRef;
const mouseUpTarget = mouseup.target;
const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
const isBound = !binding || !binding.instance;
const isTargetExists = !mouseUpTarget || !mouseDownTarget;
const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
const isSelf = el === mouseUpTarget;
const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
return;
}
binding.value(mouseup, mousedown);
};
}
var ClickOutside = {
beforeMount(el, binding) {
if (!nodeList.has(el)) {
nodeList.set(el, []);
}
nodeList.get(el).push({
documentHandler: createDocumentHandler(el, binding),
bindingFn: binding.value
});
},
updated(el, binding) {
if (!nodeList.has(el)) {
nodeList.set(el, []);
}
const handlers2 = nodeList.get(el);
const oldHandlerIndex = handlers2.findIndex(
(item) => item.bindingFn === binding.oldValue
);
const newHandler = {
documentHandler: createDocumentHandler(el, binding),
bindingFn: binding.value
};
if (oldHandlerIndex >= 0) {
handlers2.splice(oldHandlerIndex, 1, newHandler);
} else {
handlers2.push(newHandler);
}
},
unmounted(el) {
nodeList.delete(el);
}
};
// node_modules/element-plus/es/hooks/use-calc-input-width/index.mjs
function useCalcInputWidth() {
const calculatorRef = shallowRef();
const calculatorWidth = ref(0);
const inputStyle = computed(() => ({
minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`
}));
const resetCalculatorWidth = () => {
var _a, _b;
calculatorWidth.value = (_b = (_a = calculatorRef.value) == null ? void 0 : _a.getBoundingClientRect().width) != null ? _b : 0;
};
useResizeObserver(calculatorRef, resetCalculatorWidth);
return {
calculatorRef,
calculatorWidth,
inputStyle
};
}
// node_modules/element-plus/es/components/select/src/select.vue2.mjs
var COMPONENT_NAME8 = "ElSelect";
var warnHandlerMap = /* @__PURE__ */ new WeakMap();
var createSelectWarnHandler = (appContext) => {
return (...args) => {
var _a, _b;
const message2 = args[0];
if (!message2 || message2.includes(
'Slot "default" invoked outside of the render function'
) && ((_a = args[2]) == null ? void 0 : _a.includes("ElTreeSelect")))
return;
const original = (_b = warnHandlerMap.get(appContext)) == null ? void 0 : _b.originalWarnHandler;
if (original) {
original(...args);
return;
}
console.warn(...args);
};
};
var getWarnHandlerRecord = (appContext) => {
let record = warnHandlerMap.get(appContext);
if (!record) {
record = {
originalWarnHandler: appContext.config.warnHandler,
handler: createSelectWarnHandler(appContext),
count: 0
};
warnHandlerMap.set(appContext, record);
}
return record;
};
var _sfc_main30 = defineComponent({
name: COMPONENT_NAME8,
componentName: COMPONENT_NAME8,
components: {
ElSelectMenu,
ElOption: Option,
ElOptions,
ElOptionGroup: OptionGroup,
ElTag,
ElScrollbar,
ElTooltip,
ElIcon
},
directives: { ClickOutside },
props: selectProps,
emits: [
UPDATE_MODEL_EVENT,
CHANGE_EVENT,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur",
"popup-scroll"
],
setup(props2, { emit, slots }) {
const instance = getCurrentInstance();
const warnRecord = getWarnHandlerRecord(instance.appContext);
warnRecord.count += 1;
instance.appContext.config.warnHandler = warnRecord.handler;
const modelValue = computed(() => {
const { modelValue: rawModelValue, multiple } = props2;
const fallback = multiple ? [] : void 0;
if (isArray(rawModelValue)) {
return multiple ? rawModelValue : fallback;
}
return multiple ? fallback : rawModelValue;
});
const _props = reactive({
...toRefs(props2),
modelValue
});
const API = useSelect(_props, emit);
const { calculatorRef, inputStyle } = useCalcInputWidth();
const { getLabel, getValue, getOptions, getDisabled } = useProps(props2);
const getOptionProps = (option) => ({
label: getLabel(option),
value: getValue(option),
disabled: getDisabled(option)
});
const flatTreeSelectData = (data) => {
return data.reduce((acc, item) => {
acc.push(item);
if (item.children && item.children.length > 0) {
acc.push(...flatTreeSelectData(item.children));
}
return acc;
}, []);
};
const manuallyRenderSlots = (vnodes) => {
const children = flattedChildren(vnodes || []);
children.forEach((item) => {
var _a;
if (isObject(item) && // @ts-expect-error
(item.type.name === "ElOption" || item.type.name === "ElTree")) {
const _name = item.type.name;
if (_name === "ElTree") {
const treeData = ((_a = item.props) == null ? void 0 : _a.data) || [];
const flatData = flatTreeSelectData(treeData);
flatData.forEach((treeItem) => {
treeItem.currentLabel = treeItem.label || (isObject(treeItem.value) ? "" : treeItem.value);
API.onOptionCreate(treeItem);
});
} else if (_name === "ElOption") {
const obj = { ...item.props };
obj.currentLabel = obj.label || (isObject(obj.value) ? "" : obj.value);
API.onOptionCreate(obj);
}
}
});
};
watch(
() => {
var _a;
return [(_a = slots.default) == null ? void 0 : _a.call(slots), modelValue.value];
},
() => {
var _a;
if (props2.persistent || API.expanded.value) {
return;
}
API.states.options.clear();
manuallyRenderSlots((_a = slots.default) == null ? void 0 : _a.call(slots));
},
{
immediate: true
}
);
provide(
selectKey,
reactive({
props: _props,
states: API.states,
selectRef: API.selectRef,
optionsArray: API.optionsArray,
setSelected: API.setSelected,
handleOptionSelect: API.handleOptionSelect,
onOptionCreate: API.onOptionCreate,
onOptionDestroy: API.onOptionDestroy
})
);
const selectedLabel = computed(() => {
if (!props2.multiple) {
return API.states.selectedLabel;
}
return API.states.selected.map((i) => i.currentLabel);
});
onBeforeUnmount(() => {
const record = warnHandlerMap.get(instance.appContext);
if (!record) return;
record.count -= 1;
if (record.count <= 0) {
instance.appContext.config.warnHandler = record.originalWarnHandler;
warnHandlerMap.delete(instance.appContext);
}
});
return {
...API,
modelValue,
selectedLabel,
calculatorRef,
inputStyle,
getLabel,
getValue,
getOptions,
getDisabled,
getOptionProps
};
}
});
// node_modules/element-plus/es/components/select/src/select.vue.mjs
var _hoisted_110 = ["id", "value", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label"];
var _hoisted_26 = ["textContent"];
var _hoisted_32 = { key: 1 };
function _sfc_render5(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_tag = resolveComponent("el-tag");
const _component_el_tooltip = resolveComponent("el-tooltip");
const _component_el_icon = resolveComponent("el-icon");
const _component_el_option = resolveComponent("el-option");
const _component_el_option_group = resolveComponent("el-option-group");
const _component_el_options = resolveComponent("el-options");
const _component_el_scrollbar = resolveComponent("el-scrollbar");
const _component_el_select_menu = resolveComponent("el-select-menu");
const _directive_click_outside = resolveDirective("click-outside");
return withDirectives((openBlock(), createElementBlock(
"div",
mergeProps({
ref: "selectRef",
class: [_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]
}, {
[toHandlerKey(_ctx.mouseEnterEventName)]: _cache[10] || (_cache[10] = ($event) => _ctx.states.inputHovering = true)
}, {
onMouseleave: _cache[11] || (_cache[11] = ($event) => _ctx.states.inputHovering = false)
}),
[
createVNode(_component_el_tooltip, {
ref: "tooltipRef",
visible: _ctx.dropdownMenuVisible,
placement: _ctx.placement,
teleported: _ctx.teleported,
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
"popper-style": _ctx.popperStyle,
"popper-options": _ctx.popperOptions,
"fallback-placements": _ctx.fallbackPlacements,
effect: _ctx.effect,
pure: "",
trigger: "click",
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": false,
"gpu-acceleration": false,
persistent: _ctx.persistent,
"append-to": _ctx.appendTo,
"show-arrow": _ctx.showArrow,
offset: _ctx.offset,
onBeforeShow: _ctx.handleMenuEnter,
onHide: _cache[9] || (_cache[9] = ($event) => _ctx.states.isBeforeHide = false)
}, {
default: withCtx(() => {
var _a;
return [
createBaseVNode(
"div",
{
ref: "wrapperRef",
class: normalizeClass([
_ctx.nsSelect.e("wrapper"),
_ctx.nsSelect.is("focused", _ctx.isFocused),
_ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
_ctx.nsSelect.is("filterable", _ctx.filterable),
_ctx.nsSelect.is("disabled", _ctx.selectDisabled)
]),
onClick: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
},
[
_ctx.$slots.prefix ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "prefixRef",
class: normalizeClass(_ctx.nsSelect.e("prefix"))
},
[
renderSlot(_ctx.$slots, "prefix")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
ref: "selectionRef",
class: normalizeClass([
_ctx.nsSelect.e("selection"),
_ctx.nsSelect.is(
"near",
_ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length
)
])
},
[
_ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
key: 0,
data: _ctx.states.selected,
deleteTag: _ctx.deleteTag,
selectDisabled: _ctx.selectDisabled
}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.showTagList, (item) => {
return openBlock(), createElementBlock(
"div",
{
key: _ctx.getValueKey(item),
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
closable: !_ctx.selectDisabled && !item.isDisabled,
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
"disable-transitions": "",
style: normalizeStyle(_ctx.tagStyle),
onClose: ($event) => _ctx.deleteTag($event, item)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
[
renderSlot(_ctx.$slots, "label", {
index: item.index,
label: item.currentLabel,
value: item.value
}, () => [
createTextVNode(
toDisplayString(item.currentLabel),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
)),
_ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
key: 0,
ref: "tagTooltipRef",
disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: _ctx.effect,
placement: "bottom",
"popper-class": _ctx.popperClass,
"popper-style": _ctx.popperStyle,
teleported: _ctx.teleported,
"popper-options": _ctx.popperOptions
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
ref: "collapseItemRef",
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
closable: false,
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
"disable-transitions": "",
style: normalizeStyle(_ctx.collapseTagStyle)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
" + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags),
3
/* TEXT, CLASS */
)
]),
_: 1
/* STABLE */
}, 8, ["size", "type", "effect", "style"])
],
2
/* CLASS */
)
]),
content: withCtx(() => [
createBaseVNode(
"div",
{
ref: "tagMenuRef",
class: normalizeClass(_ctx.nsSelect.e("selection"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.collapseTagList, (item) => {
return openBlock(), createElementBlock(
"div",
{
key: _ctx.getValueKey(item),
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
class: "in-tooltip",
closable: !_ctx.selectDisabled && !item.isDisabled,
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
"disable-transitions": "",
onClose: ($event) => _ctx.deleteTag($event, item)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
[
renderSlot(_ctx.$slots, "label", {
index: item.index,
label: item.currentLabel,
value: item.value
}, () => [
createTextVNode(
toDisplayString(item.currentLabel),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["closable", "size", "type", "effect", "onClose"])
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported", "popper-options"])) : createCommentVNode("v-if", true)
]) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([
_ctx.nsSelect.e("selected-item"),
_ctx.nsSelect.e("input-wrapper"),
_ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled)
])
},
[
createBaseVNode("input", {
id: _ctx.inputId,
ref: "inputRef",
value: _ctx.states.inputValue,
type: "text",
name: _ctx.name,
class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
disabled: _ctx.selectDisabled,
autocomplete: _ctx.autocomplete,
style: normalizeStyle(_ctx.inputStyle),
tabindex: _ctx.tabindex,
role: "combobox",
readonly: !_ctx.filterable,
spellcheck: "false",
"aria-activedescendant": ((_a = _ctx.hoverOption) == null ? void 0 : _a.id) || "",
"aria-controls": _ctx.contentId,
"aria-expanded": _ctx.dropdownMenuVisible,
"aria-label": _ctx.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
onCompositionstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
onCompositionupdate: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
onCompositionend: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
onClick: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
}, null, 46, _hoisted_110),
_ctx.filterable ? (openBlock(), createElementBlock("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
textContent: toDisplayString(_ctx.states.inputValue)
}, null, 10, _hoisted_26)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
_ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([
_ctx.nsSelect.e("selected-item"),
_ctx.nsSelect.e("placeholder"),
_ctx.nsSelect.is(
"transparent",
!_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue
)
])
},
[
_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
key: 0,
index: _ctx.getOption(_ctx.modelValue).index,
label: _ctx.currentPlaceholder,
value: _ctx.modelValue
}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.currentPlaceholder),
1
/* TEXT */
)
]) : (openBlock(), createElementBlock(
"span",
_hoisted_32,
toDisplayString(_ctx.currentPlaceholder),
1
/* TEXT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
ref: "suffixRef",
class: normalizeClass(_ctx.nsSelect.e("suffix"))
},
[
_ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, {
key: 0,
class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
_ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
key: 1,
class: normalizeClass([
_ctx.nsSelect.e("caret"),
_ctx.nsSelect.e("icon"),
_ctx.nsSelect.e("clear")
]),
onClick: _ctx.handleClearClick
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
key: 2,
class: normalizeClass([
_ctx.nsInput.e("icon"),
_ctx.nsInput.e("validateIcon"),
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
];
}),
content: withCtx(() => [
createVNode(
_component_el_select_menu,
{ ref: "menuRef" },
{
default: withCtx(() => [
_ctx.$slots.header ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
onClick: _cache[7] || (_cache[7] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "header")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
withDirectives(createVNode(_component_el_scrollbar, {
id: _ctx.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
"view-class": _ctx.nsSelect.be("dropdown", "list"),
class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": _ctx.ariaLabel,
"aria-orientation": "vertical",
onScroll: _ctx.popupScroll
}, {
default: withCtx(() => [
_ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
key: 0,
value: _ctx.states.inputValue,
created: true
}, null, 8, ["value"])) : createCommentVNode("v-if", true),
createVNode(_component_el_options, null, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default", {}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.options, (option, index) => {
var _a;
return openBlock(), createElementBlock(
Fragment,
{ key: index },
[
((_a = _ctx.getOptions(option)) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_el_option_group, {
key: 0,
label: _ctx.getLabel(option),
disabled: _ctx.getDisabled(option)
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.getOptions(option), (item) => {
return openBlock(), createBlock(
_component_el_option,
mergeProps({
key: _ctx.getValue(item)
}, { ref_for: true }, _ctx.getOptionProps(item)),
null,
16
/* FULL_PROPS */
);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 2
/* DYNAMIC */
}, 1032, ["label", "disabled"])) : (openBlock(), createBlock(
_component_el_option,
mergeProps({
key: 1,
ref_for: true
}, _ctx.getOptionProps(option)),
null,
16
/* FULL_PROPS */
))
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
_: 3
/* FORWARDED */
})
]),
_: 3
/* FORWARDED */
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label", "onScroll"]), [
[vShow, _ctx.states.options.size > 0 && !_ctx.loading]
]),
_ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
},
[
renderSlot(_ctx.$slots, "loading")
],
2
/* CLASS */
)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.emptyText),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"div",
{
key: 3,
class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
onClick: _cache[8] || (_cache[8] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
},
512
/* NEED_PATCH */
)
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
],
16
/* FULL_PROPS */
)), [
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
]);
}
var Select = _export_sfc(_sfc_main30, [["render", _sfc_render5]]);
// node_modules/element-plus/es/components/select/index.mjs
var ElSelect = withInstall(Select, {
Option,
OptionGroup
});
var ElOption = withNoopInstall(Option);
var ElOptionGroup = withNoopInstall(OptionGroup);
// node_modules/element-plus/es/components/calendar/src/select-controller.vue2.mjs
var _sfc_main31 = defineComponent({
...{
name: "SelectController"
},
__name: "select-controller",
props: selectControllerProps,
emits: selectControllerEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const nsSelect = useNamespace("calendar-select");
const { t, lang } = useLocale();
const monthOptions = Array.from({ length: 12 }, (_2, index) => {
const actualMonth = index + 1;
const label = isFunction(props2.formatter) ? props2.formatter(actualMonth, "month") : actualMonth;
return {
value: actualMonth,
label
};
});
const yearValue = computed(() => props2.date.year());
const monthValue = computed(() => props2.date.month() + 1);
const yearOptions = computed(() => {
const years = [];
for (let i = -10; i < 10; i++) {
const year = yearValue.value + i;
if (year > 0) {
const label = isFunction(props2.formatter) ? props2.formatter(year, "year") : year;
years.push({ value: year, label });
}
}
return years;
});
const handleYearChange = (year) => {
emit(
"date-change",
(0, import_dayjs4.default)(new Date(year, monthValue.value - 1, 1)).locale(lang.value)
);
};
const handleMonthChange = (month) => {
emit(
"date-change",
(0, import_dayjs4.default)(new Date(yearValue.value, month - 1, 1)).locale(lang.value)
);
};
const selectToday = () => {
emit("date-change", "today");
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
Fragment,
null,
[
createVNode(unref(ElSelect), {
"model-value": yearValue.value,
size: "small",
class: normalizeClass(unref(nsSelect).e("year")),
"validate-event": false,
options: yearOptions.value,
onChange: handleYearChange
}, null, 8, ["model-value", "class", "options"]),
createVNode(unref(ElSelect), {
"model-value": monthValue.value,
size: "small",
class: normalizeClass(unref(nsSelect).e("month")),
"validate-event": false,
options: unref(monthOptions),
onChange: handleMonthChange
}, null, 8, ["model-value", "class", "options"]),
createVNode(unref(ElButton), {
size: "small",
onClick: selectToday
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.today")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
})
],
64
/* STABLE_FRAGMENT */
);
};
}
});
// node_modules/element-plus/es/components/calendar/src/calendar.vue2.mjs
var COMPONENT_NAME9 = "ElCalendar";
var _sfc_main32 = defineComponent({
...{
name: COMPONENT_NAME9
},
__name: "calendar",
props: calendarProps,
emits: calendarEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const ns = useNamespace("calendar");
const props2 = __props;
const emit = __emit;
const {
calculateValidatedDateRange,
date,
pickDay,
realSelectedDay,
selectDate,
validatedRange,
handleDateChange
} = useCalendar(props2, emit, COMPONENT_NAME9);
const { t } = useLocale();
const i18nDate = computed(() => {
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
});
__expose({
/** @description currently selected date */
selectedDay: realSelectedDay,
/** @description select a specific date */
pickDay,
/** @description select date */
selectDate,
/** @description Calculate the validate date range according to the start and end dates */
calculateValidatedDateRange
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("header"))
},
[
renderSlot(_ctx.$slots, "header", { date: i18nDate.value }, () => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("title"))
},
toDisplayString(i18nDate.value),
3
/* TEXT, CLASS */
),
unref(validatedRange).length === 0 && __props.controllerType === "button" ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("button-group"))
},
[
createVNode(unref(ElButtonGroup), null, {
default: withCtx(() => [
createVNode(unref(ElButton), {
size: "small",
onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month"))
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.prevMonth")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}),
createVNode(unref(ElButton), {
size: "small",
onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today"))
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.today")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}),
createVNode(unref(ElButton), {
size: "small",
onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month"))
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.nextMonth")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
})
],
2
/* CLASS */
)) : unref(validatedRange).length === 0 && __props.controllerType === "select" ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("select-controller"))
},
[
createVNode(_sfc_main31, {
date: unref(date),
formatter: __props.formatter,
onDateChange: unref(handleDateChange)
}, null, 8, ["date", "formatter", "onDateChange"])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
),
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("body"))
},
[
createVNode(_sfc_main25, {
date: unref(date),
"selected-day": unref(realSelectedDay),
onPick: unref(pickDay)
}, createSlots({
_: 2
/* DYNAMIC */
}, [
_ctx.$slots["date-cell"] ? {
name: "date-cell",
fn: withCtx((data) => [
renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))
]),
key: "0"
} : void 0
]), 1032, ["date", "selected-day", "onPick"])
],
2
/* CLASS */
)) : (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("body"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(validatedRange), (range_, index) => {
return openBlock(), createBlock(_sfc_main25, {
key: index,
date: range_[0],
"selected-day": unref(realSelectedDay),
range: range_,
"hide-header": index !== 0,
onPick: unref(pickDay)
}, createSlots({
_: 2
/* DYNAMIC */
}, [
_ctx.$slots["date-cell"] ? {
name: "date-cell",
fn: withCtx((data) => [
renderSlot(_ctx.$slots, "date-cell", mergeProps({ ref_for: true }, data))
]),
key: "0"
} : void 0
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
))
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/calendar/index.mjs
var ElCalendar = withInstall(_sfc_main32);
// node_modules/element-plus/es/components/card/src/card.mjs
var cardProps = buildProps({
/**
* @description title of the card. Also accepts a DOM passed by `slot#header`
*/
header: {
type: String,
default: ""
},
/**
* @description content of footer. Also accepts a DOM passed by `slot#footer`
*/
footer: {
type: String,
default: ""
},
/**
* @description CSS style of card body
*/
bodyStyle: {
type: definePropType([String, Object, Array]),
default: ""
},
/**
* @description custom class name of card footer
*/
headerClass: String,
/**
* @description custom class name of card body
*/
bodyClass: String,
/**
* @description custom class name of card footer
*/
footerClass: String,
/**
* @description when to show card shadows
*/
shadow: {
type: String,
values: ["always", "hover", "never"],
default: void 0
}
});
var cardContextKey = /* @__PURE__ */ Symbol("cardContextKey");
// node_modules/element-plus/es/components/card/src/card.vue2.mjs
var _sfc_main33 = defineComponent({
...{
name: "ElCard"
},
__name: "card",
props: cardProps,
setup(__props) {
const globalConfig2 = useGlobalConfig("card");
const ns = useNamespace("card");
return (_ctx, _cache) => {
var _a;
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ns).b(),
unref(ns).is(`${__props.shadow || ((_a = unref(globalConfig2)) == null ? void 0 : _a.shadow) || "always"}-shadow`)
])
},
[
_ctx.$slots.header || __props.header ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass([unref(ns).e("header"), __props.headerClass])
},
[
renderSlot(_ctx.$slots, "header", {}, () => [
createTextVNode(
toDisplayString(__props.header),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("body"), __props.bodyClass]),
style: normalizeStyle(__props.bodyStyle)
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
),
_ctx.$slots.footer || __props.footer ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
},
[
renderSlot(_ctx.$slots, "footer", {}, () => [
createTextVNode(
toDisplayString(__props.footer),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/card/index.mjs
var ElCard = withInstall(_sfc_main33);
// node_modules/element-plus/es/components/carousel/src/carousel.mjs
var carouselProps = buildProps({
/**
* @description index of the initially active slide (starting from 0)
*/
initialIndex: {
type: Number,
default: 0
},
/**
* @description height of the carousel
*/
height: {
type: String,
default: ""
},
/**
* @description how indicators are triggered
*/
trigger: {
type: String,
values: ["hover", "click"],
default: "hover"
},
/**
* @description whether automatically loop the slides
*/
autoplay: {
type: Boolean,
default: true
},
/**
* @description interval of the auto loop, in milliseconds
*/
interval: {
type: Number,
default: 3e3
},
/**
* @description position of the indicators
*/
indicatorPosition: {
type: String,
values: ["", "none", "outside"],
default: ""
},
/**
* @description when arrows are shown
*/
arrow: {
type: String,
values: ["always", "hover", "never"],
default: "hover"
},
/**
* @description type of the Carousel
*/
type: {
type: String,
values: ["", "card"],
default: ""
},
/**
* @description when type is card, scaled size of secondary cards
*/
cardScale: {
type: Number,
default: 0.83
},
/**
* @description display the items in loop
*/
loop: {
type: Boolean,
default: true
},
/**
* @description display direction
*/
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
/**
* @description pause autoplay when hover
*/
pauseOnHover: {
type: Boolean,
default: true
},
/**
* @description infuse dynamism and smoothness into the carousel
*/
motionBlur: Boolean
});
var carouselEmits = {
/**
* @description triggers when the active slide switches
* @param current index of the new active slide
* @param prev index of the old active slide
*/
change: (current, prev) => [current, prev].every(isNumber)
};
// node_modules/element-plus/es/components/carousel/src/constants.mjs
var carouselContextKey = /* @__PURE__ */ Symbol("carouselContextKey");
var CAROUSEL_ITEM_NAME = "ElCarouselItem";
// node_modules/element-plus/es/hooks/use-ordered-children/index.mjs
var getOrderedChildren = (vm, childComponentName, children) => {
const nodes = flattedChildren(vm.subTree).filter(
(n) => {
var _a;
return isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component;
}
);
const uids = nodes.map((n) => n.component.uid);
return uids.map((uid2) => children[uid2]).filter((p2) => !!p2);
};
var useOrderedChildren = (vm, childComponentName) => {
const children = shallowRef({});
const orderedChildren = shallowRef([]);
const nodesMap = /* @__PURE__ */ new WeakMap();
const addChild = (child) => {
children.value[child.uid] = child;
triggerRef(children);
onMounted(() => {
const childNode = child.getVnode().el;
const parentNode = childNode.parentNode;
if (!nodesMap.has(parentNode)) {
nodesMap.set(parentNode, []);
const originalFn = parentNode.insertBefore.bind(parentNode);
parentNode.insertBefore = (node, anchor) => {
const shouldSortChildren = nodesMap.get(parentNode).some((el) => node === el || anchor === el);
if (shouldSortChildren) triggerRef(children);
return originalFn(node, anchor);
};
}
nodesMap.get(parentNode).push(childNode);
});
};
const removeChild = (child) => {
delete children.value[child.uid];
triggerRef(children);
const childNode = child.getVnode().el;
const parentNode = childNode.parentNode;
const childNodes = nodesMap.get(parentNode);
const index = childNodes.indexOf(childNode);
childNodes.splice(index, 1);
};
const sortChildren = () => {
orderedChildren.value = getOrderedChildren(
vm,
childComponentName,
children.value
);
};
const IsolatedRenderer = (props2) => {
return props2.render();
};
const ChildrenSorter = defineComponent({
setup(_2, { slots }) {
return () => {
sortChildren();
return slots.default ? (
// Create a new `ReactiveEffect` to ensure `ChildrenSorter` doesn't track any extra dependencies
// @ts-ignore TODO: Remove this after Vue is upgraded
h(IsolatedRenderer, {
render: slots.default
})
) : null;
};
}
});
return {
children: orderedChildren,
addChild,
removeChild,
ChildrenSorter
};
};
// node_modules/element-plus/es/components/carousel/src/use-carousel.mjs
var THROTTLE_TIME = 300;
var useCarousel = (props2, emit, componentName2) => {
const {
children: items,
addChild: addItem,
removeChild: removeItem,
ChildrenSorter: ItemsSorter
} = useOrderedChildren(
getCurrentInstance(),
CAROUSEL_ITEM_NAME
);
const slots = useSlots();
const activeIndex = ref(-1);
const timer = ref(null);
const hover = ref(false);
const root = ref();
const containerHeight = ref(0);
const isItemsTwoLength = ref(true);
const arrowDisplay = computed(
() => props2.arrow !== "never" && !unref(isVertical)
);
const hasLabel = computed(() => {
return items.value.some((item) => item.props.label.toString().length > 0);
});
const isCardType = computed(() => props2.type === "card");
const isVertical = computed(() => props2.direction === "vertical");
const containerStyle = computed(() => {
if (props2.height !== "auto") {
return {
height: props2.height
};
}
return {
height: `${containerHeight.value}px`,
overflow: "hidden"
};
});
const throttledArrowClick = throttle_default(
(index) => {
setActiveItem(index);
},
THROTTLE_TIME,
{ trailing: true }
);
const throttledIndicatorHover = throttle_default((index) => {
handleIndicatorHover(index);
}, THROTTLE_TIME);
const isTwoLengthShow = (index) => {
if (!isItemsTwoLength.value) return true;
return activeIndex.value <= 1 ? index <= 1 : index > 1;
};
function pauseTimer() {
if (timer.value) {
clearInterval(timer.value);
timer.value = null;
}
}
function startTimer() {
if (props2.interval <= 0 || !props2.autoplay || timer.value) return;
timer.value = setInterval(() => playSlides(), props2.interval);
}
const playSlides = () => {
if (activeIndex.value < items.value.length - 1) {
activeIndex.value = activeIndex.value + 1;
} else if (props2.loop) {
activeIndex.value = 0;
}
};
function setActiveItem(index) {
if (isString(index)) {
const filteredItems = items.value.filter(
(item) => item.props.name === index
);
if (filteredItems.length > 0) {
index = items.value.indexOf(filteredItems[0]);
}
}
index = Number(index);
if (Number.isNaN(index) || index !== Math.floor(index)) {
debugWarn(componentName2, "index must be integer.");
return;
}
const itemCount = items.value.length;
const oldIndex = activeIndex.value;
if (index < 0) {
activeIndex.value = props2.loop ? itemCount - 1 : 0;
} else if (index >= itemCount) {
activeIndex.value = props2.loop ? 0 : itemCount - 1;
} else {
activeIndex.value = index;
}
if (oldIndex === activeIndex.value) {
resetItemPosition(oldIndex);
}
resetTimer();
}
function resetItemPosition(oldIndex) {
items.value.forEach((item, index) => {
item.translateItem(index, activeIndex.value, oldIndex);
});
}
function itemInStage(item, index) {
var _a, _b, _c, _d;
const _items = unref(items);
const itemCount = _items.length;
if (itemCount === 0 || !item.states.inStage) return false;
const nextItemIndex = index + 1;
const prevItemIndex = index - 1;
const lastItemIndex = itemCount - 1;
const isLastItemActive = _items[lastItemIndex].states.active;
const isFirstItemActive = _items[0].states.active;
const isNextItemActive = (_b = (_a = _items[nextItemIndex]) == null ? void 0 : _a.states) == null ? void 0 : _b.active;
const isPrevItemActive = (_d = (_c = _items[prevItemIndex]) == null ? void 0 : _c.states) == null ? void 0 : _d.active;
if (index === lastItemIndex && isFirstItemActive || isNextItemActive) {
return "left";
} else if (index === 0 && isLastItemActive || isPrevItemActive) {
return "right";
}
return false;
}
function handleMouseEnter() {
hover.value = true;
if (props2.pauseOnHover) {
pauseTimer();
}
}
function handleMouseLeave() {
hover.value = false;
startTimer();
}
function handleButtonEnter(arrow3) {
if (unref(isVertical)) return;
items.value.forEach((item, index) => {
if (arrow3 === itemInStage(item, index)) {
item.states.hover = true;
}
});
}
function handleButtonLeave() {
if (unref(isVertical)) return;
items.value.forEach((item) => {
item.states.hover = false;
});
}
function handleIndicatorClick(index) {
activeIndex.value = index;
}
function handleIndicatorHover(index) {
if (props2.trigger === "hover" && index !== activeIndex.value) {
activeIndex.value = index;
}
}
function prev() {
setActiveItem(activeIndex.value - 1);
}
function next() {
setActiveItem(activeIndex.value + 1);
}
function resetTimer() {
pauseTimer();
if (!props2.pauseOnHover) startTimer();
}
function setContainerHeight(height) {
if (props2.height !== "auto") return;
containerHeight.value = height;
}
function PlaceholderItem() {
var _a;
const defaultSlots = (_a = slots.default) == null ? void 0 : _a.call(slots);
if (!defaultSlots) return null;
const flatSlots = flattedChildren(defaultSlots);
const normalizeSlots = flatSlots.filter((slot) => {
return isVNode(slot) && slot.type.name === CAROUSEL_ITEM_NAME;
});
if ((normalizeSlots == null ? void 0 : normalizeSlots.length) === 2 && props2.loop && !isCardType.value) {
isItemsTwoLength.value = true;
return normalizeSlots;
}
isItemsTwoLength.value = false;
return null;
}
watch(
() => activeIndex.value,
(current, prev2) => {
resetItemPosition(prev2);
if (isItemsTwoLength.value) {
current = current % 2;
prev2 = prev2 % 2;
}
if (prev2 > -1) {
emit(CHANGE_EVENT, current, prev2);
}
}
);
const exposeActiveIndex = computed({
get: () => {
return isItemsTwoLength.value ? activeIndex.value % 2 : activeIndex.value;
},
set: (value) => activeIndex.value = value
});
watch(
() => props2.autoplay,
(autoplay) => {
autoplay ? startTimer() : pauseTimer();
}
);
watch(
() => props2.loop,
() => {
setActiveItem(activeIndex.value);
}
);
watch(
() => props2.interval,
() => {
resetTimer();
}
);
const resizeObserver = shallowRef();
onMounted(() => {
watch(
() => items.value,
() => {
if (items.value.length > 0) setActiveItem(props2.initialIndex);
},
{
immediate: true
}
);
resizeObserver.value = useResizeObserver(root.value, () => {
resetItemPosition();
});
startTimer();
});
onBeforeUnmount(() => {
pauseTimer();
if (root.value && resizeObserver.value) resizeObserver.value.stop();
});
provide(carouselContextKey, {
root,
isCardType,
isVertical,
items,
loop: props2.loop,
cardScale: props2.cardScale,
addItem,
removeItem,
setActiveItem,
setContainerHeight
});
return {
root,
activeIndex,
exposeActiveIndex,
arrowDisplay,
hasLabel,
hover,
isCardType,
items,
isVertical,
containerStyle,
isItemsTwoLength,
handleButtonEnter,
handleButtonLeave,
handleIndicatorClick,
handleMouseEnter,
handleMouseLeave,
setActiveItem,
prev,
next,
PlaceholderItem,
isTwoLengthShow,
ItemsSorter,
throttledArrowClick,
throttledIndicatorHover
};
};
// node_modules/element-plus/es/components/carousel/src/carousel.vue2.mjs
var _hoisted_111 = ["aria-label"];
var _hoisted_27 = ["aria-label"];
var _hoisted_33 = ["onMouseenter", "onClick"];
var _hoisted_4 = ["aria-label"];
var _hoisted_5 = { key: 0 };
var _hoisted_6 = {
key: 2,
xmlns: "http://www.w3.org/2000/svg",
version: "1.1",
style: { "display": "none" }
};
var COMPONENT_NAME10 = "ElCarousel";
var _sfc_main34 = defineComponent({
...{
name: COMPONENT_NAME10
},
__name: "carousel",
props: carouselProps,
emits: carouselEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const {
root,
activeIndex,
exposeActiveIndex,
arrowDisplay,
hasLabel,
hover,
isCardType,
items,
isVertical,
containerStyle,
handleButtonEnter,
handleButtonLeave,
handleIndicatorClick,
handleMouseEnter,
handleMouseLeave,
setActiveItem,
prev,
next,
PlaceholderItem,
isTwoLengthShow,
ItemsSorter,
throttledArrowClick,
throttledIndicatorHover
} = useCarousel(props2, emit, COMPONENT_NAME10);
const ns = useNamespace("carousel");
const { t } = useLocale();
const carouselClasses = computed(() => {
const classes = [ns.b(), ns.m(props2.direction)];
if (unref(isCardType)) {
classes.push(ns.m("card"));
}
return classes;
});
const indicatorsClasses = computed(() => {
const classes = [ns.e("indicators"), ns.em("indicators", props2.direction)];
if (unref(hasLabel)) {
classes.push(ns.em("indicators", "labels"));
}
if (props2.indicatorPosition === "outside") {
classes.push(ns.em("indicators", "outside"));
}
if (unref(isVertical)) {
classes.push(ns.em("indicators", "right"));
}
return classes;
});
function handleTransitionStart(e) {
if (!props2.motionBlur) return;
const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
e.currentTarget.classList.add(kls);
}
function handleTransitionEnd(e) {
if (!props2.motionBlur) return;
const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
e.currentTarget.classList.remove(kls);
}
__expose({
/** @description active slide index */
activeIndex: exposeActiveIndex,
/** @description manually switch slide, index of the slide to be switched to, starting from 0; or the `name` of corresponding `el-carousel-item` */
setActiveItem,
/** @description switch to the previous slide */
prev,
/** @description switch to the next slide */
next
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "root",
ref: root,
class: normalizeClass(carouselClasses.value),
onMouseenter: _cache[6] || (_cache[6] = withModifiers(
//@ts-ignore
(...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args),
["stop"]
)),
onMouseleave: _cache[7] || (_cache[7] = withModifiers(
//@ts-ignore
(...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args),
["stop"]
))
},
[
unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
key: 0,
name: "carousel-arrow-left",
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")]),
"aria-label": unref(t)("el.carousel.leftArrow"),
onMouseenter: _cache[0] || (_cache[0] = ($event) => unref(handleButtonEnter)("left")),
onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)),
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) - 1), ["stop"]))
}, [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
})
], 42, _hoisted_111), [
[vShow, (__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) > 0)]
])
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
key: 1,
name: "carousel-arrow-right",
persisted: ""
}, {
default: withCtx(() => [
withDirectives(createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")]),
"aria-label": unref(t)("el.carousel.rightArrow"),
onMouseenter: _cache[3] || (_cache[3] = ($event) => unref(handleButtonEnter)("right")),
onMouseleave: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)),
onClick: _cache[5] || (_cache[5] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) + 1), ["stop"]))
}, [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
], 42, _hoisted_27), [
[
vShow,
(__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) < unref(items).length - 1)
]
])
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("container")),
style: normalizeStyle(unref(containerStyle)),
onTransitionstart: handleTransitionStart,
onTransitionend: handleTransitionEnd
},
[
createVNode(unref(PlaceholderItem)),
renderSlot(_ctx.$slots, "default")
],
38
/* CLASS, STYLE, NEED_HYDRATION */
),
createVNode(unref(ItemsSorter), null, {
default: withCtx(() => [
__props.indicatorPosition !== "none" ? (openBlock(), createElementBlock(
"ul",
{
key: 0,
class: normalizeClass(indicatorsClasses.value)
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(items), (item, index) => {
return withDirectives((openBlock(), createElementBlock("li", {
key: index,
class: normalizeClass([
unref(ns).e("indicator"),
unref(ns).em("indicator", __props.direction),
unref(ns).is("active", index === unref(activeIndex))
]),
onMouseenter: ($event) => unref(throttledIndicatorHover)(index),
onClick: withModifiers(($event) => unref(handleIndicatorClick)(index), ["stop"])
}, [
createBaseVNode("button", {
class: normalizeClass(unref(ns).e("button")),
"aria-label": unref(t)("el.carousel.indicator", { index: index + 1 })
}, [
unref(hasLabel) ? (openBlock(), createElementBlock(
"span",
_hoisted_5,
toDisplayString(item.props.label),
1
/* TEXT */
)) : createCommentVNode("v-if", true)
], 10, _hoisted_4)
], 42, _hoisted_33)), [
[vShow, unref(isTwoLengthShow)(index)]
]);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
}),
__props.motionBlur ? (openBlock(), createElementBlock("svg", _hoisted_6, [..._cache[8] || (_cache[8] = [
createBaseVNode(
"defs",
null,
[
createBaseVNode("filter", { id: "elCarouselHorizontal" }, [
createBaseVNode("feGaussianBlur", {
in: "SourceGraphic",
stdDeviation: "12,0"
})
]),
createBaseVNode("filter", { id: "elCarouselVertical" }, [
createBaseVNode("feGaussianBlur", {
in: "SourceGraphic",
stdDeviation: "0,10"
})
])
],
-1
/* CACHED */
)
])])) : createCommentVNode("v-if", true)
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/carousel/src/carousel-item.mjs
var carouselItemProps = buildProps({
/**
* @description name of the item, can be used in `setActiveItem`
*/
name: { type: String, default: "" },
/**
* @description text content for the corresponding indicator
*/
label: {
type: [String, Number],
default: ""
}
});
// node_modules/element-plus/es/components/carousel/src/use-carousel-item.mjs
var useCarouselItem = (props2) => {
const carouselContext = inject(carouselContextKey);
const instance = getCurrentInstance();
if (!carouselContext) {
debugWarn(
CAROUSEL_ITEM_NAME,
"usage: "
);
}
if (!instance) {
debugWarn(
CAROUSEL_ITEM_NAME,
"compositional hook can only be invoked inside setups"
);
}
const carouselItemRef = ref();
const hover = ref(false);
const translate2 = ref(0);
const scale = ref(1);
const active = ref(false);
const ready = ref(false);
const inStage = ref(false);
const animating = ref(false);
const { isCardType, isVertical, cardScale } = carouselContext;
function processIndex(index, activeIndex, length) {
const lastItemIndex = length - 1;
const prevItemIndex = activeIndex - 1;
const nextItemIndex = activeIndex + 1;
const halfItemIndex = length / 2;
if (activeIndex === 0 && index === lastItemIndex) {
return -1;
} else if (activeIndex === lastItemIndex && index === 0) {
return length;
} else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) {
return length + 1;
} else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) {
return -2;
}
return index;
}
function calcCardTranslate(index, activeIndex) {
var _a, _b;
const parentWidth = unref(isVertical) ? ((_a = carouselContext.root.value) == null ? void 0 : _a.offsetHeight) || 0 : ((_b = carouselContext.root.value) == null ? void 0 : _b.offsetWidth) || 0;
if (inStage.value) {
return parentWidth * ((2 - cardScale) * (index - activeIndex) + 1) / 4;
} else if (index < activeIndex) {
return -(1 + cardScale) * parentWidth / 4;
} else {
return (3 + cardScale) * parentWidth / 4;
}
}
function calcTranslate(index, activeIndex, isVertical2) {
const rootEl = carouselContext.root.value;
if (!rootEl) return 0;
const distance = (isVertical2 ? rootEl.offsetHeight : rootEl.offsetWidth) || 0;
return distance * (index - activeIndex);
}
const translateItem = (index, activeIndex, oldIndex) => {
var _a;
const _isCardType = unref(isCardType);
const carouselItemLength = (_a = carouselContext.items.value.length) != null ? _a : Number.NaN;
const isActive = index === activeIndex;
if (!_isCardType && !isUndefined(oldIndex)) {
animating.value = isActive || index === oldIndex;
}
if (!isActive && carouselItemLength > 2 && carouselContext.loop) {
index = processIndex(index, activeIndex, carouselItemLength);
}
const _isVertical = unref(isVertical);
active.value = isActive;
if (_isCardType) {
inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1;
translate2.value = calcCardTranslate(index, activeIndex);
scale.value = unref(active) ? 1 : cardScale;
} else {
translate2.value = calcTranslate(index, activeIndex, _isVertical);
}
ready.value = true;
if (isActive && carouselItemRef.value) {
carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight);
}
};
function handleItemClick() {
if (carouselContext && unref(isCardType)) {
const index = carouselContext.items.value.findIndex(
({ uid: uid2 }) => uid2 === instance.uid
);
carouselContext.setActiveItem(index);
}
}
const carouselItemContext = {
props: props2,
states: reactive({
hover,
translate: translate2,
scale,
active,
ready,
inStage,
animating
}),
uid: instance.uid,
getVnode: () => instance.vnode,
translateItem
};
carouselContext.addItem(carouselItemContext);
onBeforeUnmount(() => {
carouselContext.removeItem(carouselItemContext);
});
return {
carouselItemRef,
active,
animating,
hover,
inStage,
isVertical,
translate: translate2,
isCardType,
scale,
ready,
handleItemClick
};
};
// node_modules/element-plus/es/components/carousel/src/carousel-item.vue2.mjs
var _sfc_main35 = defineComponent({
...{
name: CAROUSEL_ITEM_NAME
},
__name: "carousel-item",
props: carouselItemProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("carousel");
const {
carouselItemRef,
active,
animating,
hover,
inStage,
isVertical,
translate: translate2,
isCardType,
scale,
ready,
handleItemClick
} = useCarouselItem(props2);
const itemKls = computed(() => [
ns.e("item"),
ns.is("active", active.value),
ns.is("in-stage", inStage.value),
ns.is("hover", hover.value),
ns.is("animating", animating.value),
{
[ns.em("item", "card")]: isCardType.value,
[ns.em("item", "card-vertical")]: isCardType.value && isVertical.value
}
]);
const itemStyle = computed(() => {
const translateType = `translate${unref(isVertical) ? "Y" : "X"}`;
const _translate = `${translateType}(${unref(translate2)}px)`;
const _scale = `scale(${unref(scale)})`;
const transform = [_translate, _scale].join(" ");
return {
transform
};
});
return (_ctx, _cache) => {
return withDirectives((openBlock(), createElementBlock(
"div",
{
ref_key: "carouselItemRef",
ref: carouselItemRef,
class: normalizeClass(itemKls.value),
style: normalizeStyle(itemStyle.value),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleItemClick) && unref(handleItemClick)(...args))
},
[
unref(isCardType) ? withDirectives((openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("mask"))
},
null,
2
/* CLASS */
)), [
[vShow, !unref(active)]
]) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
)), [
[vShow, unref(ready)]
]);
};
}
});
// node_modules/element-plus/es/components/carousel/index.mjs
var ElCarousel = withInstall(_sfc_main34, {
CarouselItem: _sfc_main35
});
var ElCarouselItem = withNoopInstall(_sfc_main35);
// node_modules/element-plus/es/components/cascader-panel/src/config.mjs
var CommonProps = buildProps({
/**
* @description specify which key of node object is used as the node's value
*/
modelValue: {
type: definePropType([Number, String, Array, Object])
},
/**
* @description data of the options, the key of `value` and `label` can be customize by `CascaderProps`.
*/
options: {
type: definePropType(Array),
default: () => []
},
/**
* @description configuration options, see the following `CascaderProps` table.
*/
props: {
type: definePropType(Object),
default: () => ({})
}
});
var DefaultProps = {
/**
* @description trigger mode of expanding options
*/
expandTrigger: "click",
/**
* @description whether multiple selection is enabled
*/
multiple: false,
/**
* @description whether checked state of a node not affects its parent and child nodes
*/
checkStrictly: false,
// whether all nodes can be selected
/**
* @description when checked nodes change, whether to emit an array of node's path, if false, only emit the value of node.
*/
emitPath: true,
// wether to emit an array of all levels value in which node is located
/**
* @description whether to dynamic load child nodes, use with `lazyload` attribute
*/
lazy: false,
/**
* @description method for loading child nodes data, only works when `lazy` is true
*/
lazyLoad: NOOP,
/**
* @description specify which key of node object is used as the node's value
*/
value: "value",
/**
* @description specify which key of node object is used as the node's label
*/
label: "label",
/**
* @description specify which key of node object is used as the node's children
*/
children: "children",
/**
* @description specify which key of node object is used as the node's leaf
*/
leaf: "leaf",
/**
* @description specify which key of node object is used as the node's disabled
*/
disabled: "disabled",
/**
* @description hover threshold of expanding options
*/
hoverThreshold: 500,
/**
* @description whether to check or uncheck node when clicking on the node
*/
checkOnClickNode: false,
/**
* @description whether to check or uncheck node when clicking on leaf node (last children).
*/
checkOnClickLeaf: true,
/**
* @description whether to show the radio or checkbox prefix
*/
showPrefix: true
};
var cascaderPanelProps = buildProps({
...CommonProps,
border: {
type: Boolean,
default: true
},
renderLabel: {
type: Function
}
});
var emitChangeFn = (value) => true;
var cascaderPanelEmits = {
[UPDATE_MODEL_EVENT]: emitChangeFn,
[CHANGE_EVENT]: emitChangeFn,
close: () => true,
"expand-change": (value) => value
};
var useCascaderConfig = (props2) => {
return computed(() => ({
...DefaultProps,
...props2.props
}));
};
// node_modules/element-plus/es/components/cascader/src/cascader.mjs
var cascaderProps = buildProps({
...CommonProps,
/**
* @description size of input
*/
size: useSizeProp,
/**
* @description placeholder of input
*/
placeholder: String,
/**
* @description whether Cascader is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether selected value can be cleared
*/
clearable: Boolean,
/**
* @description custom clear icon component
*/
clearIcon: {
type: iconPropType,
default: circle_close_default
},
/**
* @description whether the options can be searched
*/
filterable: Boolean,
/**
* @description customize search logic, the first parameter is `node`, the second is `keyword`, and need return a boolean value indicating whether it hits.
*/
filterMethod: {
type: definePropType(
Function
),
default: (node, keyword) => node.text.includes(keyword)
},
/**
* @description option label separator
*/
separator: {
type: String,
default: " / "
},
/**
* @description whether to display all levels of the selected value in the input
*/
showAllLevels: {
type: Boolean,
default: true
},
/**
* @description whether to collapse tags in multiple selection mode
*/
collapseTags: Boolean,
/**
* @description The max tags number to be shown. To use this, collapse-tags must be true
*/
maxCollapseTags: {
type: Number,
default: 1
},
/**
* @description whether show all selected tags when mouse hover text of collapse-tags. To use this, collapse-tags must be true
*/
collapseTagsTooltip: Boolean,
/**
* @description The max height of collapse tags tooltip, in pixels. To use this, collapse-tags-tooltip must be true
*/
maxCollapseTagsTooltipHeight: {
type: [String, Number]
},
/**
* @description debounce delay when typing filter keyword, in milliseconds
*/
debounce: {
type: Number,
default: 300
},
/**
* @description hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted
*/
beforeFilter: {
type: definePropType(Function),
default: () => true
},
/**
* @description position of dropdown
*/
placement: {
type: definePropType(String),
values: Ee,
default: "bottom-start"
},
/**
* @description list of possible positions for dropdown
*/
fallbackPlacements: {
type: definePropType(Array),
default: ["bottom-start", "bottom", "top-start", "top", "right", "left"]
},
/**
* @description custom class name for Cascader's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for Cascader's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description whether cascader popup is teleported
*/
teleported: useTooltipContentProps.teleported,
/**
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description tag type
*/
tagType: { ...tagProps.type, default: "info" },
/**
* @description tag effect
*/
tagEffect: { ...tagProps.effect, default: "light" },
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description when dropdown is inactive and `persistent` is `false`, dropdown will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
/**
* @description Use `parent` when you want things tidy (like "Entire Collection" instead of listing 100 items)
* Use `child` when every single item matters (like important settings)
*/
showCheckedStrategy: {
type: String,
values: ["parent", "child"],
default: "child"
},
/**
* @description whether to check or uncheck node when clicking on the node
*/
checkOnClickNode: Boolean,
/**
* @description whether to show the radio or checkbox prefix
*/
showPrefix: {
type: Boolean,
default: true
},
...useEmptyValuesProps
});
var emitChangeFn2 = (value) => true;
var cascaderEmits = {
[UPDATE_MODEL_EVENT]: emitChangeFn2,
[CHANGE_EVENT]: emitChangeFn2,
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true,
visibleChange: (val) => isBoolean(val),
expandChange: (val) => !!val,
removeTag: (val) => !!val
};
// node_modules/element-plus/es/components/checkbox/src/checkbox.mjs
var checkboxProps = {
/**
* @description binding value
*/
modelValue: {
type: [Number, String, Boolean],
default: void 0
},
/**
* @description label of the Checkbox when used inside a `checkbox-group`
*/
label: {
type: [String, Boolean, Number, Object],
default: void 0
},
/**
* @description value of the Checkbox when used inside a `checkbox-group`
*/
value: {
type: [String, Boolean, Number, Object],
default: void 0
},
/**
* @description Set indeterminate state, only responsible for style control
*/
indeterminate: Boolean,
/**
* @description whether the Checkbox is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description if the Checkbox is checked
*/
checked: Boolean,
/**
* @description native 'name' attribute
*/
name: {
type: String,
default: void 0
},
/**
* @description value of the Checkbox if it's checked
*/
trueValue: {
type: [String, Number],
default: void 0
},
/**
* @description value of the Checkbox if it's not checked
*/
falseValue: {
type: [String, Number],
default: void 0
},
/**
* @deprecated use `trueValue` instead
* @description value of the Checkbox if it's checked
*/
trueLabel: {
type: [String, Number],
default: void 0
},
/**
* @deprecated use `falseValue` instead
* @description value of the Checkbox if it's not checked
*/
falseLabel: {
type: [String, Number],
default: void 0
},
/**
* @description input id
*/
id: {
type: String,
default: void 0
},
/**
* @description whether to add a border around Checkbox
*/
border: Boolean,
/**
* @description size of the Checkbox
*/
size: useSizeProp,
/**
* @description input tabindex
*/
tabindex: [String, Number],
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
ariaLabel: String,
...useAriaProps(["ariaControls"])
};
var checkboxEmits = {
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
change: (val) => isString(val) || isNumber(val) || isBoolean(val)
};
var checkboxPropsDefaults = {
modelValue: void 0,
label: void 0,
value: void 0,
disabled: void 0,
name: void 0,
trueValue: void 0,
falseValue: void 0,
trueLabel: void 0,
falseLabel: void 0,
id: void 0,
validateEvent: true
};
// node_modules/element-plus/es/components/checkbox/src/constants.mjs
var checkboxGroupContextKey = /* @__PURE__ */ Symbol("checkboxGroupContextKey");
// node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-disabled.mjs
var useCheckboxDisabled = ({
model,
isChecked
}) => {
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
const formContext = inject(formContextKey, void 0);
const isLimitDisabled = computed(() => {
var _a, _b;
const max3 = (_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value;
const min3 = (_b = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b.value;
return !isUndefined(max3) && model.value.length >= max3 && !isChecked.value || !isUndefined(min3) && model.value.length <= min3 && isChecked.value;
});
const isDisabled = useFormDisabled(
computed(() => {
var _a, _b;
if (checkboxGroup === void 0) {
return (_a = formContext == null ? void 0 : formContext.disabled) != null ? _a : isLimitDisabled.value;
} else {
return ((_b = checkboxGroup.disabled) == null ? void 0 : _b.value) || isLimitDisabled.value;
}
})
);
return {
isDisabled,
isLimitDisabled
};
};
// node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-event.mjs
var useCheckboxEvent = (props2, {
model,
isLimitExceeded,
hasOwnLabel,
isDisabled,
isLabeledByFormItem
}) => {
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
const { formItem } = useFormItem();
const { emit } = getCurrentInstance();
function getLabeledValue(value) {
var _a, _b, _c, _d;
return [true, props2.trueValue, props2.trueLabel].includes(value) ? (_b = (_a = props2.trueValue) != null ? _a : props2.trueLabel) != null ? _b : true : (_d = (_c = props2.falseValue) != null ? _c : props2.falseLabel) != null ? _d : false;
}
function emitChangeEvent(checked, e) {
emit(CHANGE_EVENT, getLabeledValue(checked), e);
}
function handleChange(e) {
if (isLimitExceeded.value) return;
const target2 = e.target;
emit(CHANGE_EVENT, getLabeledValue(target2.checked), e);
}
async function onClickRoot(e) {
if (isLimitExceeded.value) return;
if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
const eventTargets = e.composedPath();
const hasLabel = eventTargets.some(
(item) => item.tagName === "LABEL"
);
if (!hasLabel) {
model.value = getLabeledValue(
[false, props2.falseValue, props2.falseLabel].includes(model.value)
);
await nextTick();
emitChangeEvent(model.value, e);
}
}
}
const validateEvent = computed(
() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props2.validateEvent
);
watch(
() => props2.modelValue,
() => {
if (validateEvent.value) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
}
);
return {
handleChange,
onClickRoot
};
};
// node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-model.mjs
var useCheckboxModel = (props2) => {
const selfModel = ref(false);
const { emit } = getCurrentInstance();
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
const isGroup = computed(() => isUndefined(checkboxGroup) === false);
const isLimitExceeded = ref(false);
const model = computed({
get() {
var _a, _b;
return isGroup.value ? (_a = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a.value : (_b = props2.modelValue) != null ? _b : selfModel.value;
},
set(val) {
var _a, _b;
if (isGroup.value && isArray(val)) {
isLimitExceeded.value = ((_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value) && val.length > model.value.length;
isLimitExceeded.value === false && ((_b = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b.call(checkboxGroup, val));
} else {
emit(UPDATE_MODEL_EVENT, val);
selfModel.value = val;
}
}
});
return {
model,
isGroup,
isLimitExceeded
};
};
// node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-status.mjs
var useCheckboxStatus = (props2, slots, { model }) => {
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
const isFocused = ref(false);
const actualValue = computed(() => {
if (!isPropAbsent(props2.value)) {
return props2.value;
}
return props2.label;
});
const isChecked = computed(() => {
const value = model.value;
if (isBoolean(value)) {
return value;
} else if (isArray(value)) {
if (isObject(actualValue.value)) {
return value.map(toRaw).some((o2) => isEqual_default(o2, actualValue.value));
} else {
return value.map(toRaw).includes(actualValue.value);
}
} else if (value !== null && value !== void 0) {
return value === props2.trueValue || value === props2.trueLabel;
} else {
return !!value;
}
});
const checkboxButtonSize = useFormSize(
computed(() => {
var _a;
return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
}),
{
prop: true
}
);
const checkboxSize = useFormSize(computed(() => {
var _a;
return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
}));
const hasOwnLabel = computed(() => {
return !!slots.default || !isPropAbsent(actualValue.value);
});
return {
checkboxButtonSize,
isChecked,
isFocused,
checkboxSize,
hasOwnLabel,
actualValue
};
};
// node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox.mjs
var useCheckbox = (props2, slots) => {
const { formItem: elFormItem } = useFormItem();
const { model, isGroup, isLimitExceeded } = useCheckboxModel(props2);
const {
isFocused,
isChecked,
checkboxButtonSize,
checkboxSize,
hasOwnLabel,
actualValue
} = useCheckboxStatus(props2, slots, { model });
const { isDisabled } = useCheckboxDisabled({ model, isChecked });
const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext: elFormItem,
disableIdGeneration: hasOwnLabel,
disableIdManagement: isGroup
});
const { handleChange, onClickRoot } = useCheckboxEvent(props2, {
model,
isLimitExceeded,
hasOwnLabel,
isDisabled,
isLabeledByFormItem
});
const setStoreValue = () => {
function addToStore() {
var _a, _b;
if (isArray(model.value) && !model.value.includes(actualValue.value)) {
model.value.push(actualValue.value);
} else {
model.value = (_b = (_a = props2.trueValue) != null ? _a : props2.trueLabel) != null ? _b : true;
}
}
props2.checked && addToStore();
};
setStoreValue();
useDeprecated(
{
from: "label act as value",
replacement: "value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
},
computed(() => isGroup.value && isPropAbsent(props2.value))
);
useDeprecated(
{
from: "true-label",
replacement: "true-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
},
computed(() => !!props2.trueLabel)
);
useDeprecated(
{
from: "false-label",
replacement: "false-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
},
computed(() => !!props2.falseLabel)
);
return {
inputId,
isLabeledByFormItem,
isChecked,
isDisabled,
isFocused,
checkboxButtonSize,
checkboxSize,
hasOwnLabel,
model,
actualValue,
handleChange,
onClickRoot
};
};
// node_modules/element-plus/es/components/checkbox/src/checkbox.vue2.mjs
var _hoisted_112 = ["id", "indeterminate", "name", "tabindex", "disabled"];
var _sfc_main36 = defineComponent({
...{
name: "ElCheckbox"
},
__name: "checkbox",
props: checkboxProps,
emits: checkboxEmits,
setup(__props) {
const props2 = __props;
const slots = useSlots();
const {
inputId,
isLabeledByFormItem,
isChecked,
isDisabled,
isFocused,
checkboxSize,
hasOwnLabel,
model,
actualValue,
handleChange,
onClickRoot
} = useCheckbox(props2, slots);
const inputBindings = computed(() => {
var _a, _b, _c, _d;
if (props2.trueValue || props2.falseValue || props2.trueLabel || props2.falseLabel) {
return {
"true-value": (_b = (_a = props2.trueValue) != null ? _a : props2.trueLabel) != null ? _b : true,
"false-value": (_d = (_c = props2.falseValue) != null ? _c : props2.falseLabel) != null ? _d : false
};
}
return {
value: actualValue.value
};
});
const ns = useNamespace("checkbox");
const compKls = computed(() => {
return [
ns.b(),
ns.m(checkboxSize.value),
ns.is("disabled", isDisabled.value),
ns.is("bordered", props2.border),
ns.is("checked", isChecked.value)
];
});
const spanKls = computed(() => {
return [
ns.e("input"),
ns.is("disabled", isDisabled.value),
ns.is("checked", isChecked.value),
ns.is("indeterminate", props2.indeterminate),
ns.is("focus", isFocused.value)
];
});
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
for: !unref(hasOwnLabel) && unref(isLabeledByFormItem) ? null : unref(inputId),
class: normalizeClass(compKls.value),
"aria-controls": __props.indeterminate ? __props.ariaControls : null,
"aria-checked": __props.indeterminate ? "mixed" : void 0,
"aria-label": __props.ariaLabel,
onClick: unref(onClickRoot)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(spanKls.value)
},
[
withDirectives(createBaseVNode("input", mergeProps({
id: unref(inputId),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
class: unref(ns).e("original"),
type: "checkbox",
indeterminate: __props.indeterminate,
name: __props.name,
tabindex: __props.tabindex,
disabled: unref(isDisabled)
}, inputBindings.value, {
onChange: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleChange) && unref(handleChange)(...args)),
onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
}, ["stop"]))
}), null, 16, _hoisted_112), [
[vModelCheckbox, unref(model)]
]),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("inner"))
},
null,
2
/* CLASS */
)
],
2
/* CLASS */
),
unref(hasOwnLabel) ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(unref(ns).e("label"))
},
[
renderSlot(_ctx.$slots, "default"),
!_ctx.$slots.default ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createTextVNode(
toDisplayString(__props.label),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["for", "class", "aria-controls", "aria-checked", "aria-label", "onClick"]);
};
}
});
// node_modules/element-plus/es/components/checkbox/src/checkbox-button.vue2.mjs
var _hoisted_113 = ["name", "tabindex", "disabled"];
var _sfc_main37 = defineComponent({
...{
name: "ElCheckboxButton"
},
__name: "checkbox-button",
props: checkboxProps,
emits: checkboxEmits,
setup(__props) {
const props2 = __props;
const slots = useSlots();
const {
isFocused,
isChecked,
isDisabled,
checkboxButtonSize,
model,
actualValue,
handleChange
} = useCheckbox(props2, slots);
const inputBindings = computed(() => {
var _a, _b, _c, _d;
if (props2.trueValue || props2.falseValue || props2.trueLabel || props2.falseLabel) {
return {
"true-value": (_b = (_a = props2.trueValue) != null ? _a : props2.trueLabel) != null ? _b : true,
"false-value": (_d = (_c = props2.falseValue) != null ? _c : props2.falseLabel) != null ? _d : false
};
}
return {
value: actualValue.value
};
});
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
const ns = useNamespace("checkbox");
const activeStyle = computed(() => {
var _a, _b, _c, _d;
const fillValue = (_b = (_a = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a.value) != null ? _b : "";
return {
backgroundColor: fillValue,
borderColor: fillValue,
color: (_d = (_c = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _c.value) != null ? _d : "",
boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
};
});
const labelKls = computed(() => {
return [
ns.b("button"),
ns.bm("button", checkboxButtonSize.value),
ns.is("disabled", isDisabled.value),
ns.is("checked", isChecked.value),
ns.is("focus", isFocused.value)
];
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"label",
{
class: normalizeClass(labelKls.value)
},
[
withDirectives(createBaseVNode("input", mergeProps({
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
class: unref(ns).be("button", "original"),
type: "checkbox",
name: __props.name,
tabindex: __props.tabindex,
disabled: unref(isDisabled)
}, inputBindings.value, {
onChange: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleChange) && unref(handleChange)(...args)),
onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
}, ["stop"]))
}), null, 16, _hoisted_113), [
[vModelCheckbox, unref(model)]
]),
_ctx.$slots.default || __props.label ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(unref(ns).be("button", "inner")),
style: normalizeStyle(unref(isChecked) ? activeStyle.value : void 0)
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.label),
1
/* TEXT */
)
])
],
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/checkbox/src/checkbox-group.mjs
var checkboxGroupProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: definePropType(Array),
default: () => []
},
/**
* @description whether the nesting checkboxes are disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description minimum number of checkbox checked
*/
min: Number,
/**
* @description maximum number of checkbox checked
*/
max: Number,
/**
* @description size of checkbox
*/
size: useSizeProp,
/**
* @description border and background color when button is active
*/
fill: String,
/**
* @description font color when button is active
*/
textColor: String,
/**
* @description element tag of the checkbox group
*/
tag: {
type: String,
default: "div"
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
options: {
type: definePropType(Array)
},
props: {
type: definePropType(Object),
default: () => checkboxDefaultProps
},
type: {
type: String,
values: ["checkbox", "button"],
default: "checkbox"
},
...useAriaProps(["ariaLabel"])
});
var checkboxGroupEmits = {
[UPDATE_MODEL_EVENT]: (val) => isArray(val),
change: (val) => isArray(val)
};
var checkboxDefaultProps = {
label: "label",
value: "value",
disabled: "disabled"
};
// node_modules/element-plus/es/components/checkbox/src/checkbox-group.vue2.mjs
var _sfc_main38 = defineComponent({
...{
name: "ElCheckboxGroup"
},
__name: "checkbox-group",
props: checkboxGroupProps,
emits: checkboxGroupEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("checkbox");
const checkboxDisabled = useFormDisabled();
const { formItem } = useFormItem();
const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext: formItem
});
const changeEvent = async (value) => {
emit(UPDATE_MODEL_EVENT, value);
await nextTick();
emit(CHANGE_EVENT, value);
};
const modelValue = computed({
get() {
return props2.modelValue;
},
set(val) {
changeEvent(val);
}
});
const aliasProps = computed(() => ({
...checkboxDefaultProps,
...props2.props
}));
const getOptionProps = (option) => {
const { label, value, disabled } = aliasProps.value;
const base = {
label: option[label],
value: option[value],
disabled: option[disabled]
};
return { ...omit_default(option, [label, value, disabled]), ...base };
};
const optionComponent = computed(
() => props2.type === "button" ? _sfc_main37 : _sfc_main36
);
provide(checkboxGroupContextKey, {
...pick_default(toRefs(props2), [
"size",
"min",
"max",
"validateEvent",
"fill",
"textColor"
]),
disabled: checkboxDisabled,
modelValue,
changeEvent
});
watch(
() => props2.modelValue,
(newVal, oldValue) => {
if (props2.validateEvent && !isEqual_default(newVal, oldValue)) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
}
);
return (_ctx, _cache) => {
var _a;
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
id: unref(groupId),
class: normalizeClass(unref(ns).b("group")),
role: "group",
"aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "checkbox-group" : void 0,
"aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItem)) == null ? void 0 : _a.labelId : void 0
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default", {}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.options, (item, index) => {
return openBlock(), createBlock(
resolveDynamicComponent(optionComponent.value),
mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)),
null,
16
/* FULL_PROPS */
);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
_: 3
/* FORWARDED */
}, 8, ["id", "class", "aria-label", "aria-labelledby"]);
};
}
});
// node_modules/element-plus/es/components/checkbox/index.mjs
var ElCheckbox = withInstall(_sfc_main36, {
CheckboxButton: _sfc_main37,
CheckboxGroup: _sfc_main38
});
var ElCheckboxButton = withNoopInstall(_sfc_main37);
var ElCheckboxGroup = withNoopInstall(_sfc_main38);
// node_modules/element-plus/es/components/radio/src/radio.mjs
var radioPropsBase = buildProps({
/**
* @description binding value
*/
modelValue: {
type: [String, Number, Boolean],
default: void 0
},
/**
* @description size of the Radio
*/
size: useSizeProp,
/**
* @description whether Radio is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description the label of Radio
*/
label: {
type: [String, Number, Boolean],
default: void 0
},
/**
* @description the value of Radio
*/
value: {
type: [String, Number, Boolean],
default: void 0
},
/**
* @description native `name` attribute
*/
name: {
type: String,
default: void 0
}
});
var radioProps = buildProps({
...radioPropsBase,
/**
* @description whether to add a border around Radio
*/
border: Boolean
});
var radioEmits = {
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
[CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
};
var radioPropsDefaults = {
modelValue: void 0,
disabled: void 0,
label: void 0,
value: void 0,
name: void 0,
border: false
};
// node_modules/element-plus/es/components/radio/src/constants.mjs
var radioGroupKey = /* @__PURE__ */ Symbol("radioGroupKey");
// node_modules/element-plus/es/components/radio/src/use-radio.mjs
var useRadio = (props2, emit) => {
const radioRef = ref();
const radioGroup = inject(radioGroupKey, void 0);
const isGroup = computed(() => !!radioGroup);
const actualValue = computed(() => {
if (!isPropAbsent(props2.value)) {
return props2.value;
}
return props2.label;
});
const modelValue = computed({
get() {
return isGroup.value ? radioGroup.modelValue : props2.modelValue;
},
set(val) {
if (isGroup.value) {
radioGroup.changeEvent(val);
} else {
emit && emit(UPDATE_MODEL_EVENT, val);
}
radioRef.value.checked = props2.modelValue === actualValue.value;
}
});
const size2 = useFormSize(computed(() => radioGroup == null ? void 0 : radioGroup.size));
const disabled = useFormDisabled(computed(() => radioGroup == null ? void 0 : radioGroup.disabled));
const focus = ref(false);
const tabIndex = computed(() => {
return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0;
});
useDeprecated(
{
from: "label act as value",
replacement: "value",
version: "3.0.0",
scope: "el-radio",
ref: "https://element-plus.org/en-US/component/radio.html"
},
computed(() => isGroup.value && isPropAbsent(props2.value))
);
return {
radioRef,
isGroup,
radioGroup,
focus,
size: size2,
disabled,
tabIndex,
modelValue,
actualValue
};
};
// node_modules/element-plus/es/components/radio/src/radio.vue2.mjs
var _hoisted_114 = ["value", "name", "disabled", "checked"];
var _sfc_main39 = defineComponent({
...{
name: "ElRadio"
},
__name: "radio",
props: radioProps,
emits: radioEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("radio");
const { radioRef, radioGroup, focus, size: size2, disabled, modelValue, actualValue } = useRadio(props2, emit);
function handleChange() {
nextTick(() => emit(CHANGE_EVENT, modelValue.value));
}
return (_ctx, _cache) => {
var _a;
return openBlock(), createElementBlock(
"label",
{
class: normalizeClass([
unref(ns).b(),
unref(ns).is("disabled", unref(disabled)),
unref(ns).is("focus", unref(focus)),
unref(ns).is("bordered", __props.border),
unref(ns).is("checked", unref(modelValue) === unref(actualValue)),
unref(ns).m(unref(size2))
])
},
[
createBaseVNode(
"span",
{
class: normalizeClass([
unref(ns).e("input"),
unref(ns).is("disabled", unref(disabled)),
unref(ns).is("checked", unref(modelValue) === unref(actualValue))
])
},
[
withDirectives(createBaseVNode("input", {
ref_key: "radioRef",
ref: radioRef,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
class: normalizeClass(unref(ns).e("original")),
value: unref(actualValue),
name: __props.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
disabled: unref(disabled),
checked: unref(modelValue) === unref(actualValue),
type: "radio",
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
onChange: handleChange,
onClick: _cache[3] || (_cache[3] = withModifiers(() => {
}, ["stop"]))
}, null, 42, _hoisted_114), [
[vModelRadio, unref(modelValue)]
]),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("inner"))
},
null,
2
/* CLASS */
)
],
2
/* CLASS */
),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("label")),
onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.label),
1
/* TEXT */
)
])
],
34
/* CLASS, NEED_HYDRATION */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/radio/src/radio-button.mjs
var radioButtonProps = buildProps({
...radioPropsBase
});
var radioButtonPropsDefaults = {
modelValue: void 0,
disabled: void 0,
label: void 0,
value: void 0,
name: void 0
};
// node_modules/element-plus/es/components/radio/src/radio-button.vue2.mjs
var _hoisted_115 = ["value", "name", "disabled"];
var _sfc_main40 = defineComponent({
...{
name: "ElRadioButton"
},
__name: "radio-button",
props: radioButtonProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("radio");
const { radioRef, focus, size: size2, disabled, modelValue, radioGroup, actualValue } = useRadio(props2);
const activeStyle = computed(() => {
return {
backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
};
});
return (_ctx, _cache) => {
var _a;
return openBlock(), createElementBlock(
"label",
{
class: normalizeClass([
unref(ns).b("button"),
unref(ns).is("active", unref(modelValue) === unref(actualValue)),
unref(ns).is("disabled", unref(disabled)),
unref(ns).is("focus", unref(focus)),
unref(ns).bm("button", unref(size2))
])
},
[
withDirectives(createBaseVNode("input", {
ref_key: "radioRef",
ref: radioRef,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
class: normalizeClass(unref(ns).be("button", "original-radio")),
value: unref(actualValue),
type: "radio",
name: __props.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
disabled: unref(disabled),
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
onClick: _cache[3] || (_cache[3] = withModifiers(() => {
}, ["stop"]))
}, null, 42, _hoisted_115), [
[vModelRadio, unref(modelValue)]
]),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).be("button", "inner")),
style: normalizeStyle(unref(modelValue) === unref(actualValue) ? activeStyle.value : {}),
onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.label),
1
/* TEXT */
)
])
],
38
/* CLASS, STYLE, NEED_HYDRATION */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/radio/src/radio-group.mjs
var radioDefaultProps = {
label: "label",
value: "value",
disabled: "disabled"
};
var radioGroupProps = buildProps({
/**
* @description native `id` attribute
*/
id: {
type: String,
default: void 0
},
/**
* @description the size of radio buttons or bordered radios
*/
size: useSizeProp,
/**
* @description whether the nesting radios are disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description binding value
*/
modelValue: {
type: [String, Number, Boolean],
default: void 0
},
/**
* @description border and background color when button is active
*/
fill: {
type: String,
default: ""
},
/**
* @description font color when button is active
*/
textColor: {
type: String,
default: ""
},
/**
* @description native `name` attribute
*/
name: {
type: String,
default: void 0
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
options: {
type: definePropType(Array)
},
props: {
type: definePropType(Object),
default: () => radioDefaultProps
},
type: {
type: String,
values: ["radio", "button"],
default: "radio"
},
...useAriaProps(["ariaLabel"])
});
var radioGroupEmits = radioEmits;
var radioGroupPropsDefaults = {
id: void 0,
disabled: void 0,
modelValue: void 0,
fill: "",
textColor: "",
name: void 0,
validateEvent: true,
props: () => radioDefaultProps,
type: "radio"
};
// node_modules/element-plus/es/components/radio/src/radio-group.vue2.mjs
var _hoisted_116 = ["id", "aria-label", "aria-labelledby"];
var _sfc_main41 = defineComponent({
...{
name: "ElRadioGroup"
},
__name: "radio-group",
props: radioGroupProps,
emits: radioGroupEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("radio");
const radioId = useId();
const radioGroupRef = ref();
const { formItem } = useFormItem();
const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext: formItem
});
const changeEvent = (value) => {
emit(UPDATE_MODEL_EVENT, value);
nextTick(() => emit(CHANGE_EVENT, value));
};
onMounted(() => {
const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
const firstLabel = radios[0];
if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
firstLabel.tabIndex = 0;
}
});
const name = computed(() => {
return props2.name || radioId.value;
});
const aliasProps = computed(() => ({
...radioDefaultProps,
...props2.props
}));
const getOptionProps = (option) => {
const { label, value, disabled } = aliasProps.value;
const base = {
label: option[label],
value: option[value],
disabled: option[disabled]
};
return { ...omit_default(option, [label, value, disabled]), ...base };
};
const optionComponent = computed(
() => props2.type === "button" ? _sfc_main40 : _sfc_main39
);
provide(
radioGroupKey,
reactive({
...toRefs(props2),
changeEvent,
name
})
);
watch(
() => props2.modelValue,
(newVal, oldValue) => {
if (props2.validateEvent && !isEqual_default(newVal, oldValue)) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
}
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
id: unref(groupId),
ref_key: "radioGroupRef",
ref: radioGroupRef,
class: normalizeClass(unref(ns).b("group")),
role: "radiogroup",
"aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "radio-group" : void 0,
"aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.options, (item, index) => {
return openBlock(), createBlock(
resolveDynamicComponent(optionComponent.value),
mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)),
null,
16
/* FULL_PROPS */
);
}),
128
/* KEYED_FRAGMENT */
))
])
], 10, _hoisted_116);
};
}
});
// node_modules/element-plus/es/components/radio/index.mjs
var ElRadio = withInstall(_sfc_main39, {
RadioButton: _sfc_main40,
RadioGroup: _sfc_main41
});
var ElRadioGroup = withNoopInstall(_sfc_main41);
var ElRadioButton = withNoopInstall(_sfc_main40);
// node_modules/element-plus/es/components/cascader-panel/src/types.mjs
var CASCADER_PANEL_INJECTION_KEY = /* @__PURE__ */ Symbol();
// node_modules/element-plus/es/components/cascader-panel/src/node-content.mjs
function isVNodeEmpty(vnodes) {
return !!(isArray(vnodes) ? vnodes.every(({
type
}) => type === Comment) : (vnodes == null ? void 0 : vnodes.type) === Comment);
}
var NodeContent = defineComponent({
name: "NodeContent",
props: {
node: {
type: Object,
required: true
}
},
setup(props2) {
const ns = useNamespace("cascader-node");
const {
renderLabelFn
} = inject(CASCADER_PANEL_INJECTION_KEY);
const {
node
} = props2;
const {
data,
label: nodeLabel
} = node;
const label = () => {
const renderLabel = renderLabelFn == null ? void 0 : renderLabelFn({
node,
data
});
return isVNodeEmpty(renderLabel) ? nodeLabel : renderLabel != null ? renderLabel : nodeLabel;
};
return () => createVNode("span", {
"class": ns.e("label")
}, [label()]);
}
});
// node_modules/element-plus/es/components/cascader-panel/src/node.vue2.mjs
var _hoisted_117 = ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex"];
var _sfc_main42 = defineComponent({
...{
name: "ElCascaderNode"
},
__name: "node",
props: {
node: {
type: Object,
required: true
},
menuId: String
},
emits: ["expand"],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const panel = inject(CASCADER_PANEL_INJECTION_KEY);
const ns = useNamespace("cascader-node");
const isHoverMenu = computed(() => panel.isHoverMenu);
const multiple = computed(() => panel.config.multiple);
const checkStrictly = computed(() => panel.config.checkStrictly);
const showPrefix = computed(() => panel.config.showPrefix);
const checkedNodeId = computed(() => {
var _a;
return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid;
});
const isDisabled = computed(() => props2.node.isDisabled);
const isLeaf2 = computed(() => props2.node.isLeaf);
const expandable = computed(
() => checkStrictly.value && !isLeaf2.value || !isDisabled.value
);
const inExpandingPath = computed(() => isInPath(panel.expandingNode));
const inCheckedPath = computed(
() => checkStrictly.value && panel.checkedNodes.some(isInPath)
);
const isInPath = (node) => {
var _a;
const { level, uid: uid2 } = props2.node;
return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid2;
};
const doExpand = () => {
if (inExpandingPath.value) return;
panel.expandNode(props2.node);
};
const doCheck = (checked) => {
const { node } = props2;
if (checked === node.checked) return;
panel.handleCheckChange(node, checked);
};
const doLoad = () => {
panel.lazyLoad(props2.node, () => {
if (!isLeaf2.value) doExpand();
});
};
const handleHoverExpand = (e) => {
if (!isHoverMenu.value) return;
handleExpand();
!isLeaf2.value && emit("expand", e);
};
const handleExpand = () => {
const { node } = props2;
if (!expandable.value || node.loading) return;
node.loaded ? doExpand() : doLoad();
};
const handleClick = () => {
if (isLeaf2.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
handleCheck(true);
} else if ((panel.config.checkOnClickNode && (multiple.value || checkStrictly.value) || isLeaf2.value && panel.config.checkOnClickLeaf) && !isDisabled.value) {
handleSelectCheck(!props2.node.checked);
} else if (!isHoverMenu.value) {
handleExpand();
}
};
const handleSelectCheck = (checked) => {
if (checkStrictly.value) {
doCheck(checked);
if (props2.node.loaded) {
doExpand();
}
} else {
handleCheck(checked);
}
};
const handleCheck = (checked) => {
if (!props2.node.loaded) {
doLoad();
} else {
doCheck(checked);
!checkStrictly.value && doExpand();
}
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
id: `${__props.menuId}-${__props.node.uid}`,
role: "menuitem",
"aria-haspopup": !isLeaf2.value,
"aria-owns": isLeaf2.value ? void 0 : __props.menuId,
"aria-expanded": inExpandingPath.value,
tabindex: expandable.value ? -1 : void 0,
class: normalizeClass([
unref(ns).b(),
unref(ns).is("selectable", checkStrictly.value),
unref(ns).is("active", __props.node.checked),
unref(ns).is("disabled", !expandable.value),
inExpandingPath.value && "in-active-path",
inCheckedPath.value && "in-checked-path"
]),
onMouseenter: handleHoverExpand,
onFocus: handleHoverExpand,
onClick: handleClick
}, [
createCommentVNode(" prefix "),
multiple.value && showPrefix.value ? (openBlock(), createBlock(unref(ElCheckbox), {
key: 0,
"model-value": __props.node.checked,
indeterminate: __props.node.indeterminate,
disabled: isDisabled.value,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"])),
"onUpdate:modelValue": handleSelectCheck
}, null, 8, ["model-value", "indeterminate", "disabled"])) : checkStrictly.value && showPrefix.value ? (openBlock(), createBlock(unref(ElRadio), {
key: 1,
"model-value": checkedNodeId.value,
label: __props.node.uid,
disabled: isDisabled.value,
"onUpdate:modelValue": handleSelectCheck,
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["stop"]))
}, {
default: withCtx(() => [
createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "),
_cache[2] || (_cache[2] = createBaseVNode(
"span",
null,
null,
-1
/* CACHED */
))
]),
_: 1
/* STABLE */
}, 8, ["model-value", "label", "disabled"])) : isLeaf2.value && __props.node.checked ? (openBlock(), createBlock(unref(ElIcon), {
key: 2,
class: normalizeClass(unref(ns).e("prefix"))
}, {
default: withCtx(() => [
createVNode(unref(check_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
createCommentVNode(" content "),
createVNode(unref(NodeContent), { node: __props.node }, null, 8, ["node"]),
createCommentVNode(" postfix "),
!isLeaf2.value ? (openBlock(), createElementBlock(
Fragment,
{ key: 3 },
[
__props.node.loading ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([unref(ns).is("loading"), unref(ns).e("postfix")])
}, {
default: withCtx(() => [
createVNode(unref(loading_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass(["arrow-right", unref(ns).e("postfix")])
}, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]))
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
], 42, _hoisted_117);
};
}
});
// node_modules/element-plus/es/components/cascader-panel/src/menu.vue2.mjs
var _sfc_main43 = defineComponent({
...{
name: "ElCascaderMenu"
},
__name: "menu",
props: {
nodes: {
type: Array,
required: true
},
index: {
type: Number,
required: true
}
},
setup(__props) {
const props2 = __props;
const instance = getCurrentInstance();
const ns = useNamespace("cascader-menu");
const { t } = useLocale();
const id = useId();
let activeNode;
let hoverTimer;
const panel = inject(CASCADER_PANEL_INJECTION_KEY);
const hoverZone = ref();
const isEmpty2 = computed(() => !props2.nodes.length);
const isLoading = computed(() => !panel.initialLoaded);
const menuId = computed(() => `${id.value}-${props2.index}`);
const handleExpand = (e) => {
activeNode = e.target;
};
const handleMouseMove = (e) => {
var _a;
if (!panel.isHoverMenu || !activeNode || !hoverZone.value) return;
if (activeNode.contains(e.target)) {
clearHoverTimer();
const el = instance.vnode.el;
const { left } = el.getBoundingClientRect();
const { offsetWidth, offsetHeight } = el;
const startX = e.clientX - left;
const top = activeNode.offsetTop;
const bottom = top + activeNode.offsetHeight;
const scrollTop = ((_a = el.querySelector(`.${ns.e("wrap")}`)) == null ? void 0 : _a.scrollTop) || 0;
hoverZone.value.innerHTML = `
`;
} else if (!hoverTimer) {
hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
}
};
const clearHoverTimer = () => {
if (!hoverTimer) return;
clearTimeout(hoverTimer);
hoverTimer = void 0;
};
const clearHoverZone = () => {
if (!hoverZone.value) return;
hoverZone.value.innerHTML = "";
clearHoverTimer();
};
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElScrollbar), {
key: menuId.value,
tag: "ul",
role: "menu",
class: normalizeClass(unref(ns).b()),
"wrap-class": unref(ns).e("wrap"),
"view-class": [unref(ns).e("list"), unref(ns).is("empty", isEmpty2.value)],
onMousemove: handleMouseMove,
onMouseleave: clearHoverZone
}, {
default: withCtx(() => {
var _a;
return [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.nodes, (node) => {
return openBlock(), createBlock(_sfc_main42, {
key: node.uid,
node,
"menu-id": menuId.value,
onExpand: handleExpand
}, null, 8, ["node", "menu-id"]);
}),
128
/* KEYED_FRAGMENT */
)),
isLoading.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("empty-text"))
},
[
createVNode(unref(ElIcon), {
size: "14",
class: normalizeClass(unref(ns).is("loading"))
}, {
default: withCtx(() => [
createVNode(unref(loading_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]),
createTextVNode(
" " + toDisplayString(unref(t)("el.cascader.loading")),
1
/* TEXT */
)
],
2
/* CLASS */
)) : isEmpty2.value ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("empty-text"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => [
createTextVNode(
toDisplayString(unref(t)("el.cascader.noData")),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : ((_a = unref(panel)) == null ? void 0 : _a.isHoverMenu) ? (openBlock(), createElementBlock(
Fragment,
{ key: 2 },
[
createCommentVNode(" eslint-disable vue/html-self-closing "),
(openBlock(), createElementBlock(
"svg",
{
ref_key: "hoverZone",
ref: hoverZone,
class: normalizeClass(unref(ns).e("hover-zone"))
},
null,
2
/* CLASS */
))
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
)) : createCommentVNode("v-if", true),
createCommentVNode(" eslint-enable vue/html-self-closing ")
];
}),
_: 3
/* FORWARDED */
}, 8, ["class", "wrap-class", "view-class"]);
};
}
});
// node_modules/element-plus/es/components/cascader-panel/src/node.mjs
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var uid = 0;
var calculatePathNodes = (node) => {
const nodes = [node];
let { parent } = node;
while (parent) {
nodes.unshift(parent);
parent = parent.parent;
}
return nodes;
};
var Node2 = class _Node {
constructor(data, config, parent, root = false) {
this.data = data;
this.config = config;
this.parent = parent;
this.root = root;
__publicField(this, "uid", uid++);
__publicField(this, "level");
__publicField(this, "value");
__publicField(this, "label");
__publicField(this, "pathNodes");
__publicField(this, "pathValues");
__publicField(this, "pathLabels");
__publicField(this, "childrenData");
__publicField(this, "children");
__publicField(this, "text");
__publicField(this, "loaded");
__publicField(this, "checked", false);
__publicField(this, "indeterminate", false);
__publicField(this, "loading", false);
const { value: valueKey, label: labelKey, children: childrenKey } = config;
const childrenData = data[childrenKey];
const pathNodes = calculatePathNodes(this);
this.level = root ? 0 : parent ? parent.level + 1 : 1;
this.value = data[valueKey];
this.label = data[labelKey];
this.pathNodes = pathNodes;
this.pathValues = pathNodes.map((node) => node.value);
this.pathLabels = pathNodes.map((node) => node.label);
this.childrenData = childrenData;
this.children = (childrenData || []).map(
(child) => new _Node(child, config, this)
);
this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
this.text = "";
}
get isDisabled() {
const { data, parent, config } = this;
const { disabled, checkStrictly } = config;
const isDisabled = isFunction(disabled) ? disabled(data, this) : !!data[disabled];
return isDisabled || !checkStrictly && !!(parent == null ? void 0 : parent.isDisabled);
}
get isLeaf() {
const { data, config, childrenData, loaded } = this;
const { lazy, leaf } = config;
const isLeaf2 = isFunction(leaf) ? leaf(data, this) : data[leaf];
return isUndefined(isLeaf2) ? lazy && !loaded ? false : !(isArray(childrenData) && childrenData.length) : !!isLeaf2;
}
get valueByOption() {
return this.config.emitPath ? this.pathValues : this.value;
}
appendChild(childData) {
const { childrenData, children } = this;
const node = new _Node(childData, this.config, this);
if (isArray(childrenData)) {
childrenData.push(childData);
} else {
this.childrenData = [childData];
}
children.push(node);
return node;
}
calcText(allLevels, separator) {
const text = allLevels ? this.pathLabels.join(separator) : this.label;
this.text = text;
return text;
}
broadcast(checked) {
this.children.forEach((child) => {
var _a;
if (child) {
child.broadcast(checked);
(_a = child.onParentCheck) == null ? void 0 : _a.call(child, checked);
}
});
}
emit() {
var _a;
const { parent } = this;
if (parent) {
(_a = parent.onChildCheck) == null ? void 0 : _a.call(parent);
parent.emit();
}
}
onParentCheck(checked) {
if (!this.isDisabled) {
this.setCheckState(checked);
}
}
onChildCheck() {
const { children } = this;
const validChildren = children.filter((child) => !child.isDisabled);
const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
this.setCheckState(checked);
}
setCheckState(checked) {
const totalNum = this.children.length;
const checkedNum = this.children.reduce((c2, p2) => {
const num = p2.checked ? 1 : p2.indeterminate ? 0.5 : 0;
return c2 + num;
}, 0);
this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
}
doCheck(checked) {
if (this.checked === checked) return;
const { checkStrictly, multiple } = this.config;
if (checkStrictly || !multiple) {
this.checked = checked;
} else {
this.broadcast(checked);
this.setCheckState(checked);
this.emit();
}
}
};
// node_modules/element-plus/es/components/cascader-panel/src/store.mjs
var __defProp2 = Object.defineProperty;
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
var flatNodes = (nodes, leafOnly) => {
return nodes.reduce((res, node) => {
if (node.isLeaf) {
res.push(node);
} else {
!leafOnly && res.push(node);
res = res.concat(flatNodes(node.children, leafOnly));
}
return res;
}, []);
};
var Store = class {
constructor(data, config) {
this.config = config;
__publicField2(this, "nodes");
__publicField2(this, "allNodes");
__publicField2(this, "leafNodes");
const nodes = (data || []).map(
(nodeData) => new Node2(nodeData, this.config)
);
this.nodes = nodes;
this.allNodes = flatNodes(nodes, false);
this.leafNodes = flatNodes(nodes, true);
}
getNodes() {
return this.nodes;
}
getFlattedNodes(leafOnly) {
return leafOnly ? this.leafNodes : this.allNodes;
}
appendNode(nodeData, parentNode) {
const node = parentNode ? parentNode.appendChild(nodeData) : new Node2(nodeData, this.config);
if (!parentNode) this.nodes.push(node);
this.appendAllNodesAndLeafNodes(node);
}
appendNodes(nodeDataList, parentNode) {
if (nodeDataList.length > 0) {
nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode));
} else {
parentNode && parentNode.isLeaf && this.leafNodes.push(parentNode);
}
}
appendAllNodesAndLeafNodes(node) {
this.allNodes.push(node);
node.isLeaf && this.leafNodes.push(node);
if (node.children) {
node.children.forEach((subNode) => {
this.appendAllNodesAndLeafNodes(subNode);
});
}
}
// when checkStrictly, leaf node first
getNodeByValue(value, leafOnly = false) {
if (isPropAbsent(value)) return null;
const node = this.getFlattedNodes(leafOnly).find(
(node2) => isEqual_default(node2.value, value) || isEqual_default(node2.pathValues, value)
);
return node || null;
}
getSameNode(node) {
if (!node) return null;
const node_ = this.getFlattedNodes(false).find(
({ value, level }) => isEqual_default(node.value, value) && node.level === level
);
return node_ || null;
}
};
// node_modules/element-plus/es/components/cascader-panel/src/utils.mjs
var getMenuIndex = (el) => {
if (!el) return 0;
const pieces = el.id.split("-");
return Number(pieces[pieces.length - 2]);
};
var checkNode = (el) => {
if (!el) return;
const input = el.querySelector("input");
if (input) {
input.click();
} else if (isLeaf(el)) {
el.click();
}
};
var sortByOriginalOrder = (oldNodes, newNodes) => {
const newNodesCopy = newNodes.slice(0);
const newIds = newNodesCopy.map((node) => node.uid);
const res = oldNodes.reduce((acc, item) => {
const index = newIds.indexOf(item.uid);
if (index > -1) {
acc.push(item);
newNodesCopy.splice(index, 1);
newIds.splice(index, 1);
}
return acc;
}, []);
res.push(...newNodesCopy);
return res;
};
// node_modules/element-plus/es/components/cascader-panel/src/index.vue2.mjs
var _sfc_main44 = defineComponent({
...{
name: "ElCascaderPanel"
},
__name: "index",
props: cascaderPanelProps,
emits: cascaderPanelEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
let manualChecked = false;
const ns = useNamespace("cascader");
const config = useCascaderConfig(props2);
const slots = useSlots();
let store;
const initialLoaded = ref(true);
const initialLoadedOnce = ref(false);
const menuList = ref([]);
const checkedValue = ref();
const menus = ref([]);
const expandingNode = ref();
const checkedNodes = ref([]);
const isHoverMenu = computed(() => config.value.expandTrigger === "hover");
const renderLabelFn = computed(() => props2.renderLabel || slots.default);
const initStore = () => {
const { options } = props2;
const cfg = config.value;
manualChecked = false;
store = new Store(options, cfg);
menus.value = [store.getNodes()];
if (cfg.lazy && isEmpty(props2.options)) {
initialLoaded.value = false;
lazyLoad(void 0, (list) => {
if (list) {
store = new Store(list, cfg);
menus.value = [store.getNodes()];
}
initialLoaded.value = true;
syncCheckedValue(false, true);
});
} else {
syncCheckedValue(false, true);
}
};
const lazyLoad = (node, cb) => {
const cfg = config.value;
node = node || new Node2({}, cfg, void 0, true);
node.loading = true;
const resolve = (dataList) => {
const _node = node;
const parent = _node.root ? null : _node;
_node.loading = false;
_node.loaded = true;
_node.childrenData = _node.childrenData || [];
dataList && (store == null ? void 0 : store.appendNodes(dataList, parent));
dataList && (cb == null ? void 0 : cb(dataList));
if (node.level === 0) {
initialLoadedOnce.value = true;
}
};
const reject = () => {
node.loading = false;
node.loaded = false;
if (node.level === 0) {
initialLoaded.value = true;
}
};
cfg.lazyLoad(node, resolve, reject);
};
const expandNode = (node, silent) => {
var _a;
const { level } = node;
const newMenus = menus.value.slice(0, level);
let newExpandingNode;
if (node.isLeaf) {
newExpandingNode = node.pathNodes[level - 2];
} else {
newExpandingNode = node;
newMenus.push(node.children);
}
if (((_a = expandingNode.value) == null ? void 0 : _a.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) {
expandingNode.value = node;
menus.value = newMenus;
!silent && emit("expand-change", (node == null ? void 0 : node.pathValues) || []);
}
};
const handleCheckChange = (node, checked, emitClose = true) => {
const { checkStrictly, multiple } = config.value;
const oldNode = checkedNodes.value[0];
manualChecked = true;
!multiple && (oldNode == null ? void 0 : oldNode.doCheck(false));
node.doCheck(checked);
calculateCheckedValue();
emitClose && !multiple && !checkStrictly && emit("close");
!emitClose && !multiple && expandParentNode(node);
};
const expandParentNode = (node) => {
if (!node) return;
node = node.parent;
expandParentNode(node);
node && expandNode(node);
};
const getFlattedNodes = (leafOnly) => store == null ? void 0 : store.getFlattedNodes(leafOnly);
const getCheckedNodes = (leafOnly) => {
var _a;
return (_a = getFlattedNodes(leafOnly)) == null ? void 0 : _a.filter(({ checked }) => checked !== false);
};
const clearCheckedNodes = () => {
checkedNodes.value.forEach((node) => node.doCheck(false));
calculateCheckedValue();
menus.value = menus.value.slice(0, 1);
expandingNode.value = void 0;
emit("expand-change", []);
};
const calculateCheckedValue = () => {
var _a;
const { checkStrictly, multiple } = config.value;
const oldNodes = checkedNodes.value;
const newNodes = getCheckedNodes(!checkStrictly);
const nodes = sortByOriginalOrder(oldNodes, newNodes);
const values = nodes.map((node) => node.valueByOption);
checkedNodes.value = nodes;
checkedValue.value = multiple ? values : (_a = values[0]) != null ? _a : null;
};
const syncCheckedValue = (loaded = false, forced = false) => {
const { modelValue } = props2;
const { lazy, multiple, checkStrictly } = config.value;
const leafOnly = !checkStrictly;
if (!initialLoaded.value || manualChecked || !forced && isEqual_default(modelValue, checkedValue.value))
return;
if (lazy && !loaded) {
const values = unique(
flattenDeep_default(castArray(modelValue))
);
const nodes = values.map((val) => store == null ? void 0 : store.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
if (nodes.length) {
nodes.forEach((node) => {
lazyLoad(node, () => syncCheckedValue(false, forced));
});
} else {
syncCheckedValue(true, forced);
}
} else {
const values = multiple ? castArray(modelValue) : [modelValue];
const nodes = unique(
values.map(
(val) => store == null ? void 0 : store.getNodeByValue(val, leafOnly)
)
);
syncMenuState(nodes, forced);
checkedValue.value = cloneDeep_default(modelValue != null ? modelValue : void 0);
}
};
const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
const { checkStrictly } = config.value;
const oldNodes = checkedNodes.value;
const newNodes = newCheckedNodes.filter(
(node) => !!node && (checkStrictly || node.isLeaf)
);
const oldExpandingNode = store == null ? void 0 : store.getSameNode(expandingNode.value);
const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
if (newExpandingNode) {
newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
} else {
expandingNode.value = void 0;
}
oldNodes.forEach((node) => node.doCheck(false));
reactive(newNodes).forEach((node) => node.doCheck(true));
checkedNodes.value = newNodes;
nextTick(scrollToExpandingNode);
};
const scrollToExpandingNode = () => {
if (!isClient) return;
menuList.value.forEach((menu) => {
const menuElement = menu == null ? void 0 : menu.$el;
if (menuElement) {
const container = menuElement.querySelector(
`.${ns.namespace.value}-scrollbar__wrap`
);
let activeNode = menuElement.querySelector(
`.${ns.b("node")}.in-active-path`
);
if (!activeNode) {
const activeElements = menuElement.querySelectorAll(
`.${ns.b("node")}.${ns.is("active")}`
);
activeNode = activeElements[activeElements.length - 1];
}
scrollIntoView(container, activeNode);
}
});
};
const handleKeyDown = (e) => {
const target2 = e.target;
const code = getEventCode(e);
switch (code) {
case EVENT_CODE.up:
case EVENT_CODE.down: {
e.preventDefault();
const distance = code === EVENT_CODE.up ? -1 : 1;
focusNode(
getSibling(
target2,
distance,
`.${ns.b("node")}[tabindex="-1"]`
)
);
break;
}
case EVENT_CODE.left: {
e.preventDefault();
const preMenu = menuList.value[getMenuIndex(target2) - 1];
const expandedNode = preMenu == null ? void 0 : preMenu.$el.querySelector(
`.${ns.b("node")}[aria-expanded="true"]`
);
focusNode(expandedNode);
break;
}
case EVENT_CODE.right: {
e.preventDefault();
const nextMenu = menuList.value[getMenuIndex(target2) + 1];
const firstNode = nextMenu == null ? void 0 : nextMenu.$el.querySelector(
`.${ns.b("node")}[tabindex="-1"]`
);
focusNode(firstNode);
break;
}
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
checkNode(target2);
break;
}
};
provide(
CASCADER_PANEL_INJECTION_KEY,
reactive({
config,
expandingNode,
checkedNodes,
isHoverMenu,
initialLoaded,
renderLabelFn,
lazyLoad,
expandNode,
handleCheckChange
})
);
watch(
config,
(newVal, oldVal) => {
if (isEqual_default(newVal, oldVal)) return;
initStore();
},
{
immediate: true
}
);
watch(() => props2.options, initStore, {
deep: true
});
watch(
() => props2.modelValue,
() => {
manualChecked = false;
syncCheckedValue();
},
{
deep: true
}
);
watch(
() => checkedValue.value,
(val) => {
if (!isEqual_default(val, props2.modelValue)) {
emit(UPDATE_MODEL_EVENT, val);
emit(CHANGE_EVENT, val);
}
}
);
const loadLazyRootNodes = () => {
if (initialLoadedOnce.value) return;
initStore();
};
onBeforeUpdate(() => menuList.value = []);
onMounted(() => !isEmpty(props2.modelValue) && syncCheckedValue());
__expose({
menuList,
menus,
checkedNodes,
handleKeyDown,
handleCheckChange,
getFlattedNodes,
/**
* @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
*/
getCheckedNodes,
/**
* @description clear checked nodes
*/
clearCheckedNodes,
calculateCheckedValue,
scrollToExpandingNode,
loadLazyRootNodes
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b("panel"), unref(ns).is("bordered", __props.border)]),
onKeydown: handleKeyDown
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(menus.value, (menu, index) => {
return openBlock(), createBlock(_sfc_main43, {
key: index,
ref_for: true,
ref: (item) => menuList.value[index] = item,
index,
nodes: [...menu]
}, {
empty: withCtx(() => [
renderSlot(_ctx.$slots, "empty")
]),
_: 3
/* FORWARDED */
}, 8, ["index", "nodes"]);
}),
128
/* KEYED_FRAGMENT */
))
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/cascader-panel/index.mjs
var ElCascaderPanel = withInstall(_sfc_main44);
// node_modules/element-plus/es/components/cascader/src/cascader.vue2.mjs
var _hoisted_118 = ["placeholder"];
var _hoisted_28 = ["onClick"];
var _sfc_main45 = defineComponent({
...{
name: "ElCascader"
},
__name: "cascader",
props: cascaderProps,
emits: cascaderEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const popperOptions = {
modifiers: [
{
name: "arrowPosition",
enabled: true,
phase: "main",
fn: ({ state }) => {
const { modifiersData, placement } = state;
if (["right", "left", "bottom", "top"].includes(placement)) return;
if (modifiersData.arrow) {
modifiersData.arrow.x = 35;
}
},
requires: ["arrow"]
}
]
};
const props2 = __props;
const emit = __emit;
const attrs = useAttrs();
const slots = useSlots();
let inputInitialHeight = 0;
let pressDeleteCount = 0;
const nsCascader = useNamespace("cascader");
const nsInput = useNamespace("input");
const sizeMapPadding = {
small: 7,
default: 11,
large: 15
};
const { t } = useLocale();
const { formItem } = useFormItem();
const isDisabled = useFormDisabled();
const { valueOnClear } = useEmptyValues(props2);
const { isComposing, handleComposition } = useComposition({
afterComposition(event) {
var _a;
const text = (_a = event.target) == null ? void 0 : _a.value;
handleInput(text);
}
});
const tooltipRef = ref();
const tagTooltipRef = ref();
const inputRef = ref();
const tagWrapper = ref();
const cascaderPanelRef = ref();
const suggestionPanel = ref();
const popperVisible = ref(false);
const inputHover = ref(false);
const filtering = ref(false);
const inputValue = ref("");
const searchInputValue = ref("");
const tags = ref([]);
const suggestions = ref([]);
const showTagList = computed(() => {
if (!props2.props.multiple) {
return [];
}
return props2.collapseTags ? tags.value.slice(0, props2.maxCollapseTags) : tags.value;
});
const collapseTagList = computed(() => {
if (!props2.props.multiple) {
return [];
}
return props2.collapseTags ? tags.value.slice(props2.maxCollapseTags) : [];
});
const cascaderStyle = computed(() => {
return attrs.style;
});
const inputPlaceholder = computed(
() => {
var _a;
return (_a = props2.placeholder) != null ? _a : t("el.cascader.placeholder");
}
);
const currentPlaceholder = computed(
() => searchInputValue.value || tags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value
);
const realSize = useFormSize();
const tagSize = computed(
() => realSize.value === "small" ? "small" : "default"
);
const multiple = computed(() => !!props2.props.multiple);
const readonly2 = computed(() => !props2.filterable || multiple.value);
const searchKeyword = computed(
() => multiple.value ? searchInputValue.value : inputValue.value
);
const checkedNodes = computed(
() => {
var _a;
return ((_a = cascaderPanelRef.value) == null ? void 0 : _a.checkedNodes) || [];
}
);
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
disabled: isDisabled,
beforeBlur(event) {
var _a, _b;
return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
},
afterBlur() {
var _a;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
}
}
});
const clearBtnVisible = computed(() => {
if (!props2.clearable || isDisabled.value || filtering.value || !inputHover.value && !isFocused.value)
return false;
return !!checkedNodes.value.length;
});
const presentText = computed(() => {
const { showAllLevels, separator } = props2;
const nodes = checkedNodes.value;
return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
});
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
const checkedValue = computed({
get() {
return cloneDeep_default(props2.modelValue);
},
set(val) {
const value = val != null ? val : valueOnClear.value;
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value);
if (props2.validateEvent) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
}
});
const cascaderKls = computed(() => {
return [
nsCascader.b(),
nsCascader.m(realSize.value),
nsCascader.is("disabled", isDisabled.value),
attrs.class
];
});
const cascaderIconKls = computed(() => {
return [
nsInput.e("icon"),
"icon-arrow-down",
nsCascader.is("reverse", popperVisible.value)
];
});
const inputClass = computed(() => nsCascader.is("focus", isFocused.value));
const contentRef = computed(() => {
var _a, _b;
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
});
const handleClickOutside = (event) => {
if (isFocused.value) {
const _event2 = new FocusEvent("blur", event);
handleBlur(_event2);
}
togglePopperVisible(false);
};
const togglePopperVisible = (visible) => {
var _a, _b;
if (isDisabled.value) return;
visible = visible != null ? visible : !popperVisible.value;
if (visible !== popperVisible.value) {
popperVisible.value = visible;
(_b = (_a = inputRef.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-expanded", `${visible}`);
if (visible) {
updatePopperPosition();
cascaderPanelRef.value && nextTick(cascaderPanelRef.value.scrollToExpandingNode);
} else if (props2.filterable) {
syncPresentTextValue();
}
emit("visibleChange", visible);
}
};
const updatePopperPosition = () => {
nextTick(() => {
var _a;
(_a = tooltipRef.value) == null ? void 0 : _a.updatePopper();
});
};
const hideSuggestionPanel = () => {
filtering.value = false;
};
const genTag = (node) => {
const { showAllLevels, separator } = props2;
return {
node,
key: node.uid,
text: node.calcText(showAllLevels, separator),
hitState: false,
closable: !isDisabled.value && !node.isDisabled
};
};
const deleteTag = (tag) => {
var _a;
const node = tag.node;
node.doCheck(false);
(_a = cascaderPanelRef.value) == null ? void 0 : _a.calculateCheckedValue();
emit("removeTag", node.valueByOption);
};
const getStrategyCheckedNodes = () => {
switch (props2.showCheckedStrategy) {
case "child":
return checkedNodes.value;
case "parent": {
const clickedNodes = getCheckedNodes(false);
const clickedNodesValue = clickedNodes.map((o2) => o2.value);
const parentNodes = clickedNodes.filter(
(o2) => !o2.parent || !clickedNodesValue.includes(o2.parent.value)
);
return parentNodes;
}
default:
return [];
}
};
const calculatePresentTags = () => {
if (!multiple.value) return;
const nodes = getStrategyCheckedNodes();
const allTags = [];
nodes.forEach((node) => allTags.push(genTag(node)));
tags.value = allTags;
};
const calculateSuggestions = () => {
var _a, _b;
const { filterMethod, showAllLevels, separator } = props2;
const res = (_b = (_a = cascaderPanelRef.value) == null ? void 0 : _a.getFlattedNodes(!props2.props.checkStrictly)) == null ? void 0 : _b.filter((node) => {
if (node.isDisabled) return false;
node.calcText(showAllLevels, separator);
return filterMethod(node, searchKeyword.value);
});
if (multiple.value) {
tags.value.forEach((tag) => {
tag.hitState = false;
});
}
filtering.value = true;
suggestions.value = res;
updatePopperPosition();
};
const focusFirstNode = () => {
var _a;
let firstNode;
if (filtering.value && suggestionPanel.value) {
firstNode = suggestionPanel.value.$el.querySelector(
`.${nsCascader.e("suggestion-item")}`
);
} else {
firstNode = (_a = cascaderPanelRef.value) == null ? void 0 : _a.$el.querySelector(
`.${nsCascader.b("node")}[tabindex="-1"]`
);
}
if (firstNode) {
firstNode.focus();
!filtering.value && firstNode.click();
}
};
const updateStyle = () => {
var _a, _b, _c;
const inputInner = (_a = inputRef.value) == null ? void 0 : _a.input;
const tagWrapperEl = tagWrapper.value;
const suggestionPanelEl = (_b = suggestionPanel.value) == null ? void 0 : _b.$el;
if (!isClient || !inputInner) return;
if (suggestionPanelEl) {
const suggestionList = suggestionPanelEl.querySelector(
`.${nsCascader.e("suggestion-list")}`
);
suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
}
if (tagWrapperEl) {
const { offsetHeight } = tagWrapperEl;
const height = tags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`;
inputInner.style.height = height;
if (slots.prefix) {
const prefix = (_c = inputRef.value) == null ? void 0 : _c.$el.querySelector(
`.${nsInput.e("prefix")}`
);
let left = 0;
if (prefix) {
left = prefix.offsetWidth;
if (left > 0) {
left += sizeMapPadding[realSize.value || "default"];
}
}
tagWrapperEl.style.left = `${left}px`;
} else {
tagWrapperEl.style.left = `0`;
}
updatePopperPosition();
}
};
const getCheckedNodes = (leafOnly) => {
var _a;
return (_a = cascaderPanelRef.value) == null ? void 0 : _a.getCheckedNodes(leafOnly);
};
const handleExpandChange = (value) => {
updatePopperPosition();
emit("expandChange", value);
};
const handleKeyDown = (e) => {
if (isComposing.value) return;
const code = getEventCode(e);
switch (code) {
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
togglePopperVisible();
break;
case EVENT_CODE.down:
togglePopperVisible(true);
nextTick(focusFirstNode);
e.preventDefault();
break;
case EVENT_CODE.esc:
if (popperVisible.value === true) {
e.preventDefault();
e.stopPropagation();
togglePopperVisible(false);
}
break;
case EVENT_CODE.tab:
togglePopperVisible(false);
break;
}
};
const handleClear = () => {
var _a;
(_a = cascaderPanelRef.value) == null ? void 0 : _a.clearCheckedNodes();
if (!popperVisible.value && props2.filterable) {
syncPresentTextValue();
}
togglePopperVisible(false);
emit("clear");
};
const syncPresentTextValue = () => {
const { value } = presentText;
inputValue.value = value;
searchInputValue.value = value;
};
const handleSuggestionClick = (node) => {
var _a, _b;
const { checked } = node;
if (multiple.value) {
(_a = cascaderPanelRef.value) == null ? void 0 : _a.handleCheckChange(node, !checked, false);
} else {
!checked && ((_b = cascaderPanelRef.value) == null ? void 0 : _b.handleCheckChange(node, true, false));
togglePopperVisible(false);
}
};
const handleSuggestionKeyDown = (e) => {
const target2 = e.target;
const code = getEventCode(e);
switch (code) {
case EVENT_CODE.up:
case EVENT_CODE.down: {
e.preventDefault();
const distance = code === EVENT_CODE.up ? -1 : 1;
focusNode(
getSibling(
target2,
distance,
`.${nsCascader.e("suggestion-item")}[tabindex="-1"]`
)
);
break;
}
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
target2.click();
break;
}
};
const handleDelete = () => {
const lastTag = tags.value[tags.value.length - 1];
pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
if (!lastTag || !pressDeleteCount || props2.collapseTags && tags.value.length > 1)
return;
if (lastTag.hitState) {
deleteTag(lastTag);
} else {
lastTag.hitState = true;
}
};
const debounce = computed(() => props2.debounce);
const handleFilter = useDebounceFn(() => {
const { value } = searchKeyword;
if (!value) return;
const passed = props2.beforeFilter(value);
if (isPromise(passed)) {
passed.then(calculateSuggestions).catch(() => {
});
} else if (passed !== false) {
calculateSuggestions();
} else {
hideSuggestionPanel();
}
}, debounce);
const handleInput = (val, e) => {
!popperVisible.value && togglePopperVisible(true);
if (e == null ? void 0 : e.isComposing) return;
val ? handleFilter() : hideSuggestionPanel();
};
const getInputInnerHeight = (inputInner) => Number.parseFloat(
useCssVar(nsInput.cssVarName("input-height"), inputInner).value
) - 2;
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
watch(filtering, updatePopperPosition);
watch(
[
checkedNodes,
isDisabled,
() => props2.collapseTags,
() => props2.maxCollapseTags
],
calculatePresentTags
);
watch(tags, () => {
nextTick(() => updateStyle());
});
watch(realSize, async () => {
await nextTick();
const inputInner = inputRef.value.input;
inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
updateStyle();
});
watch(presentText, syncPresentTextValue, { immediate: true });
watch(
() => popperVisible.value,
(val) => {
var _a;
if (val && props2.props.lazy && props2.props.lazyLoad) {
(_a = cascaderPanelRef.value) == null ? void 0 : _a.loadLazyRootNodes();
}
}
);
onMounted(() => {
const inputInner = inputRef.value.input;
const inputInnerHeight = getInputInnerHeight(inputInner);
inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
useResizeObserver(inputInner, updateStyle);
});
__expose({
/**
* @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
*/
getCheckedNodes,
/**
* @description cascader panel ref
*/
cascaderPanelRef,
/**
* @description toggle the visible of popper
*/
togglePopperVisible,
/**
* @description cascader content ref
*/
contentRef,
/**
* @description selected content text
*/
presentText,
/** @description focus the input element */
focus,
/** @description blur the input element */
blur
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), {
ref_key: "tooltipRef",
ref: tooltipRef,
visible: popperVisible.value,
teleported: __props.teleported,
"popper-class": [unref(nsCascader).e("dropdown"), __props.popperClass],
"popper-style": __props.popperStyle,
"popper-options": popperOptions,
"fallback-placements": __props.fallbackPlacements,
"stop-popper-mouse-event": false,
"gpu-acceleration": false,
placement: __props.placement,
transition: `${unref(nsCascader).namespace.value}-zoom-in-top`,
effect: __props.effect,
pure: "",
persistent: __props.persistent,
onHide: hideSuggestionPanel
}, {
default: withCtx(() => [
withDirectives((openBlock(), createElementBlock(
"div",
{
ref_key: "wrapperRef",
ref: wrapperRef,
class: normalizeClass(cascaderKls.value),
style: normalizeStyle(cascaderStyle.value),
onClick: _cache[8] || (_cache[8] = () => togglePopperVisible(readonly2.value ? void 0 : true)),
onKeydown: handleKeyDown,
onMouseenter: _cache[9] || (_cache[9] = ($event) => inputHover.value = true),
onMouseleave: _cache[10] || (_cache[10] = ($event) => inputHover.value = false)
},
[
createVNode(unref(ElInput), {
ref_key: "inputRef",
ref: inputRef,
modelValue: inputValue.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
placeholder: currentPlaceholder.value,
readonly: readonly2.value,
disabled: unref(isDisabled),
"validate-event": false,
size: unref(realSize),
class: normalizeClass(inputClass.value),
tabindex: multiple.value && __props.filterable && !unref(isDisabled) ? -1 : void 0,
onCompositionstart: unref(handleComposition),
onCompositionupdate: unref(handleComposition),
onCompositionend: unref(handleComposition),
onInput: handleInput
}, createSlots({
suffix: withCtx(() => [
clearBtnVisible.value ? (openBlock(), createBlock(unref(ElIcon), {
key: "clear",
class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]),
onClick: withModifiers(handleClear, ["stop"])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), {
key: "arrow-down",
class: normalizeClass(cascaderIconKls.value),
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => togglePopperVisible(), ["stop"]))
}, {
default: withCtx(() => [
createVNode(unref(arrow_down_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]))
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.prefix ? {
name: "prefix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "prefix")
]),
key: "0"
} : void 0
]), 1032, ["modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
multiple.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref_key: "tagWrapper",
ref: tagWrapper,
class: normalizeClass([
unref(nsCascader).e("tags"),
unref(nsCascader).is("validate", Boolean(validateState.value))
])
},
[
renderSlot(_ctx.$slots, "tag", {
data: tags.value,
deleteTag
}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(showTagList.value, (tag) => {
return openBlock(), createBlock(unref(ElTag), {
key: tag.key,
type: __props.tagType,
size: tagSize.value,
effect: __props.tagEffect,
hit: tag.hitState,
closable: tag.closable,
"disable-transitions": "",
onClose: ($event) => deleteTag(tag)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
null,
toDisplayString(tag.text),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
__props.collapseTags && tags.value.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), {
key: 0,
ref_key: "tagTooltipRef",
ref: tagTooltipRef,
disabled: popperVisible.value || !__props.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
placement: "bottom",
"popper-class": __props.popperClass,
"popper-style": __props.popperStyle,
effect: __props.effect,
persistent: __props.persistent
}, {
default: withCtx(() => [
createVNode(unref(ElTag), {
closable: false,
size: tagSize.value,
type: __props.tagType,
effect: __props.tagEffect,
"disable-transitions": ""
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(unref(nsCascader).e("tags-text"))
},
" + " + toDisplayString(tags.value.length - __props.maxCollapseTags),
3
/* TEXT, CLASS */
)
]),
_: 1
/* STABLE */
}, 8, ["size", "type", "effect"])
]),
content: withCtx(() => [
createVNode(unref(ElScrollbar), { "max-height": __props.maxCollapseTagsTooltipHeight }, {
default: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsCascader).e("collapse-tags"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(collapseTagList.value, (tag, idx) => {
return openBlock(), createElementBlock(
"div",
{
key: idx,
class: normalizeClass(unref(nsCascader).e("collapse-tag"))
},
[
(openBlock(), createBlock(unref(ElTag), {
key: tag.key,
class: "in-tooltip",
type: __props.tagType,
size: tagSize.value,
effect: __props.tagEffect,
hit: tag.hitState,
closable: tag.closable,
"disable-transitions": "",
onClose: ($event) => deleteTag(tag)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
null,
toDisplayString(tag.text),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
]),
_: 1
/* STABLE */
}, 8, ["max-height"])
]),
_: 1
/* STABLE */
}, 8, ["disabled", "popper-class", "popper-style", "effect", "persistent"])) : createCommentVNode("v-if", true),
__props.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", {
key: 1,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchInputValue.value = $event),
type: "text",
class: normalizeClass(unref(nsCascader).e("search-input")),
placeholder: presentText.value ? "" : inputPlaceholder.value,
onInput: _cache[3] || (_cache[3] = (e) => handleInput(searchInputValue.value, e)),
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => togglePopperVisible(true), ["stop"])),
onKeydown: withKeys(handleDelete, ["delete"]),
onCompositionstart: _cache[5] || (_cache[5] = //@ts-ignore
(...args) => unref(handleComposition) && unref(handleComposition)(...args)),
onCompositionupdate: _cache[6] || (_cache[6] = //@ts-ignore
(...args) => unref(handleComposition) && unref(handleComposition)(...args)),
onCompositionend: _cache[7] || (_cache[7] = //@ts-ignore
(...args) => unref(handleComposition) && unref(handleComposition)(...args))
}, null, 42, _hoisted_118)), [
[vModelText, searchInputValue.value]
]) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
38
/* CLASS, STYLE, NEED_HYDRATION */
)), [
[unref(ClickOutside), handleClickOutside, contentRef.value]
])
]),
content: withCtx(() => [
_ctx.$slots.header ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(nsCascader).e("header")),
onClick: _cache[11] || (_cache[11] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "header")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
withDirectives(createVNode(unref(ElCascaderPanel), {
ref_key: "cascaderPanelRef",
ref: cascaderPanelRef,
modelValue: checkedValue.value,
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => checkedValue.value = $event),
options: __props.options,
props: props2.props,
border: false,
"render-label": _ctx.$slots.default,
onExpandChange: handleExpandChange,
onClose: _cache[13] || (_cache[13] = ($event) => _ctx.$nextTick(() => togglePopperVisible(false)))
}, {
empty: withCtx(() => [
renderSlot(_ctx.$slots, "empty")
]),
_: 3
/* FORWARDED */
}, 8, ["modelValue", "options", "props", "render-label"]), [
[vShow, !filtering.value]
]),
__props.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
key: 1,
ref_key: "suggestionPanel",
ref: suggestionPanel,
tag: "ul",
class: normalizeClass(unref(nsCascader).e("suggestion-panel")),
"view-class": unref(nsCascader).e("suggestion-list"),
onKeydown: handleSuggestionKeyDown
}, {
default: withCtx(() => [
suggestions.value.length ? (openBlock(true), createElementBlock(
Fragment,
{ key: 0 },
renderList(suggestions.value, (item) => {
return openBlock(), createElementBlock("li", {
key: item.uid,
class: normalizeClass([
unref(nsCascader).e("suggestion-item"),
unref(nsCascader).is("checked", item.checked)
]),
tabindex: -1,
onClick: ($event) => handleSuggestionClick(item)
}, [
renderSlot(_ctx.$slots, "suggestion-item", { item }, () => [
createBaseVNode(
"span",
null,
toDisplayString(item.text),
1
/* TEXT */
),
item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
createVNode(unref(check_default))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true)
])
], 10, _hoisted_28);
}),
128
/* KEYED_FRAGMENT */
)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
createBaseVNode(
"li",
{
class: normalizeClass(unref(nsCascader).e("empty-text"))
},
toDisplayString(unref(t)("el.cascader.noMatch")),
3
/* TEXT, CLASS */
)
])
]),
_: 3
/* FORWARDED */
}, 8, ["class", "view-class"])), [
[vShow, filtering.value]
]) : createCommentVNode("v-if", true),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass(unref(nsCascader).e("footer")),
onClick: _cache[14] || (_cache[14] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "teleported", "popper-class", "popper-style", "fallback-placements", "placement", "transition", "effect", "persistent"]);
};
}
});
// node_modules/element-plus/es/components/cascader/index.mjs
var ElCascader = withInstall(_sfc_main45);
// node_modules/element-plus/es/components/check-tag/src/check-tag.mjs
var checkTagProps = buildProps({
/**
* @description is checked
*/
checked: Boolean,
/**
* @description whether the check-tag is disabled
*/
disabled: Boolean,
/**
* @description type of Tag
*/
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
}
});
var checkTagEmits = {
"update:checked": (value) => isBoolean(value),
[CHANGE_EVENT]: (value) => isBoolean(value)
};
// node_modules/element-plus/es/components/check-tag/src/check-tag.vue2.mjs
var _sfc_main46 = defineComponent({
...{
name: "ElCheckTag"
},
__name: "check-tag",
props: checkTagProps,
emits: checkTagEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("check-tag");
const containerKls = computed(() => [
ns.b(),
ns.is("checked", props2.checked),
ns.is("disabled", props2.disabled),
ns.m(props2.type || "primary")
]);
const handleChange = () => {
if (props2.disabled) return;
const checked = !props2.checked;
emit(CHANGE_EVENT, checked);
emit("update:checked", checked);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"span",
{
class: normalizeClass(containerKls.value),
onClick: handleChange
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/check-tag/index.mjs
var ElCheckTag = withInstall(_sfc_main46);
// node_modules/element-plus/es/components/col/src/col.mjs
var colProps = buildProps({
/**
* @description custom element tag
*/
tag: {
type: String,
default: "div"
},
/**
* @description number of column the grid spans
*/
span: {
type: Number,
default: 24
},
/**
* @description number of spacing on the left side of the grid
*/
offset: {
type: Number,
default: 0
},
/**
* @description number of columns that grid moves to the left
*/
pull: {
type: Number,
default: 0
},
/**
* @description number of columns that grid moves to the right
*/
push: {
type: Number,
default: 0
},
/**
* @description `<768px` Responsive columns or column props object
*/
xs: {
type: definePropType([Number, Object]),
default: () => mutable({})
},
/**
* @description `≥768px` Responsive columns or column props object
*/
sm: {
type: definePropType([Number, Object]),
default: () => mutable({})
},
/**
* @description `≥992px` Responsive columns or column props object
*/
md: {
type: definePropType([Number, Object]),
default: () => mutable({})
},
/**
* @description `≥1200px` Responsive columns or column props object
*/
lg: {
type: definePropType([Number, Object]),
default: () => mutable({})
},
/**
* @description `≥1920px` Responsive columns or column props object
*/
xl: {
type: definePropType([Number, Object]),
default: () => mutable({})
}
});
// node_modules/element-plus/es/components/row/src/constants.mjs
var rowContextKey = /* @__PURE__ */ Symbol("rowContextKey");
// node_modules/element-plus/es/components/col/src/col.vue2.mjs
var _sfc_main47 = defineComponent({
...{
name: "ElCol"
},
__name: "col",
props: colProps,
setup(__props) {
const props2 = __props;
const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) });
const ns = useNamespace("col");
const style = computed(() => {
const styles = {};
if (gutter.value) {
styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
}
return styles;
});
const colKls = computed(() => {
const classes = [];
const pos = ["span", "offset", "pull", "push"];
pos.forEach((prop) => {
const size2 = props2[prop];
if (isNumber(size2)) {
if (prop === "span") classes.push(ns.b(`${props2[prop]}`));
else if (size2 > 0) classes.push(ns.b(`${prop}-${props2[prop]}`));
}
});
const sizes = ["xs", "sm", "md", "lg", "xl"];
sizes.forEach((size2) => {
if (isNumber(props2[size2])) {
classes.push(ns.b(`${size2}-${props2[size2]}`));
} else if (isObject(props2[size2])) {
Object.entries(props2[size2]).forEach(([prop, sizeProp]) => {
classes.push(
prop !== "span" ? ns.b(`${size2}-${prop}-${sizeProp}`) : ns.b(`${size2}-${sizeProp}`)
);
});
}
});
if (gutter.value) {
classes.push(ns.is("guttered"));
}
return [ns.b(), classes];
});
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
class: normalizeClass(colKls.value),
style: normalizeStyle(style.value)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "style"]);
};
}
});
// node_modules/element-plus/es/components/col/index.mjs
var ElCol = withInstall(_sfc_main47);
// node_modules/element-plus/es/components/collapse/src/collapse.mjs
var emitChangeFn3 = (value) => isNumber(value) || isString(value) || isArray(value);
var collapseProps = buildProps({
/**
* @description whether to activate accordion mode
*/
accordion: Boolean,
/**
* @description currently active panel, the type is `string` in accordion mode, otherwise it is `array`
*/
modelValue: {
type: definePropType([Array, String, Number]),
default: () => mutable([])
},
/**
* @description set expand icon position
*/
expandIconPosition: {
type: definePropType([String]),
default: "right"
},
/**
* @description before-collapse hook before the collapse state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop collapsing
*/
beforeCollapse: {
type: definePropType(
Function
)
}
});
var collapseEmits = {
[UPDATE_MODEL_EVENT]: emitChangeFn3,
[CHANGE_EVENT]: emitChangeFn3
};
// node_modules/element-plus/es/components/collapse/src/constants.mjs
var collapseContextKey = /* @__PURE__ */ Symbol("collapseContextKey");
// node_modules/element-plus/es/components/collapse/src/use-collapse.mjs
var SCOPE4 = "ElCollapse";
var useCollapse = (props2, emit) => {
const activeNames = ref(castArray_default(props2.modelValue));
const setActiveNames = (_activeNames) => {
activeNames.value = _activeNames;
const value = props2.accordion ? activeNames.value[0] : activeNames.value;
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value);
};
const handleChange = (name) => {
if (props2.accordion) {
setActiveNames([activeNames.value[0] === name ? "" : name]);
} else {
const _activeNames = [...activeNames.value];
const index = _activeNames.indexOf(name);
if (index > -1) {
_activeNames.splice(index, 1);
} else {
_activeNames.push(name);
}
setActiveNames(_activeNames);
}
};
const handleItemClick = async (name) => {
const { beforeCollapse } = props2;
if (!beforeCollapse) {
handleChange(name);
return;
}
const shouldChange = beforeCollapse(name);
const isPromiseOrBool = [
isPromise(shouldChange),
isBoolean(shouldChange)
].includes(true);
if (!isPromiseOrBool) {
throwError(
SCOPE4,
"beforeCollapse must return type `Promise` or `boolean`"
);
}
if (isPromise(shouldChange)) {
shouldChange.then((result) => {
if (result !== false) {
handleChange(name);
}
}).catch((e) => {
debugWarn(SCOPE4, `some error occurred: ${e}`);
});
} else if (shouldChange) {
handleChange(name);
}
};
watch(
() => props2.modelValue,
() => activeNames.value = castArray_default(props2.modelValue),
{ deep: true }
);
provide(collapseContextKey, {
activeNames,
handleItemClick
});
return {
activeNames,
setActiveNames
};
};
var useCollapseDOM = (props2) => {
const ns = useNamespace("collapse");
const rootKls = computed(() => [
ns.b(),
ns.b(`icon-position-${props2.expandIconPosition}`)
]);
return {
rootKls
};
};
// node_modules/element-plus/es/components/collapse/src/collapse.vue2.mjs
var _sfc_main48 = defineComponent({
...{
name: "ElCollapse"
},
__name: "collapse",
props: collapseProps,
emits: collapseEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { activeNames, setActiveNames } = useCollapse(props2, emit);
const { rootKls } = useCollapseDOM(props2);
__expose({
/** @description active names */
activeNames,
/** @description set active names */
setActiveNames
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/collapse/src/collapse-item.mjs
var collapseItemProps = buildProps({
/**
* @description title of the panel
*/
title: {
type: String,
default: ""
},
/**
* @description unique identification of the panel
*/
name: {
type: definePropType([String, Number]),
default: void 0
},
/**
* @description icon of the collapse item
*/
icon: {
type: iconPropType,
default: arrow_right_default
},
/**
* @description disable the collapse item
*/
disabled: Boolean
});
// node_modules/element-plus/es/components/collapse-transition/src/collapse-transition.vue2.mjs
var _sfc_main49 = defineComponent({
...{
name: "ElCollapseTransition"
},
__name: "collapse-transition",
setup(__props) {
const ns = useNamespace("collapse-transition");
const reset = (el) => {
el.style.maxHeight = "";
el.style.overflow = el.dataset.oldOverflow;
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
};
const on2 = {
beforeEnter(el) {
if (!el.dataset) el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
if (el.style.height) el.dataset.elExistsHeight = el.style.height;
el.style.maxHeight = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
},
enter(el) {
requestAnimationFrame(() => {
el.dataset.oldOverflow = el.style.overflow;
if (el.dataset.elExistsHeight) {
el.style.maxHeight = el.dataset.elExistsHeight;
} else if (el.scrollHeight !== 0) {
el.style.maxHeight = `${el.scrollHeight}px`;
} else {
el.style.maxHeight = 0;
}
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
el.style.overflow = "hidden";
});
},
afterEnter(el) {
el.style.maxHeight = "";
el.style.overflow = el.dataset.oldOverflow;
},
enterCancelled(el) {
reset(el);
},
beforeLeave(el) {
if (!el.dataset) el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
el.dataset.oldOverflow = el.style.overflow;
el.style.maxHeight = `${el.scrollHeight}px`;
el.style.overflow = "hidden";
},
leave(el) {
if (el.scrollHeight !== 0) {
el.style.maxHeight = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
}
},
afterLeave(el) {
reset(el);
},
leaveCancelled(el) {
reset(el);
}
};
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, mergeProps({
name: unref(ns).b()
}, toHandlers(on2)), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 16, ["name"]);
};
}
});
// node_modules/element-plus/es/components/collapse-transition/index.mjs
var ElCollapseTransition = withInstall(_sfc_main49);
// node_modules/element-plus/es/components/collapse/src/use-collapse-item.mjs
var useCollapseItem = (props2) => {
const collapse = inject(collapseContextKey);
const { namespace } = useNamespace("collapse");
const focusing = ref(false);
const isClick = ref(false);
const idInjection = useIdInjection();
const id = computed(() => idInjection.current++);
const name = computed(() => {
var _a;
return (_a = props2.name) != null ? _a : `${namespace.value}-id-${idInjection.prefix}-${unref(id)}`;
});
const isActive = computed(
() => collapse == null ? void 0 : collapse.activeNames.value.includes(unref(name))
);
const handleFocus = () => {
setTimeout(() => {
if (!isClick.value) {
focusing.value = true;
} else {
isClick.value = false;
}
}, 50);
};
const handleHeaderClick = (e) => {
if (props2.disabled) return;
const target2 = e.target;
if (target2 == null ? void 0 : target2.closest("input, textarea, select")) return;
collapse == null ? void 0 : collapse.handleItemClick(unref(name));
focusing.value = false;
isClick.value = true;
};
const handleEnterClick = (e) => {
const target2 = e.target;
if (target2 == null ? void 0 : target2.closest("input, textarea, select")) return;
e.preventDefault();
collapse == null ? void 0 : collapse.handleItemClick(unref(name));
};
return {
focusing,
id,
isActive,
handleFocus,
handleHeaderClick,
handleEnterClick
};
};
var useCollapseItemDOM = (props2, { focusing, isActive, id }) => {
const ns = useNamespace("collapse");
const rootKls = computed(() => [
ns.b("item"),
ns.is("active", unref(isActive)),
ns.is("disabled", props2.disabled)
]);
const headKls = computed(() => [
ns.be("item", "header"),
ns.is("active", unref(isActive)),
{ focusing: unref(focusing) && !props2.disabled }
]);
const arrowKls = computed(() => [
ns.be("item", "arrow"),
ns.is("active", unref(isActive))
]);
const itemTitleKls = computed(() => [ns.be("item", "title")]);
const itemWrapperKls = computed(() => ns.be("item", "wrap"));
const itemContentKls = computed(() => ns.be("item", "content"));
const scopedContentId = computed(() => ns.b(`content-${unref(id)}`));
const scopedHeadId = computed(() => ns.b(`head-${unref(id)}`));
return {
itemTitleKls,
arrowKls,
headKls,
rootKls,
itemWrapperKls,
itemContentKls,
scopedContentId,
scopedHeadId
};
};
// node_modules/element-plus/es/components/collapse/src/collapse-item.vue2.mjs
var _hoisted_119 = ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "aria-disabled"];
var _hoisted_29 = ["id", "aria-hidden", "aria-labelledby"];
var _sfc_main50 = defineComponent({
...{
name: "ElCollapseItem"
},
__name: "collapse-item",
props: collapseItemProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const {
focusing,
id,
isActive,
handleFocus,
handleHeaderClick,
handleEnterClick
} = useCollapseItem(props2);
const {
arrowKls,
headKls,
rootKls,
itemTitleKls,
itemWrapperKls,
itemContentKls,
scopedContentId,
scopedHeadId
} = useCollapseItemDOM(props2, { focusing, isActive, id });
__expose({
/** @description current collapse-item whether active */
isActive
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls))
},
[
createBaseVNode("div", {
id: unref(scopedHeadId),
class: normalizeClass(unref(headKls)),
"aria-expanded": unref(isActive),
"aria-controls": unref(scopedContentId),
"aria-describedby": unref(scopedContentId),
tabindex: __props.disabled ? void 0 : 0,
"aria-disabled": __props.disabled,
role: "button",
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(
//@ts-ignore
(...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args),
["stop"]
), ["space", "enter"])),
onFocus: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(handleFocus) && unref(handleFocus)(...args)),
onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
}, [
createBaseVNode(
"span",
{
class: normalizeClass(unref(itemTitleKls))
},
[
renderSlot(_ctx.$slots, "title", { isActive: unref(isActive) }, () => [
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
),
renderSlot(_ctx.$slots, "icon", { isActive: unref(isActive) }, () => [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(arrowKls))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])
])
], 42, _hoisted_119),
createVNode(unref(ElCollapseTransition), null, {
default: withCtx(() => [
withDirectives(createBaseVNode("div", {
id: unref(scopedContentId),
role: "region",
class: normalizeClass(unref(itemWrapperKls)),
"aria-hidden": !unref(isActive),
"aria-labelledby": unref(scopedHeadId)
}, [
createBaseVNode(
"div",
{
class: normalizeClass(unref(itemContentKls))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)
], 10, _hoisted_29), [
[vShow, unref(isActive)]
])
]),
_: 3
/* FORWARDED */
})
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/collapse/index.mjs
var ElCollapse = withInstall(_sfc_main48, {
CollapseItem: _sfc_main50
});
var ElCollapseItem = withNoopInstall(_sfc_main50);
// node_modules/element-plus/es/components/color-picker-panel/src/color-picker-panel.mjs
var colorPickerPanelProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: definePropType(String),
default: void 0
},
/**
* @description whether the color picker is bordered
*/
border: {
type: Boolean,
default: true
},
/**
* @description whether to display the alpha slider
*/
showAlpha: Boolean,
/**
* @description color format of v-model
*/
colorFormat: String,
/**
* @description whether to disable the color picker
*/
disabled: Boolean,
/**
* @description predefined color options
*/
predefine: {
type: definePropType(Array)
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
}
});
var colorPickerPanelEmits = {
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil_default(val)
};
var ROOT_COMMON_COLOR_INJECTION_KEY = /* @__PURE__ */ Symbol("colorCommonPickerKey");
var colorPickerPanelContextKey = /* @__PURE__ */ Symbol("colorPickerPanelContextKey");
// node_modules/element-plus/es/components/color-picker-panel/src/props/slider.mjs
var alphaSliderProps = buildProps({
color: {
type: definePropType(Object),
required: true
},
vertical: Boolean,
disabled: Boolean
});
var hueSliderProps = alphaSliderProps;
// node_modules/element-plus/es/components/color-picker-panel/src/utils/draggable.mjs
var isDragging = false;
function draggable(element, options) {
if (!isClient) return;
const moveFn = function(event) {
var _a;
(_a = options.drag) == null ? void 0 : _a.call(options, event);
};
const upFn = function(event) {
var _a;
document.removeEventListener("mousemove", moveFn);
document.removeEventListener("mouseup", upFn);
document.removeEventListener("touchmove", moveFn);
document.removeEventListener("touchend", upFn);
document.onselectstart = null;
document.ondragstart = null;
isDragging = false;
(_a = options.end) == null ? void 0 : _a.call(options, event);
};
const downFn = function(event) {
var _a;
if (isDragging) return;
document.onselectstart = () => false;
document.ondragstart = () => false;
document.addEventListener("mousemove", moveFn);
document.addEventListener("mouseup", upFn);
document.addEventListener("touchmove", moveFn);
document.addEventListener("touchend", upFn);
isDragging = true;
(_a = options.start) == null ? void 0 : _a.call(options, event);
};
element.addEventListener("mousedown", downFn);
element.addEventListener("touchstart", downFn, { passive: false });
}
// node_modules/element-plus/es/utils/dom/position.mjs
var getOffsetTop = (el) => {
let offset3 = 0;
let parent = el;
while (parent) {
offset3 += parent.offsetTop;
parent = parent.offsetParent;
}
return offset3;
};
var getOffsetTopDistance = (el, containerEl) => {
return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
};
var getClientXY = (event) => {
let clientX;
let clientY;
if (event.type === "touchend") {
clientY = event.changedTouches[0].clientY;
clientX = event.changedTouches[0].clientX;
} else if (event.type.startsWith("touch")) {
clientY = event.touches[0].clientY;
clientX = event.touches[0].clientX;
} else {
clientY = event.clientY;
clientX = event.clientX;
}
return {
clientX,
clientY
};
};
// node_modules/element-plus/es/components/color-picker-panel/src/composables/use-slider.mjs
var useSlider = (props2, { key, minValue: minValue3, maxValue: maxValue3 }) => {
const instance = getCurrentInstance();
const thumb = shallowRef();
const bar = shallowRef();
const currentValue = computed(() => props2.color.get(key));
function handleClick(event) {
var _a;
if (props2.disabled) return;
const target2 = event.target;
if (target2 !== thumb.value) {
handleDrag(event);
}
(_a = thumb.value) == null ? void 0 : _a.focus();
}
function handleDrag(event) {
if (!bar.value || !thumb.value || props2.disabled) return;
const el = instance.vnode.el;
const rect = el.getBoundingClientRect();
const { clientX, clientY } = getClientXY(event);
let value;
if (!props2.vertical) {
let left = clientX - rect.left;
left = Math.max(thumb.value.offsetWidth / 2, left);
left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
value = Math.round(
(left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * maxValue3
);
} else {
let top = clientY - rect.top;
top = Math.max(thumb.value.offsetHeight / 2, top);
top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
value = Math.round(
(top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * maxValue3
);
}
props2.color.set(key, value);
}
function handleKeydown(event) {
if (props2.disabled) return;
const { shiftKey } = event;
const code = getEventCode(event);
const step2 = shiftKey ? 10 : 1;
const reverse = key === "hue" ? -1 : 1;
let isPreventDefault = true;
switch (code) {
case EVENT_CODE.left:
case EVENT_CODE.down:
incrementPosition(-step2 * reverse);
break;
case EVENT_CODE.right:
case EVENT_CODE.up:
incrementPosition(step2 * reverse);
break;
case EVENT_CODE.home:
props2.color.set(key, key === "hue" ? maxValue3 : minValue3);
break;
case EVENT_CODE.end:
props2.color.set(key, key === "hue" ? minValue3 : maxValue3);
break;
case EVENT_CODE.pageDown:
incrementPosition(-4 * reverse);
break;
case EVENT_CODE.pageUp:
incrementPosition(4 * reverse);
break;
default:
isPreventDefault = false;
break;
}
isPreventDefault && event.preventDefault();
}
function incrementPosition(step2) {
let next = currentValue.value + step2;
next = next < minValue3 ? minValue3 : next > maxValue3 ? maxValue3 : next;
props2.color.set(key, next);
}
return {
thumb,
bar,
currentValue,
handleDrag,
handleClick,
handleKeydown
};
};
var useSliderDOM = (props2, {
namespace,
maxValue: maxValue3,
bar,
thumb,
currentValue,
handleDrag,
getBackground
}) => {
const instance = getCurrentInstance();
const ns = useNamespace(namespace);
const thumbLeft = ref(0);
const thumbTop = ref(0);
const background = ref();
function getThumbLeft() {
if (!thumb.value) return 0;
if (props2.vertical) return 0;
const el = instance.vnode.el;
const value = currentValue.value;
if (!el) return 0;
return Math.round(
value * (el.offsetWidth - thumb.value.offsetWidth / 2) / maxValue3
);
}
function getThumbTop() {
if (!thumb.value) return 0;
const el = instance.vnode.el;
if (!props2.vertical) return 0;
const value = currentValue.value;
if (!el) return 0;
return Math.round(
value * (el.offsetHeight - thumb.value.offsetHeight / 2) / maxValue3
);
}
function update() {
thumbLeft.value = getThumbLeft();
thumbTop.value = getThumbTop();
background.value = getBackground == null ? void 0 : getBackground();
}
onMounted(() => {
if (!bar.value || !thumb.value) return;
const dragConfig = {
drag: (event) => {
handleDrag(event);
},
end: (event) => {
handleDrag(event);
}
};
draggable(bar.value, dragConfig);
draggable(thumb.value, dragConfig);
update();
});
watch(currentValue, () => update());
watch(
() => props2.color.value,
() => update()
);
const rootKls = computed(() => [
ns.b(),
ns.is("vertical", props2.vertical),
ns.is("disabled", props2.disabled)
]);
const barKls = computed(() => ns.e("bar"));
const thumbKls = computed(() => ns.e("thumb"));
const barStyle = computed(() => ({ background: background.value }));
const thumbStyle = computed(() => ({
left: addUnit(thumbLeft.value),
top: addUnit(thumbTop.value)
}));
return {
rootKls,
barKls,
barStyle,
thumbKls,
thumbStyle,
thumbLeft,
thumbTop,
update
};
};
// node_modules/element-plus/es/components/color-picker-panel/src/components/alpha-slider.vue2.mjs
var _hoisted_120 = ["aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled"];
var minValue = 0;
var maxValue = 100;
var _sfc_main51 = defineComponent({
...{
name: "ElColorAlphaSlider"
},
__name: "alpha-slider",
props: alphaSliderProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props2, { key: "alpha", minValue, maxValue });
const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useSliderDOM(props2, {
namespace: "color-alpha-slider",
maxValue,
currentValue,
bar,
thumb,
handleDrag,
getBackground
});
const { t } = useLocale();
const ariaLabel = computed(() => t("el.colorpicker.alphaLabel"));
const ariaValuetext = computed(() => {
return t("el.colorpicker.alphaDescription", {
alpha: currentValue.value,
color: props2.color.value
});
});
function getBackground() {
if (props2.color && props2.color.value) {
const { r, g, b: b2 } = props2.color.toRgb();
return `linear-gradient(to right, rgba(${r}, ${g}, ${b2}, 0) 0%, rgba(${r}, ${g}, ${b2}, 1) 100%)`;
}
return "";
}
__expose({
/**
* @description update alpha slider manually
* @type {Function}
*/
update,
/**
* @description bar element ref
* @type {HTMLElement}
*/
bar,
/**
* @description thumb element ref
* @type {HTMLElement}
*/
thumb
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls))
},
[
createBaseVNode(
"div",
{
ref_key: "bar",
ref: bar,
class: normalizeClass(unref(barKls)),
style: normalizeStyle(unref(barStyle)),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleClick) && unref(handleClick)(...args))
},
null,
6
/* CLASS, STYLE */
),
createBaseVNode("div", {
ref_key: "thumb",
ref: thumb,
class: normalizeClass(unref(thumbKls)),
style: normalizeStyle(unref(thumbStyle)),
"aria-label": ariaLabel.value,
"aria-valuenow": unref(currentValue),
"aria-valuetext": ariaValuetext.value,
"aria-orientation": __props.vertical ? "vertical" : "horizontal",
"aria-valuemin": minValue,
"aria-valuemax": maxValue,
role: "slider",
tabindex: __props.disabled ? void 0 : 0,
"aria-disabled": __props.disabled,
onKeydown: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
}, null, 46, _hoisted_120)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/color-picker-panel/src/components/hue-slider.vue2.mjs
var _hoisted_121 = ["aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled"];
var minValue2 = 0;
var maxValue2 = 360;
var _sfc_main52 = defineComponent({
...{
name: "ElColorHueSlider"
},
__name: "hue-slider",
props: hueSliderProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props2, { key: "hue", minValue: minValue2, maxValue: maxValue2 });
const { rootKls, barKls, thumbKls, thumbStyle, thumbTop, update } = useSliderDOM(props2, {
namespace: "color-hue-slider",
maxValue: maxValue2,
currentValue,
bar,
thumb,
handleDrag
});
const { t } = useLocale();
const ariaLabel = computed(() => t("el.colorpicker.hueLabel"));
const ariaValuetext = computed(() => {
return t("el.colorpicker.hueDescription", {
hue: currentValue.value,
color: props2.color.value
});
});
__expose({
/**
* @description bar element ref
*/
bar,
/**
* @description thumb element ref
*/
thumb,
/**
* @description thumb top position, only for vertical slider
*/
thumbTop,
/**
* @description update hue slider manually
*/
update
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls))
},
[
createBaseVNode(
"div",
{
ref_key: "bar",
ref: bar,
class: normalizeClass(unref(barKls)),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleClick) && unref(handleClick)(...args))
},
null,
2
/* CLASS */
),
createBaseVNode("div", {
ref_key: "thumb",
ref: thumb,
class: normalizeClass(unref(thumbKls)),
style: normalizeStyle(unref(thumbStyle)),
"aria-label": ariaLabel.value,
"aria-valuenow": unref(currentValue),
"aria-valuetext": ariaValuetext.value,
"aria-orientation": __props.vertical ? "vertical" : "horizontal",
"aria-valuemin": minValue2,
"aria-valuemax": maxValue2,
role: "slider",
tabindex: __props.disabled ? void 0 : 0,
"aria-disabled": __props.disabled,
onKeydown: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
}, null, 46, _hoisted_121)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/color-picker-panel/src/props/predefine.mjs
var predefineProps = buildProps({
colors: {
type: definePropType(Array),
required: true
},
color: {
type: definePropType(Object),
required: true
},
enableAlpha: {
type: Boolean,
required: true
},
disabled: Boolean
});
// node_modules/element-plus/es/components/color-picker-panel/src/utils/color.mjs
var __defProp3 = Object.defineProperty;
var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField3 = (obj, key, value) => __defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
var Color = class {
constructor(options = {}) {
__publicField3(this, "_hue", 0);
__publicField3(this, "_saturation", 100);
__publicField3(this, "_value", 100);
__publicField3(this, "_alpha", 100);
__publicField3(this, "_tiny", new TinyColor());
__publicField3(this, "_isValid", false);
__publicField3(this, "enableAlpha", false);
__publicField3(this, "format", "");
__publicField3(this, "value", "");
__publicField3(this, "selected");
for (const option in options) {
if (hasOwn(options, option)) {
this[option] = options[option];
}
}
if (options.value) {
this.fromString(options.value);
} else {
this.doOnChange();
}
}
set(prop, value) {
if (arguments.length === 1 && typeof prop === "object") {
for (const p2 in prop) {
if (hasOwn(prop, p2)) {
this.set(p2, prop[p2]);
}
}
return;
}
this[`_${prop}`] = value;
this._isValid = true;
this.doOnChange();
}
get(prop) {
if (["hue", "saturation", "value", "alpha"].includes(prop)) {
return Math.round(this[`_${prop}`]);
}
return this[`_${prop}`];
}
toRgb() {
return this._isValid ? this._tiny.toRgb() : { r: 255, g: 255, b: 255, a: 0 };
}
fromString(value) {
const color = new TinyColor(value);
this._isValid = color.isValid;
if (color.isValid) {
const { h: h3, s: s2, v: v2, a: a2 } = color.toHsv();
this._hue = h3;
this._saturation = s2 * 100;
this._value = v2 * 100;
this._alpha = a2 * 100;
} else {
this._hue = 0;
this._saturation = 100;
this._value = 100;
this._alpha = 100;
}
this.doOnChange();
}
clear() {
this._isValid = false;
this.value = "";
this._hue = 0;
this._saturation = 100;
this._value = 100;
this._alpha = 100;
}
compare(color) {
const compareColor = new TinyColor({
h: color._hue,
s: color._saturation / 100,
v: color._value / 100,
a: color._alpha / 100
});
return this._tiny.equals(compareColor);
}
doOnChange() {
const { _hue, _saturation, _value, _alpha, format, enableAlpha } = this;
let _format = format || (enableAlpha ? "rgb" : "hex");
if (format === "hex" && enableAlpha) {
_format = "hex8";
}
this._tiny = new TinyColor({
h: _hue,
s: _saturation / 100,
v: _value / 100,
a: _alpha / 100
});
this.value = this._isValid ? this._tiny.toString(_format) : "";
}
};
// node_modules/element-plus/es/components/color-picker-panel/src/composables/use-predefine.mjs
var usePredefine = (props2) => {
const { currentColor } = inject(colorPickerPanelContextKey);
const rgbaColors = ref(parseColors(props2.colors, props2.color));
watch(
() => currentColor.value,
(val) => {
const color = new Color({
value: val,
enableAlpha: props2.enableAlpha
});
rgbaColors.value.forEach((item) => {
item.selected = color.compare(item);
});
}
);
watchEffect(() => {
rgbaColors.value = parseColors(props2.colors, props2.color);
});
function handleSelect(index) {
props2.color.fromString(props2.colors[index]);
}
function parseColors(colors, color) {
return colors.map((value) => {
const c2 = new Color({
value,
enableAlpha: props2.enableAlpha
});
c2.selected = c2.compare(color);
return c2;
});
}
return {
rgbaColors,
handleSelect
};
};
var usePredefineDOM = (props2) => {
const ns = useNamespace("color-predefine");
const rootKls = computed(() => [ns.b(), ns.is("disabled", props2.disabled)]);
const colorsKls = computed(() => ns.e("colors"));
function colorSelectorKls(item) {
return [
ns.e("color-selector"),
ns.is("alpha", item.get("alpha") < 100),
{ selected: item.selected }
];
}
return {
rootKls,
colorsKls,
colorSelectorKls
};
};
// node_modules/element-plus/es/components/color-picker-panel/src/components/predefine.vue2.mjs
var _hoisted_122 = ["disabled", "aria-label", "onClick"];
var _sfc_main53 = defineComponent({
...{
name: "ElColorPredefine"
},
__name: "predefine",
props: predefineProps,
setup(__props) {
const props2 = __props;
const { rgbaColors, handleSelect } = usePredefine(props2);
const { rootKls, colorsKls, colorSelectorKls } = usePredefineDOM(props2);
const { t } = useLocale();
const ariaLabel = (value) => {
return t("el.colorpicker.predefineDescription", { value });
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(colorsKls))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(rgbaColors), (item, index) => {
return openBlock(), createElementBlock("button", {
key: __props.colors[index],
type: "button",
disabled: __props.disabled,
"aria-label": ariaLabel(item.value),
class: normalizeClass(unref(colorSelectorKls)(item)),
onClick: ($event) => unref(handleSelect)(index)
}, [
createBaseVNode(
"div",
{
style: normalizeStyle({ backgroundColor: item.value })
},
null,
4
/* STYLE */
)
], 10, _hoisted_122);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/color-picker-panel/src/props/sv-panel.mjs
var svPanelProps = buildProps({
color: {
type: definePropType(Object),
required: true
},
disabled: Boolean
});
// node_modules/element-plus/es/components/color-picker-panel/src/composables/use-sv-panel.mjs
var useSvPanel = (props2) => {
const instance = getCurrentInstance();
const cursorRef = ref();
const cursorTop = ref(0);
const cursorLeft = ref(0);
const background = ref("hsl(0, 100%, 50%)");
const saturation = computed(() => props2.color.get("saturation"));
const brightness = computed(() => props2.color.get("value"));
const hue = computed(() => props2.color.get("hue"));
function handleClick(event) {
var _a;
if (props2.disabled) return;
const target2 = event.target;
if (target2 !== cursorRef.value) {
handleDrag(event);
}
(_a = cursorRef.value) == null ? void 0 : _a.focus({ preventScroll: true });
}
function handleDrag(event) {
if (props2.disabled) return;
const el = instance.vnode.el;
const rect = el.getBoundingClientRect();
const { clientX, clientY } = getClientXY(event);
let left = clientX - rect.left;
let top = clientY - rect.top;
left = Math.max(0, left);
left = Math.min(left, rect.width);
top = Math.max(0, top);
top = Math.min(top, rect.height);
cursorLeft.value = left;
cursorTop.value = top;
props2.color.set({
saturation: left / rect.width * 100,
value: 100 - top / rect.height * 100
});
}
function handleKeydown(event) {
if (props2.disabled) return;
const { shiftKey } = event;
const code = getEventCode(event);
const step2 = shiftKey ? 10 : 1;
let isPreventDefault = true;
switch (code) {
case EVENT_CODE.left:
incrementSaturation(-step2);
break;
case EVENT_CODE.right:
incrementSaturation(step2);
break;
case EVENT_CODE.up:
incrementBrightness(step2);
break;
case EVENT_CODE.down:
incrementBrightness(-step2);
break;
default:
isPreventDefault = false;
break;
}
isPreventDefault && event.preventDefault();
}
function incrementSaturation(step2) {
let next = saturation.value + step2;
next = next < 0 ? 0 : next > 100 ? 100 : next;
props2.color.set("saturation", next);
}
function incrementBrightness(step2) {
let next = brightness.value + step2;
next = next < 0 ? 0 : next > 100 ? 100 : next;
props2.color.set("value", next);
}
return {
cursorRef,
cursorTop,
cursorLeft,
background,
saturation,
brightness,
hue,
handleClick,
handleDrag,
handleKeydown
};
};
var useSvPanelDOM = (props2, {
cursorTop,
cursorLeft,
background,
handleDrag
}) => {
const instance = getCurrentInstance();
const ns = useNamespace("color-svpanel");
function update() {
const saturation = props2.color.get("saturation");
const brightness = props2.color.get("value");
const el = instance.vnode.el;
const { clientWidth: width, clientHeight: height } = el;
cursorLeft.value = saturation * width / 100;
cursorTop.value = (100 - brightness) * height / 100;
background.value = `hsl(${props2.color.get("hue")}, 100%, 50%)`;
}
onMounted(() => {
draggable(instance.vnode.el, {
drag: (event) => {
handleDrag(event);
},
end: (event) => {
handleDrag(event);
}
});
update();
});
watch(
[
() => props2.color.get("hue"),
() => props2.color.get("value"),
() => props2.color.value
],
() => update()
);
const rootKls = computed(() => ns.b());
const cursorKls = computed(() => ns.e("cursor"));
const rootStyle = computed(() => ({
backgroundColor: background.value
}));
const cursorStyle = computed(() => ({
top: addUnit(cursorTop.value),
left: addUnit(cursorLeft.value)
}));
return {
rootKls,
cursorKls,
rootStyle,
cursorStyle,
update
};
};
// node_modules/element-plus/es/components/color-picker-panel/src/components/sv-panel.vue2.mjs
var _hoisted_123 = ["tabindex", "aria-disabled", "aria-label", "aria-valuenow", "aria-valuetext"];
var _sfc_main54 = defineComponent({
...{
name: "ElSvPanel"
},
__name: "sv-panel",
props: svPanelProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const {
cursorRef,
cursorTop,
cursorLeft,
background,
saturation,
brightness,
handleClick,
handleDrag,
handleKeydown
} = useSvPanel(props2);
const { rootKls, cursorKls, rootStyle, cursorStyle, update } = useSvPanelDOM(
props2,
{
cursorTop,
cursorLeft,
background,
handleDrag
}
);
const { t } = useLocale();
const ariaLabel = computed(() => t("el.colorpicker.svLabel"));
const ariaValuetext = computed(() => {
return t("el.colorpicker.svDescription", {
saturation: saturation.value,
brightness: brightness.value,
color: props2.color.value
});
});
__expose({
/**
* @description update sv panel manually
*/
update
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(rootKls)),
style: normalizeStyle(unref(rootStyle)),
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleClick) && unref(handleClick)(...args))
},
[
createBaseVNode("div", {
ref_key: "cursorRef",
ref: cursorRef,
class: normalizeClass(unref(cursorKls)),
style: normalizeStyle(unref(cursorStyle)),
tabindex: __props.disabled ? void 0 : 0,
"aria-disabled": __props.disabled,
role: "slider",
"aria-valuemin": "0,0",
"aria-valuemax": "100,100",
"aria-label": ariaLabel.value,
"aria-valuenow": `${unref(saturation)},${unref(brightness)}`,
"aria-valuetext": ariaValuetext.value,
onKeydown: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
}, null, 46, _hoisted_123)
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/color-picker-panel/src/composables/use-common-color.mjs
var useCommonColor = (props2, emit) => {
const color = reactive(
new Color({
enableAlpha: props2.showAlpha,
format: props2.colorFormat || "",
value: props2.modelValue
})
);
watch(
() => [props2.colorFormat, props2.showAlpha],
() => {
color.enableAlpha = props2.showAlpha;
color.format = props2.colorFormat || color.format;
color.doOnChange();
emit(UPDATE_MODEL_EVENT, color.value);
}
);
return {
color
};
};
// node_modules/element-plus/es/components/color-picker-panel/src/color-picker-panel.vue2.mjs
var _sfc_main55 = defineComponent({
...{
name: "ElColorPickerPanel"
},
__name: "color-picker-panel",
props: colorPickerPanelProps,
emits: colorPickerPanelEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("color-picker-panel");
const { formItem } = useFormItem();
const disabled = useFormDisabled();
const hueRef = ref();
const svRef = ref();
const alphaRef = ref();
const inputRef = ref();
const customInput = ref("");
const { color } = inject(
ROOT_COMMON_COLOR_INJECTION_KEY,
() => useCommonColor(props2, emit),
true
);
function handleConfirm() {
color.fromString(customInput.value);
if (color.value !== customInput.value) {
customInput.value = color.value;
}
}
function handleFocusout() {
var _a;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
}
}
function update() {
var _a, _b, _c;
(_a = hueRef.value) == null ? void 0 : _a.update();
(_b = svRef.value) == null ? void 0 : _b.update();
(_c = alphaRef.value) == null ? void 0 : _c.update();
}
onMounted(() => {
if (props2.modelValue) {
customInput.value = color.value;
}
nextTick(update);
});
watch(
() => props2.modelValue,
(newVal) => {
if (newVal !== color.value) {
newVal ? color.fromString(newVal) : color.clear();
}
}
);
watch(
() => color.value,
(val) => {
emit(UPDATE_MODEL_EVENT, val);
customInput.value = val;
if (props2.validateEvent) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
}
);
provide(colorPickerPanelContextKey, {
currentColor: computed(() => color.value)
});
__expose({
/**
* @description current color object
*/
color,
/**
* @description custom input ref
*/
inputRef,
/**
* @description update sub components
*/
update
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b(), unref(ns).is("disabled", unref(disabled)), unref(ns).is("border", __props.border)]),
onFocusout: handleFocusout
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("wrapper"))
},
[
createVNode(_sfc_main52, {
ref_key: "hueRef",
ref: hueRef,
class: "hue-slider",
color: unref(color),
vertical: "",
disabled: unref(disabled)
}, null, 8, ["color", "disabled"]),
createVNode(_sfc_main54, {
ref_key: "svRef",
ref: svRef,
color: unref(color),
disabled: unref(disabled)
}, null, 8, ["color", "disabled"])
],
2
/* CLASS */
),
__props.showAlpha ? (openBlock(), createBlock(_sfc_main51, {
key: 0,
ref_key: "alphaRef",
ref: alphaRef,
color: unref(color),
disabled: unref(disabled)
}, null, 8, ["color", "disabled"])) : createCommentVNode("v-if", true),
__props.predefine ? (openBlock(), createBlock(_sfc_main53, {
key: 1,
ref: "predefine",
"enable-alpha": __props.showAlpha,
color: unref(color),
colors: __props.predefine,
disabled: unref(disabled)
}, null, 8, ["enable-alpha", "color", "colors", "disabled"])) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("footer"))
},
[
createVNode(unref(ElInput), {
ref_key: "inputRef",
ref: inputRef,
modelValue: customInput.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
"validate-event": false,
size: "small",
disabled: unref(disabled),
onChange: handleConfirm
}, null, 8, ["modelValue", "disabled"]),
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/color-picker-panel/index.mjs
var ElColorPickerPanel = withInstall(_sfc_main55);
// node_modules/element-plus/es/components/color-picker/src/color-picker.mjs
var colorPickerProps = buildProps({
/**
* @description when color-picker inactive and persistent is false, the color panel will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
/**
* @description binding value
*/
modelValue: {
type: definePropType(String),
default: void 0
},
/**
* @description ColorPicker id
*/
id: String,
/**
* @description whether to display the alpha slider
*/
showAlpha: Boolean,
/**
* @description color format of v-model
*/
colorFormat: String,
/**
* @description whether to disable the ColorPicker
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether to show clear button
*/
clearable: {
type: Boolean,
default: true
},
/**
* @description size of ColorPicker
*/
size: useSizeProp,
/**
* @description custom class name for ColorPicker's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for ColorPicker's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description ColorPicker tabindex
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description whether color-picker popper is teleported to the body
*/
teleported: useTooltipContentProps.teleported,
/**
* @description which color-picker panel appends to
*/
appendTo: useTooltipContentProps.appendTo,
/**
* @description predefined color options
*/
predefine: {
type: definePropType(Array)
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
...useEmptyValuesProps,
...useAriaProps(["ariaLabel"])
});
var colorPickerEmits = {
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil_default(val),
[CHANGE_EVENT]: (val) => isString(val) || isNil_default(val),
activeChange: (val) => isString(val) || isNil_default(val),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true
};
var colorPickerPropsDefaults = {
persistent: true,
modelValue: void 0,
disabled: void 0,
clearable: true,
popperStyle: void 0,
tabindex: 0,
teleported: true,
validateEvent: true,
valueOnClear: void 0
};
// node_modules/element-plus/es/components/color-picker/src/color-picker.vue2.mjs
var _hoisted_124 = ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex"];
var _sfc_main56 = defineComponent({
...{
name: "ElColorPicker"
},
__name: "color-picker",
props: colorPickerProps,
emits: colorPickerEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("color");
const { formItem } = useFormItem();
const colorSize = useFormSize();
const colorDisabled = useFormDisabled();
const { valueOnClear, isEmptyValue } = useEmptyValues(props2, null);
const commonColor = useCommonColor(props2, emit);
const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext: formItem
});
const popper = ref();
const triggerRef2 = ref();
const pickerPanelRef = ref();
const showPicker = ref(false);
const showPanelColor = ref(false);
let shouldActiveChange = true;
const { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef2, {
disabled: colorDisabled,
beforeBlur(event) {
var _a;
return (_a = popper.value) == null ? void 0 : _a.isFocusInsideContent(event);
},
afterBlur() {
var _a;
setShowPicker(false);
resetColor();
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
}
}
});
const color = reactiveComputed(
() => {
var _a, _b;
return (_b = (_a = pickerPanelRef.value) == null ? void 0 : _a.color) != null ? _b : commonColor.color;
}
);
const panelProps = computed(
() => pick_default(props2, Object.keys(colorPickerPanelProps))
);
const displayedColor = computed(() => {
if (!props2.modelValue && !showPanelColor.value) {
return "transparent";
}
return displayedRgb(color, props2.showAlpha);
});
const currentColor = computed(() => {
return !props2.modelValue && !showPanelColor.value ? "" : color.value;
});
const buttonAriaLabel = computed(() => {
return !isLabeledByFormItem.value ? props2.ariaLabel || t("el.colorpicker.defaultLabel") : void 0;
});
const buttonAriaLabelledby = computed(() => {
return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
});
const btnKls = computed(() => {
return [
ns.b("picker"),
ns.is("disabled", colorDisabled.value),
ns.bm("picker", colorSize.value),
ns.is("focused", isFocused.value)
];
});
function displayedRgb(color2, showAlpha) {
const { r, g, b: b2, a: a2 } = color2.toRgb();
return showAlpha ? `rgba(${r}, ${g}, ${b2}, ${a2})` : `rgb(${r}, ${g}, ${b2})`;
}
function setShowPicker(value) {
showPicker.value = value;
}
const debounceSetShowPicker = debounce_default(setShowPicker, 100, { leading: true });
function show() {
if (colorDisabled.value) return;
setShowPicker(true);
}
function hide2() {
debounceSetShowPicker(false);
resetColor();
}
function resetColor() {
nextTick(() => {
if (props2.modelValue) {
color.fromString(props2.modelValue);
} else {
color.value = "";
nextTick(() => {
showPanelColor.value = false;
});
}
});
}
function handleTrigger() {
if (colorDisabled.value) return;
if (showPicker.value) {
resetColor();
}
debounceSetShowPicker(!showPicker.value);
}
function confirmValue() {
const value = isEmptyValue(color.value) ? valueOnClear.value : color.value;
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value);
if (props2.validateEvent) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
debounceSetShowPicker(false);
nextTick(() => {
const newColor = new Color({
enableAlpha: props2.showAlpha,
format: props2.colorFormat || "",
value: props2.modelValue
});
if (!color.compare(newColor)) {
resetColor();
}
});
}
function clear() {
debounceSetShowPicker(false);
emit(UPDATE_MODEL_EVENT, valueOnClear.value);
emit(CHANGE_EVENT, valueOnClear.value);
if (props2.modelValue !== valueOnClear.value && props2.validateEvent) {
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
}
resetColor();
emit("clear");
}
function handleShowTooltip() {
var _a, _b;
(_b = (_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.inputRef) == null ? void 0 : _b.focus();
}
function handleClickOutside() {
if (!showPicker.value) return;
hide2();
isFocused.value && focus();
}
function handleEsc(event) {
event.preventDefault();
event.stopPropagation();
setShowPicker(false);
resetColor();
}
function handleKeyDown(event) {
const code = getEventCode(event);
switch (code) {
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
case EVENT_CODE.space:
event.preventDefault();
event.stopPropagation();
show();
break;
case EVENT_CODE.esc:
handleEsc(event);
break;
}
}
function focus() {
triggerRef2.value.focus();
}
function blur() {
triggerRef2.value.blur();
}
watch(
() => currentColor.value,
(val) => {
shouldActiveChange && emit("activeChange", val);
shouldActiveChange = true;
}
);
watch(
() => color.value,
() => {
if (!props2.modelValue && !showPanelColor.value) {
showPanelColor.value = true;
}
}
);
watch(
() => props2.modelValue,
(newVal) => {
if (!newVal) {
showPanelColor.value = false;
} else if (newVal && newVal !== color.value) {
shouldActiveChange = false;
color.fromString(newVal);
}
}
);
watch(
() => showPicker.value,
() => {
pickerPanelRef.value && nextTick(pickerPanelRef.value.update);
}
);
provide(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor);
__expose({
/**
* @description current color object
*/
color,
/**
* @description manually show ColorPicker
*/
show,
/**
* @description manually hide ColorPicker
*/
hide: hide2,
/**
* @description focus the input element
*/
focus,
/**
* @description blur the input element
*/
blur
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), {
ref_key: "popper",
ref: popper,
visible: showPicker.value,
"show-arrow": false,
"fallback-placements": ["bottom", "top", "right", "left"],
offset: 0,
"gpu-acceleration": false,
"popper-class": [unref(ns).be("picker", "panel"), __props.popperClass],
"popper-style": __props.popperStyle,
"stop-popper-mouse-event": false,
pure: "",
loop: "",
role: "dialog",
effect: "light",
trigger: "click",
teleported: __props.teleported,
transition: `${unref(ns).namespace.value}-zoom-in-top`,
persistent: __props.persistent,
"append-to": __props.appendTo,
onShow: handleShowTooltip,
onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
}, {
content: withCtx(() => [
withDirectives((openBlock(), createBlock(
unref(ElColorPickerPanel),
mergeProps({
ref_key: "pickerPanelRef",
ref: pickerPanelRef
}, panelProps.value, {
border: false,
"validate-event": false,
onKeydown: withKeys(handleEsc, ["esc"])
}),
{
footer: withCtx(() => [
createBaseVNode("div", null, [
__props.clearable ? (openBlock(), createBlock(unref(ElButton), {
key: 0,
class: normalizeClass(unref(ns).be("footer", "link-btn")),
text: "",
size: "small",
onClick: clear
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.colorpicker.clear")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
createVNode(unref(ElButton), {
plain: "",
size: "small",
class: normalizeClass(unref(ns).be("footer", "btn")),
onClick: confirmValue
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.colorpicker.confirm")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class"])
])
]),
_: 1
/* STABLE */
},
16
/* FULL_PROPS */
)), [
[unref(ClickOutside), handleClickOutside, triggerRef2.value]
])
]),
default: withCtx(() => [
createBaseVNode("div", mergeProps({
id: unref(buttonId),
ref_key: "triggerRef",
ref: triggerRef2
}, _ctx.$attrs, {
class: btnKls.value,
role: "button",
"aria-label": buttonAriaLabel.value,
"aria-labelledby": buttonAriaLabelledby.value,
"aria-description": unref(t)("el.colorpicker.description", { color: __props.modelValue || "" }),
"aria-disabled": unref(colorDisabled),
tabindex: unref(colorDisabled) ? void 0 : __props.tabindex,
onKeydown: handleKeyDown,
onFocus: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleFocus) && unref(handleFocus)(...args)),
onBlur: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleBlur) && unref(handleBlur)(...args))
}), [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).be("picker", "trigger")),
onClick: handleTrigger
},
[
createBaseVNode(
"span",
{
class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", __props.showAlpha)])
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).be("picker", "color-inner")),
style: normalizeStyle({
backgroundColor: displayedColor.value
})
},
[
withDirectives(createVNode(unref(ElIcon), {
class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
}, {
default: withCtx(() => [
createVNode(unref(arrow_down_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]), [
[vShow, __props.modelValue || showPanelColor.value]
]),
withDirectives(createVNode(unref(ElIcon), {
class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
}, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]), [
[vShow, !__props.modelValue && !showPanelColor.value]
])
],
6
/* CLASS, STYLE */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
], 16, _hoisted_124)
]),
_: 1
/* STABLE */
}, 8, ["visible", "popper-class", "popper-style", "teleported", "transition", "persistent", "append-to"]);
};
}
});
// node_modules/element-plus/es/components/color-picker/index.mjs
var ElColorPicker = withInstall(_sfc_main56);
// node_modules/element-plus/es/components/config-provider/src/config-provider-props.mjs
var configProviderProps = buildProps({
/**
* @description Controlling if the users want a11y features
*/
a11y: {
type: Boolean,
default: true
},
/**
* @description Locale Object
*/
locale: {
type: definePropType(Object)
},
/**
* @description global component size
*/
size: useSizeProp,
/**
* @description button related configuration, [see the following table](https://element-plus.org/en-US/component/config-provider.html#button-attribute)
*/
button: {
type: definePropType(Object)
},
/**
* @description card related configuration, [see the following table](https://element-plus.org/en-US/component/config-provider.html#card-attribute)
*/
card: {
type: definePropType(Object)
},
/**
* @description dialog related configuration, [see the following table](https://element-plus.org/en-US/component/config-provider.html#dialog-attribute)
*/
dialog: {
type: definePropType(Object)
},
/**
* @description link related configuration, [see the following table](https://element-plus.org/en-US/component/config-provider.html#link-attribute)
*/
link: {
type: definePropType(Object)
},
/**
* @description features at experimental stage to be added, all features are default to be set to false, [see the following table](https://element-plus.org/en-US/component/config-provider.html#experimental-features) | ^[object]
*/
experimentalFeatures: {
type: definePropType(Object)
},
/**
* @description Controls if we should handle keyboard navigation
*/
keyboardNavigation: {
type: Boolean,
default: true
},
/**
* @description message related configuration, [see the following table](https://element-plus.org/en-US/component/config-provider.html#message-attribute)
*/
message: {
type: definePropType(Object)
},
/**
* @description global Initial zIndex
*/
zIndex: Number,
/**
* @description global component className prefix (cooperated with [$namespace](https://github.com/element-plus/element-plus/blob/dev/packages/theme-chalk/src/mixins/config.scss#L1)) | ^[string]
*/
namespace: {
type: String,
default: "el"
},
...useEmptyValuesProps
});
// node_modules/element-plus/es/components/config-provider/src/config-provider.mjs
var messageConfig = {
placement: "top"
};
var ConfigProvider = defineComponent({
name: "ElConfigProvider",
props: configProviderProps,
setup(props2, { slots }) {
const config = provideGlobalConfig(props2);
watch(
() => props2.message,
(val) => {
var _a, _b;
Object.assign(messageConfig, (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.message) != null ? _b : {}, val != null ? val : {});
},
{ immediate: true, deep: true }
);
return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
}
});
// node_modules/element-plus/es/components/config-provider/index.mjs
var ElConfigProvider = withInstall(ConfigProvider);
// node_modules/element-plus/es/components/container/src/container.vue2.mjs
var _sfc_main57 = defineComponent({
...{
name: "ElContainer"
},
__name: "container",
props: {
direction: { type: String, required: false }
},
setup(__props) {
const props2 = __props;
const slots = useSlots();
const ns = useNamespace("container");
const isVertical = computed(() => {
if (props2.direction === "vertical") {
return true;
} else if (props2.direction === "horizontal") {
return false;
}
if (slots && slots.default) {
const vNodes = slots.default();
return vNodes.some((vNode) => {
const tag = vNode.type.name;
return tag === "ElHeader" || tag === "ElFooter";
});
} else {
return false;
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"section",
{
class: normalizeClass([unref(ns).b(), unref(ns).is("vertical", isVertical.value)])
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/container/src/aside.vue2.mjs
var _sfc_main58 = defineComponent({
...{
name: "ElAside"
},
__name: "aside",
props: {
width: { type: [String, null], required: false, default: null }
},
setup(__props) {
const props2 = __props;
const ns = useNamespace("aside");
const style = computed(
() => props2.width ? ns.cssVarBlock({ width: props2.width }) : {}
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"aside",
{
class: normalizeClass(unref(ns).b()),
style: normalizeStyle(style.value)
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/container/src/footer.vue2.mjs
var _sfc_main59 = defineComponent({
...{
name: "ElFooter"
},
__name: "footer",
props: {
height: { type: [String, null], required: false, default: null }
},
setup(__props) {
const props2 = __props;
const ns = useNamespace("footer");
const style = computed(
() => props2.height ? ns.cssVarBlock({ height: props2.height }) : {}
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"footer",
{
class: normalizeClass(unref(ns).b()),
style: normalizeStyle(style.value)
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/container/src/header.vue2.mjs
var _sfc_main60 = defineComponent({
...{
name: "ElHeader"
},
__name: "header",
props: {
height: { type: [String, null], required: false, default: null }
},
setup(__props) {
const props2 = __props;
const ns = useNamespace("header");
const style = computed(() => {
return props2.height ? ns.cssVarBlock({
height: props2.height
}) : {};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"header",
{
class: normalizeClass(unref(ns).b()),
style: normalizeStyle(style.value)
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/container/src/main.vue2.mjs
var _sfc_main61 = defineComponent({
...{
name: "ElMain"
},
__name: "main",
setup(__props) {
const ns = useNamespace("main");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"main",
{
class: normalizeClass(unref(ns).b())
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/container/index.mjs
var ElContainer = withInstall(_sfc_main57, {
Aside: _sfc_main58,
Footer: _sfc_main59,
Header: _sfc_main60,
Main: _sfc_main61
});
var ElAside = withNoopInstall(_sfc_main58);
var ElFooter = withNoopInstall(_sfc_main59);
var ElHeader = withNoopInstall(_sfc_main60);
var ElMain = withNoopInstall(_sfc_main61);
// node_modules/element-plus/es/components/time-picker/src/time-picker.mjs
var import_dayjs7 = __toESM(require_dayjs_min(), 1);
var import_customParseFormat = __toESM(require_customParseFormat(), 1);
// node_modules/element-plus/es/components/time-picker/src/constants.mjs
var timeUnits = ["hours", "minutes", "seconds"];
var PICKER_BASE_INJECTION_KEY = "EP_PICKER_BASE";
var PICKER_POPPER_OPTIONS_INJECTION_KEY = "ElPopperOptions";
var ROOT_COMMON_PICKER_INJECTION_KEY = /* @__PURE__ */ Symbol("commonPickerContextKey");
var DEFAULT_FORMATS_TIME = "HH:mm:ss";
var DEFAULT_FORMATS_DATE = "YYYY-MM-DD";
var DEFAULT_FORMATS_DATEPICKER = {
date: DEFAULT_FORMATS_DATE,
dates: DEFAULT_FORMATS_DATE,
week: "gggg[w]ww",
year: "YYYY",
years: "YYYY",
month: "YYYY-MM",
months: "YYYY-MM",
datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`,
monthrange: "YYYY-MM",
yearrange: "YYYY",
daterange: DEFAULT_FORMATS_DATE,
datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`
};
// node_modules/element-plus/es/components/time-picker/src/composables/use-common-picker.mjs
var useCommonPicker = (props2, emit) => {
const { lang } = useLocale();
const pickerVisible = ref(false);
const pickerActualVisible = ref(false);
const userInput = ref(null);
const valueIsEmpty = computed(() => {
const { modelValue } = props2;
return !modelValue || isArray(modelValue) && !modelValue.filter(Boolean).length;
});
const emitInput = (input) => {
if (!valueEquals(props2.modelValue, input)) {
let formatted;
if (isArray(input)) {
formatted = input.map(
(item) => formatter(item, props2.valueFormat, lang.value)
);
} else if (input) {
formatted = formatter(input, props2.valueFormat, lang.value);
}
const emitVal = input ? formatted : input;
emit(UPDATE_MODEL_EVENT, emitVal, lang.value);
}
};
const parsedValue = computed(() => {
var _a;
let dayOrDays;
if (valueIsEmpty.value) {
if (pickerOptions.value.getDefaultValue) {
dayOrDays = pickerOptions.value.getDefaultValue();
}
} else {
if (isArray(props2.modelValue)) {
dayOrDays = props2.modelValue.map(
(d2) => parseDate(d2, props2.valueFormat, lang.value)
);
} else {
dayOrDays = parseDate(
(_a = props2.modelValue) != null ? _a : "",
props2.valueFormat,
lang.value
);
}
}
if (pickerOptions.value.getRangeAvailableTime) {
const availableResult = pickerOptions.value.getRangeAvailableTime(
dayOrDays
);
if (!isEqual_default(availableResult, dayOrDays)) {
dayOrDays = availableResult;
if (!valueIsEmpty.value) {
emitInput(dayOrDaysToDate(dayOrDays));
}
}
}
if (isArray(dayOrDays) && dayOrDays.some((day) => !day)) {
dayOrDays = [];
}
return dayOrDays;
});
const pickerOptions = ref({});
const onSetPickerOption = (e) => {
pickerOptions.value[e[0]] = e[1];
pickerOptions.value.panelReady = true;
};
const onCalendarChange = (e) => {
emit("calendar-change", e);
};
const onPanelChange = (value, mode, view) => {
emit("panel-change", value, mode, view);
};
const onPick = (date = "", visible = false) => {
pickerVisible.value = visible;
let result;
if (isArray(date)) {
result = date.map((_2) => _2.toDate());
} else {
result = date ? date.toDate() : date;
}
userInput.value = null;
emitInput(result);
};
return {
parsedValue,
pickerActualVisible,
pickerOptions,
pickerVisible,
userInput,
valueIsEmpty,
emitInput,
onCalendarChange,
onPanelChange,
onPick,
onSetPickerOption
};
};
// node_modules/element-plus/es/components/time-picker/src/props/shared.mjs
var disabledTimeListsProps = buildProps({
/**
* @description To specify the array of hours that cannot be selected
*/
disabledHours: {
type: definePropType(Function)
},
/**
* @description To specify the array of minutes that cannot be selected
*/
disabledMinutes: {
type: definePropType(Function)
},
/**
* @description To specify the array of seconds that cannot be selected
*/
disabledSeconds: {
type: definePropType(Function)
}
});
var timePanelSharedProps = buildProps({
visible: Boolean,
actualVisible: {
type: Boolean,
default: void 0
},
format: {
type: String,
default: ""
}
});
// node_modules/element-plus/es/components/time-picker/src/common/props.mjs
var timePickerDefaultProps = buildProps({
/**
* @description this prop decides if the date picker panel pops up when the input is focused
*/
automaticDropdown: {
type: Boolean,
default: true
},
/**
* @description same as `id` in native input
*/
id: {
type: definePropType([Array, String])
},
/**
* @description same as `name` in native input
*/
name: {
type: definePropType([Array, String])
},
/**
* @description custom class name for TimePicker's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for TimePicker's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description format of the displayed value in the input box
*/
format: String,
/**
* @description optional, format of binding value. If not specified, the binding value will be a Date object
*/
valueFormat: String,
/**
* @description optional, format of the date displayed in input's inner panel
*/
dateFormat: String,
/**
* @description optional, format of the time displayed in input's inner panel
*/
timeFormat: String,
/**
* @description type of the picker
*/
type: {
type: String,
default: ""
},
/**
* @description whether to show clear button
*/
clearable: {
type: Boolean,
default: true
},
/**
* @description Custom clear icon component
*/
clearIcon: {
type: definePropType([String, Object]),
default: circle_close_default
},
/**
* @description whether the input is editable
*/
editable: {
type: Boolean,
default: true
},
/**
* @description Custom prefix icon component
*/
prefixIcon: {
type: definePropType([String, Object]),
default: ""
},
/**
* @description size of Input
*/
size: useSizeProp,
/**
* @description whether TimePicker is read only
*/
readonly: Boolean,
/**
* @description whether TimePicker is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description placeholder in non-range mode
*/
placeholder: {
type: String,
default: ""
},
/**
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
*/
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
/**
* @description binding value, if it is an array, the length should be 2
*/
modelValue: {
type: definePropType([Date, Array, String, Number]),
default: ""
},
/**
* @description range separator
*/
rangeSeparator: {
type: String,
default: "-"
},
/**
* @description placeholder for the start date in range mode
*/
startPlaceholder: String,
/**
* @description placeholder for the end date in range mode
*/
endPlaceholder: String,
/**
* @description optional, default date of the calendar
*/
defaultValue: {
type: definePropType([Date, Array])
},
/**
* @description optional, the time value to use when selecting date range
*/
defaultTime: {
type: definePropType([Date, Array])
},
/**
* @description whether to pick a time range
*/
isRange: Boolean,
...disabledTimeListsProps,
/**
* @description a function determining if a date is disabled with that date as its parameter. Should return a Boolean
*/
disabledDate: {
type: Function
},
/**
* @description set custom className
*/
cellClassName: {
type: Function
},
/**
* @description an object array to set shortcut options
*/
shortcuts: {
type: Array,
default: () => []
},
/**
* @description whether to pick time using arrow buttons
*/
arrowControl: Boolean,
/**
* @description input tabindex
*/
tabindex: {
type: definePropType([String, Number]),
default: 0
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description unlink two date-panels in range-picker
*/
unlinkPanels: Boolean,
/**
* @description position of dropdown
*/
placement: {
type: definePropType(String),
values: Ee,
default: "bottom"
},
/**
* @description list of possible positions for dropdown
*/
fallbackPlacements: {
type: definePropType(Array),
default: ["bottom", "top", "right", "left"]
},
...useEmptyValuesProps,
...useAriaProps(["ariaLabel"]),
/**
* @description whether to show the now button
*/
showNow: {
type: Boolean,
default: true
},
/**
* @description whether to show footer
*/
showConfirm: {
type: Boolean,
default: true
},
/**
* @description whether to show footer
*/
showFooter: {
type: Boolean,
default: true
},
/**
* @description whether to show the number of the calendar week
*/
showWeekNumber: Boolean
});
var timePickerRangeTriggerProps = buildProps({
id: {
type: definePropType(Array)
},
name: {
type: definePropType(Array)
},
modelValue: {
type: definePropType([Array, String])
},
startPlaceholder: String,
endPlaceholder: String,
disabled: Boolean
});
var timePickerRngeTriggerProps = timePickerRangeTriggerProps;
// node_modules/element-plus/es/components/time-picker/src/common/picker-range-trigger.vue2.mjs
var _hoisted_125 = ["id", "name", "placeholder", "value", "disabled"];
var _hoisted_210 = ["id", "name", "placeholder", "value", "disabled"];
var _sfc_main62 = defineComponent({
...{
name: "PickerRangeTrigger",
inheritAttrs: false
},
__name: "picker-range-trigger",
props: timePickerRangeTriggerProps,
emits: [
"mouseenter",
"mouseleave",
"click",
"touchstart",
"focus",
"blur",
"startInput",
"endInput",
"startChange",
"endChange"
],
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { formItem } = useFormItem();
const { inputId } = useFormItemInputId(
reactive({ id: computed(() => {
var _a;
return (_a = props2.id) == null ? void 0 : _a[0];
}) }),
{
formItemContext: formItem
}
);
const attrs = useAttrs2();
const nsDate = useNamespace("date");
const nsRange = useNamespace("range");
const inputRef = ref();
const endInputRef = ref();
const { wrapperRef, isFocused } = useFocusController(inputRef, {
disabled: computed(() => props2.disabled)
});
const handleClick = (evt) => {
emit("click", evt);
};
const handleMouseEnter = (evt) => {
emit("mouseenter", evt);
};
const handleMouseLeave = (evt) => {
emit("mouseleave", evt);
};
const handleTouchStart = (evt) => {
emit("touchstart", evt);
};
const handleStartInput = (evt) => {
emit("startInput", evt);
};
const handleEndInput = (evt) => {
emit("endInput", evt);
};
const handleStartChange = (evt) => {
emit("startChange", evt);
};
const handleEndChange = (evt) => {
emit("endChange", evt);
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a, _b;
(_a = inputRef.value) == null ? void 0 : _a.blur();
(_b = endInputRef.value) == null ? void 0 : _b.blur();
};
__expose({
focus,
blur
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "wrapperRef",
ref: wrapperRef,
class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]),
style: normalizeStyle(
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.$attrs.style
),
onClick: handleClick,
onMouseenter: handleMouseEnter,
onMouseleave: handleMouseLeave,
onTouchstartPassive: handleTouchStart
},
[
renderSlot(_ctx.$slots, "prefix"),
createBaseVNode("input", mergeProps(unref(attrs), {
id: unref(inputId),
ref_key: "inputRef",
ref: inputRef,
name: _ctx.name && _ctx.name[0],
placeholder: _ctx.startPlaceholder,
value: _ctx.modelValue && _ctx.modelValue[0],
class: unref(nsRange).b("input"),
disabled: _ctx.disabled,
onInput: handleStartInput,
onChange: handleStartChange
}), null, 16, _hoisted_125),
renderSlot(_ctx.$slots, "range-separator"),
createBaseVNode("input", mergeProps(unref(attrs), {
id: _ctx.id && _ctx.id[1],
ref_key: "endInputRef",
ref: endInputRef,
name: _ctx.name && _ctx.name[1],
placeholder: _ctx.endPlaceholder,
value: _ctx.modelValue && _ctx.modelValue[1],
class: unref(nsRange).b("input"),
disabled: _ctx.disabled,
onInput: handleEndInput,
onChange: handleEndChange
}), null, 16, _hoisted_210),
renderSlot(_ctx.$slots, "suffix")
],
38
/* CLASS, STYLE, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/time-picker/src/common/picker.vue2.mjs
var _sfc_main63 = defineComponent({
...{
name: "Picker"
},
__name: "picker",
props: timePickerDefaultProps,
emits: [
UPDATE_MODEL_EVENT,
CHANGE_EVENT,
"focus",
"blur",
"clear",
"calendar-change",
"panel-change",
"visible-change",
"keydown"
],
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const attrs = useAttrs();
const nsDate = useNamespace("date");
const nsInput = useNamespace("input");
const nsRange = useNamespace("range");
const { formItem } = useFormItem();
const elPopperOptions = inject(
PICKER_POPPER_OPTIONS_INJECTION_KEY,
{}
);
const emptyValues = useEmptyValues(props2, null);
const refPopper = ref();
const inputRef = ref();
const valueOnOpen = ref(null);
let hasJustTabExitedInput = false;
const pickerDisabled = useFormDisabled();
const commonPicker = useCommonPicker(props2, emit);
const {
parsedValue,
pickerActualVisible,
userInput,
pickerVisible,
pickerOptions,
valueIsEmpty,
emitInput,
onPick,
onSetPickerOption,
onCalendarChange,
onPanelChange
} = commonPicker;
const { isFocused, handleFocus, handleBlur } = useFocusController(inputRef, {
disabled: pickerDisabled,
beforeFocus() {
return props2.readonly;
},
afterFocus() {
if (!props2.automaticDropdown) return;
pickerVisible.value = true;
},
beforeBlur(event) {
var _a;
return !hasJustTabExitedInput && ((_a = refPopper.value) == null ? void 0 : _a.isFocusInsideContent(event));
},
afterBlur() {
handleChange();
pickerVisible.value = false;
hasJustTabExitedInput = false;
props2.validateEvent && (formItem == null ? void 0 : formItem.validate("blur").catch((err) => debugWarn(err)));
}
});
const hovering = ref(false);
const rangeInputKls = computed(() => [
nsDate.b("editor"),
nsDate.bm("editor", props2.type),
nsInput.e("wrapper"),
nsDate.is("disabled", pickerDisabled.value),
nsDate.is("active", pickerVisible.value),
nsRange.b("editor"),
pickerSize ? nsRange.bm("editor", pickerSize.value) : "",
attrs.class
]);
const clearIconKls = computed(() => [
nsInput.e("icon"),
nsRange.e("close-icon"),
!showClearBtn.value ? nsRange.em("close-icon", "hidden") : ""
]);
watch(pickerVisible, (val) => {
if (!val) {
userInput.value = null;
nextTick(() => {
emitChange(props2.modelValue);
});
} else {
nextTick(() => {
if (val) {
valueOnOpen.value = props2.modelValue;
}
});
}
});
const emitChange = (val, isClear) => {
if (isClear || !valueEquals(val, valueOnOpen.value)) {
emit(CHANGE_EVENT, val);
isClear && (valueOnOpen.value = val);
props2.validateEvent && (formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err)));
}
};
const emitKeydown = (e) => {
emit("keydown", e);
};
const refInput = computed(() => {
if (inputRef.value) {
return Array.from(
inputRef.value.$el.querySelectorAll("input")
);
}
return [];
});
const setSelectionRange = (start, end, pos) => {
const _inputs = refInput.value;
if (!_inputs.length) return;
if (!pos || pos === "min") {
_inputs[0].setSelectionRange(start, end);
_inputs[0].focus();
} else if (pos === "max") {
_inputs[1].setSelectionRange(start, end);
_inputs[1].focus();
}
};
const onBeforeShow = () => {
pickerActualVisible.value = true;
};
const onShow = () => {
emit("visible-change", true);
};
const onHide = () => {
pickerActualVisible.value = false;
pickerVisible.value = false;
emit("visible-change", false);
};
const handleOpen = () => {
pickerVisible.value = true;
};
const handleClose = () => {
pickerVisible.value = false;
};
const displayValue = computed(() => {
const formattedValue = formatToString(parsedValue.value);
if (isArray(userInput.value)) {
return [
userInput.value[0] || formattedValue && formattedValue[0] || "",
userInput.value[1] || formattedValue && formattedValue[1] || ""
];
} else if (userInput.value !== null) {
return userInput.value;
}
if (!isTimePicker.value && valueIsEmpty.value) return "";
if (!pickerVisible.value && valueIsEmpty.value) return "";
if (formattedValue) {
return isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value ? formattedValue.join(", ") : formattedValue;
}
return "";
});
const isTimeLikePicker = computed(() => props2.type.includes("time"));
const isTimePicker = computed(() => props2.type.startsWith("time"));
const isDatesPicker = computed(() => props2.type === "dates");
const isMonthsPicker = computed(() => props2.type === "months");
const isYearsPicker = computed(() => props2.type === "years");
const triggerIcon = computed(
() => props2.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default)
);
const showClearBtn = computed(
() => props2.clearable && !pickerDisabled.value && !props2.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value)
);
const onClear = (event) => {
if (props2.readonly || pickerDisabled.value) return;
if (showClearBtn.value) {
event == null ? void 0 : event.stopPropagation();
if (pickerOptions.value.handleClear) {
pickerOptions.value.handleClear();
} else {
emitInput(emptyValues.valueOnClear.value);
}
emitChange(emptyValues.valueOnClear.value, true);
onHide();
}
emit("clear");
};
const onMouseDownInput = async (event) => {
var _a;
if (props2.readonly || pickerDisabled.value) return;
if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || isFocused.value || !props2.automaticDropdown) {
pickerVisible.value = true;
}
};
const onMouseEnter = () => {
if (props2.readonly || pickerDisabled.value) return;
if (!valueIsEmpty.value && props2.clearable) {
hovering.value = true;
}
};
const onMouseLeave = () => {
hovering.value = false;
};
const onTouchStartInput = (event) => {
var _a;
if (props2.readonly || pickerDisabled.value) return;
if (((_a = event.touches[0].target) == null ? void 0 : _a.tagName) !== "INPUT" || isFocused.value || !props2.automaticDropdown) {
pickerVisible.value = true;
}
};
const isRangeInput = computed(() => {
return props2.type.includes("range");
});
const pickerSize = useFormSize();
const popperEl = computed(() => {
var _a, _b;
return (_b = (_a = unref(refPopper)) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
});
const stophandle = onClickOutside(
inputRef,
(e) => {
const unrefedPopperEl = unref(popperEl);
const inputEl = unrefElement(inputRef);
if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl))
return;
pickerVisible.value = false;
}
);
onBeforeUnmount(() => {
stophandle == null ? void 0 : stophandle();
});
const handleChange = () => {
if (userInput.value) {
const value = parseUserInputToDayjs(displayValue.value);
if (value) {
if (isValidValue3(value)) {
emitInput(dayOrDaysToDate(value));
}
userInput.value = null;
}
}
if (userInput.value === "") {
emitInput(emptyValues.valueOnClear.value);
emitChange(emptyValues.valueOnClear.value, true);
userInput.value = null;
}
};
const parseUserInputToDayjs = (value) => {
if (!value) return null;
return pickerOptions.value.parseUserInput(value);
};
const formatToString = (value) => {
if (!value) return null;
const res = isArray(value) ? value.map((_2) => _2.format(props2.format)) : value.format(props2.format);
return res;
};
const isValidValue3 = (value) => {
return pickerOptions.value.isValidValue(value);
};
const handleKeydownInput = async (event) => {
if (props2.readonly || pickerDisabled.value) return;
const code = getEventCode(event);
emitKeydown(event);
if (code === EVENT_CODE.esc) {
if (pickerVisible.value === true) {
pickerVisible.value = false;
event.preventDefault();
event.stopPropagation();
}
return;
}
if (code === EVENT_CODE.down) {
if (pickerOptions.value.handleFocusPicker) {
event.preventDefault();
event.stopPropagation();
}
if (pickerVisible.value === false) {
pickerVisible.value = true;
await nextTick();
}
if (pickerOptions.value.handleFocusPicker) {
pickerOptions.value.handleFocusPicker();
return;
}
}
if (code === EVENT_CODE.tab) {
hasJustTabExitedInput = true;
return;
}
if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) {
if (!pickerVisible.value) {
pickerVisible.value = true;
} else if (userInput.value === null || userInput.value === "" || isValidValue3(parseUserInputToDayjs(displayValue.value))) {
handleChange();
pickerVisible.value = false;
}
event.preventDefault();
event.stopPropagation();
return;
}
if (userInput.value) {
event.stopPropagation();
return;
}
if (pickerOptions.value.handleKeydownInput) {
pickerOptions.value.handleKeydownInput(event);
}
};
const onUserInput = (e) => {
userInput.value = e;
if (!pickerVisible.value) {
pickerVisible.value = true;
}
};
const handleStartInput = (event) => {
const target2 = event.target;
if (userInput.value) {
userInput.value = [target2.value, userInput.value[1]];
} else {
userInput.value = [target2.value, null];
}
};
const handleEndInput = (event) => {
const target2 = event.target;
if (userInput.value) {
userInput.value = [userInput.value[0], target2.value];
} else {
userInput.value = [null, target2.value];
}
};
const handleStartChange = () => {
var _a;
const values = userInput.value;
const value = parseUserInputToDayjs(values && values[0]);
const parsedVal = unref(parsedValue);
if (value && value.isValid()) {
userInput.value = [
formatToString(value),
((_a = displayValue.value) == null ? void 0 : _a[1]) || null
];
const newValue = [value, parsedVal && (parsedVal[1] || null)];
if (isValidValue3(newValue)) {
emitInput(dayOrDaysToDate(newValue));
userInput.value = null;
}
}
};
const handleEndChange = () => {
var _a;
const values = unref(userInput);
const value = parseUserInputToDayjs(values && values[1]);
const parsedVal = unref(parsedValue);
if (value && value.isValid()) {
userInput.value = [
((_a = unref(displayValue)) == null ? void 0 : _a[0]) || null,
formatToString(value)
];
const newValue = [parsedVal && parsedVal[0], value];
if (isValidValue3(newValue)) {
emitInput(dayOrDaysToDate(newValue));
userInput.value = null;
}
}
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
provide(PICKER_BASE_INJECTION_KEY, {
props: props2,
emptyValues
});
provide(ROOT_COMMON_PICKER_INJECTION_KEY, commonPicker);
__expose({
/**
* @description focus input box.
*/
focus,
/**
* @description blur input box.
*/
blur,
/**
* @description opens picker
*/
handleOpen,
/**
* @description closes picker
*/
handleClose,
/**
* @description pick item manually
*/
onPick
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
ref_key: "refPopper",
ref: refPopper,
visible: unref(pickerVisible),
effect: "light",
pure: "",
trigger: "click"
}, _ctx.$attrs, {
role: "dialog",
teleported: "",
transition: `${unref(nsDate).namespace.value}-zoom-in-top`,
"popper-class": [`${unref(nsDate).namespace.value}-picker__popper`, _ctx.popperClass],
"popper-style": _ctx.popperStyle,
"popper-options": unref(elPopperOptions),
"fallback-placements": _ctx.fallbackPlacements,
"gpu-acceleration": false,
placement: _ctx.placement,
"stop-popper-mouse-event": false,
"hide-after": 0,
persistent: "",
onBeforeShow,
onShow,
onHide
}), {
default: withCtx(() => [
!isRangeInput.value ? (openBlock(), createBlock(unref(ElInput), {
key: 0,
id: (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.id
),
ref_key: "inputRef",
ref: inputRef,
"container-role": "combobox",
"model-value": (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
displayValue.value
),
name: (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.name
),
size: unref(pickerSize),
disabled: unref(pickerDisabled),
placeholder: _ctx.placeholder,
class: normalizeClass([
unref(nsDate).b("editor"),
unref(nsDate).bm("editor", _ctx.type),
unref(nsDate).is("focus", unref(pickerVisible)),
_ctx.$attrs.class
]),
style: normalizeStyle(_ctx.$attrs.style),
readonly: !_ctx.editable || _ctx.readonly || isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value || _ctx.type === "week",
"aria-label": _ctx.ariaLabel,
tabindex: _ctx.tabindex,
"validate-event": false,
onInput: onUserInput,
onFocus: unref(handleFocus),
onBlur: unref(handleBlur),
onKeydown: handleKeydownInput,
onChange: handleChange,
onMousedown: onMouseDownInput,
onMouseenter: onMouseEnter,
onMouseleave: onMouseLeave,
onTouchstartPassive: onTouchStartInput,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
}, {
prefix: withCtx(() => [
triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(nsInput).e("icon")),
onMousedown: withModifiers(onMouseDownInput, ["prevent"]),
onTouchstartPassive: onTouchStartInput
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
]),
suffix: withCtx(() => [
showClearBtn.value && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(`${unref(nsInput).e("icon")} clear-icon`),
onMousedown: withModifiers(unref(NOOP), ["prevent"]),
onClick: onClear
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
}, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur"])) : (openBlock(), createBlock(_sfc_main62, {
key: 1,
id: (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.id
),
ref_key: "inputRef",
ref: inputRef,
"model-value": displayValue.value,
name: (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.name
),
disabled: unref(pickerDisabled),
readonly: !_ctx.editable || _ctx.readonly,
"start-placeholder": _ctx.startPlaceholder,
"end-placeholder": _ctx.endPlaceholder,
class: normalizeClass(rangeInputKls.value),
style: normalizeStyle(_ctx.$attrs.style),
"aria-label": _ctx.ariaLabel,
tabindex: _ctx.tabindex,
autocomplete: "off",
role: "combobox",
onClick: onMouseDownInput,
onFocus: unref(handleFocus),
onBlur: unref(handleBlur),
onStartInput: handleStartInput,
onStartChange: handleStartChange,
onEndInput: handleEndInput,
onEndChange: handleEndChange,
onMousedown: onMouseDownInput,
onMouseenter: onMouseEnter,
onMouseleave: onMouseLeave,
onTouchstartPassive: onTouchStartInput,
onKeydown: handleKeydownInput
}, {
prefix: withCtx(() => [
triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([unref(nsInput).e("icon"), unref(nsRange).e("icon")])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
]),
"range-separator": withCtx(() => [
renderSlot(_ctx.$slots, "range-separator", {}, () => [
createBaseVNode(
"span",
{
class: normalizeClass(unref(nsRange).b("separator"))
},
toDisplayString(_ctx.rangeSeparator),
3
/* TEXT, CLASS */
)
])
]),
suffix: withCtx(() => [
_ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(clearIconKls.value),
onMousedown: withModifiers(unref(NOOP), ["prevent"]),
onClick: onClear
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["id", "model-value", "name", "disabled", "readonly", "start-placeholder", "end-placeholder", "class", "style", "aria-label", "tabindex", "onFocus", "onBlur"]))
]),
content: withCtx(() => [
renderSlot(_ctx.$slots, "default", {
visible: unref(pickerVisible),
actualVisible: unref(pickerActualVisible),
parsedValue: unref(parsedValue),
format: _ctx.format,
dateFormat: _ctx.dateFormat,
timeFormat: _ctx.timeFormat,
unlinkPanels: _ctx.unlinkPanels,
type: _ctx.type,
defaultValue: _ctx.defaultValue,
showNow: _ctx.showNow,
showConfirm: _ctx.showConfirm,
showFooter: _ctx.showFooter,
showWeekNumber: _ctx.showWeekNumber,
onPick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(onPick) && unref(onPick)(...args)),
onSelectRange: setSelectionRange,
onSetPickerOption: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(onSetPickerOption) && unref(onSetPickerOption)(...args)),
onCalendarChange: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(onCalendarChange) && unref(onCalendarChange)(...args)),
onClear,
onPanelChange: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(onPanelChange) && unref(onPanelChange)(...args)),
onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {
}, ["stop"]))
})
]),
_: 3
/* FORWARDED */
}, 16, ["visible", "transition", "popper-class", "popper-style", "popper-options", "fallback-placements", "placement"]);
};
}
});
// node_modules/element-plus/es/components/time-picker/src/time-picker-com/panel-time-pick.vue2.mjs
var import_dayjs5 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/time-picker/src/props/panel-time-picker.mjs
var panelTimePickerProps = buildProps({
...timePanelSharedProps,
datetimeRole: String,
parsedValue: {
type: definePropType(Object)
}
});
// node_modules/element-plus/es/components/time-picker/src/composables/use-time-panel.mjs
var useTimePanel = ({
getAvailableHours,
getAvailableMinutes,
getAvailableSeconds
}) => {
const getAvailableTime = (date, role, first, compareDate) => {
const availableTimeGetters = {
hour: getAvailableHours,
minute: getAvailableMinutes,
second: getAvailableSeconds
};
let result = date;
["hour", "minute", "second"].forEach((type) => {
if (availableTimeGetters[type]) {
let availableTimeSlots;
const method = availableTimeGetters[type];
switch (type) {
case "minute": {
availableTimeSlots = method(
result.hour(),
role,
compareDate
);
break;
}
case "second": {
availableTimeSlots = method(
result.hour(),
result.minute(),
role,
compareDate
);
break;
}
default: {
availableTimeSlots = method(
role,
compareDate
);
break;
}
}
if ((availableTimeSlots == null ? void 0 : availableTimeSlots.length) && !availableTimeSlots.includes(result[type]())) {
const pos = first ? 0 : availableTimeSlots.length - 1;
result = result[type](availableTimeSlots[pos]);
}
}
});
return result;
};
const timePickerOptions = {};
const onSetOption = ([key, val]) => {
timePickerOptions[key] = val;
};
return {
timePickerOptions,
getAvailableTime,
onSetOption
};
};
// node_modules/element-plus/es/components/time-picker/src/composables/use-time-picker.mjs
var makeAvailableArr = (disabledList) => {
const trueOrNumber = (isDisabled, index) => isDisabled || index;
const getNumber = (predicate) => predicate !== true;
return disabledList.map(trueOrNumber).filter(getNumber);
};
var getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
const getHoursList = (role, compare) => {
return makeList(24, disabledHours && (() => disabledHours == null ? void 0 : disabledHours(role, compare)));
};
const getMinutesList = (hour, role, compare) => {
return makeList(
60,
disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare))
);
};
const getSecondsList = (hour, minute, role, compare) => {
return makeList(
60,
disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare))
);
};
return {
getHoursList,
getMinutesList,
getSecondsList
};
};
var buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(
disabledHours,
disabledMinutes,
disabledSeconds
);
const getAvailableHours = (role, compare) => {
return makeAvailableArr(getHoursList(role, compare));
};
const getAvailableMinutes = (hour, role, compare) => {
return makeAvailableArr(getMinutesList(hour, role, compare));
};
const getAvailableSeconds = (hour, minute, role, compare) => {
return makeAvailableArr(getSecondsList(hour, minute, role, compare));
};
return {
getAvailableHours,
getAvailableMinutes,
getAvailableSeconds
};
};
var useOldValue = (props2) => {
const oldValue = ref(props2.parsedValue);
watch(
() => props2.visible,
(val) => {
if (!val) {
oldValue.value = props2.parsedValue;
}
}
);
return oldValue;
};
// node_modules/element-plus/es/components/time-picker/src/props/basic-time-spinner.mjs
var basicTimeSpinnerProps = buildProps({
role: {
type: String,
required: true
},
spinnerDate: {
type: definePropType(Object),
required: true
},
showSeconds: {
type: Boolean,
default: true
},
arrowControl: Boolean,
amPmMode: {
// 'a': am/pm; 'A': AM/PM
type: definePropType(String),
default: ""
},
...disabledTimeListsProps
});
// node_modules/element-plus/es/directives/repeat-click/index.mjs
var REPEAT_INTERVAL = 100;
var REPEAT_DELAY = 600;
var SCOPE5 = "_RepeatClick";
var vRepeatClick = {
beforeMount(el, binding) {
const value = binding.value;
const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction(
value
) ? {} : value;
let intervalId;
let delayId;
const handler = () => isFunction(value) ? value() : value.handler();
const clear = () => {
if (delayId) {
clearTimeout(delayId);
delayId = void 0;
}
if (intervalId) {
clearInterval(intervalId);
intervalId = void 0;
}
};
const start = (evt) => {
if (evt.button !== 0) return;
clear();
handler();
document.addEventListener("mouseup", clear, { once: true });
delayId = setTimeout(() => {
intervalId = setInterval(() => {
handler();
}, interval);
}, delay);
};
el[SCOPE5] = { start, clear };
el.addEventListener("mousedown", start);
},
unmounted(el) {
if (!el[SCOPE5]) return;
const { start, clear } = el[SCOPE5];
if (start) {
el.removeEventListener("mousedown", start);
}
if (clear) {
clear();
document.removeEventListener("mouseup", clear);
}
el[SCOPE5] = null;
}
};
// node_modules/element-plus/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue2.mjs
var _hoisted_126 = ["onClick"];
var _hoisted_211 = ["onMouseenter"];
var _sfc_main64 = defineComponent({
__name: "basic-time-spinner",
props: basicTimeSpinnerProps,
emits: [CHANGE_EVENT, "select-range", "set-option"],
setup(__props, { emit: __emit }) {
const props2 = __props;
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const { isRange, format } = pickerBase.props;
const emit = __emit;
const ns = useNamespace("time");
const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(
props2.disabledHours,
props2.disabledMinutes,
props2.disabledSeconds
);
let isScrolling = false;
const currentScrollbar = ref();
const listHoursRef = ref();
const listMinutesRef = ref();
const listSecondsRef = ref();
const listRefsMap = {
hours: listHoursRef,
minutes: listMinutesRef,
seconds: listSecondsRef
};
const spinnerItems = computed(() => {
return props2.showSeconds ? timeUnits : timeUnits.slice(0, 2);
});
const timePartials = computed(() => {
const { spinnerDate } = props2;
const hours = spinnerDate.hour();
const minutes = spinnerDate.minute();
const seconds = spinnerDate.second();
return { hours, minutes, seconds };
});
const timeList = computed(() => {
const { hours, minutes } = unref(timePartials);
const { role, spinnerDate } = props2;
const compare = !isRange ? spinnerDate : void 0;
return {
hours: getHoursList(role, compare),
minutes: getMinutesList(hours, role, compare),
seconds: getSecondsList(hours, minutes, role, compare)
};
});
const arrowControlTimeList = computed(() => {
const { hours, minutes, seconds } = unref(timePartials);
return {
hours: buildTimeList(hours, 23),
minutes: buildTimeList(minutes, 59),
seconds: buildTimeList(seconds, 59)
};
});
const debouncedResetScroll = debounce_default((type) => {
isScrolling = false;
adjustCurrentSpinner(type);
}, 200);
const getAmPmFlag = (hour) => {
const shouldShowAmPm = !!props2.amPmMode;
if (!shouldShowAmPm) return "";
const isCapital = props2.amPmMode === "A";
let content = hour < 12 ? " am" : " pm";
if (isCapital) content = content.toUpperCase();
return content;
};
const emitSelectRange = (type) => {
let range = [0, 0];
const actualFormat = format || DEFAULT_FORMATS_TIME;
const hourIndex = actualFormat.indexOf("HH");
const minuteIndex = actualFormat.indexOf("mm");
const secondIndex = actualFormat.indexOf("ss");
switch (type) {
case "hours":
if (hourIndex !== -1) {
range = [hourIndex, hourIndex + 2];
}
break;
case "minutes":
if (minuteIndex !== -1) {
range = [minuteIndex, minuteIndex + 2];
}
break;
case "seconds":
if (secondIndex !== -1) {
range = [secondIndex, secondIndex + 2];
}
break;
}
const [left, right] = range;
emit("select-range", left, right);
currentScrollbar.value = type;
};
const adjustCurrentSpinner = (type) => {
adjustSpinner(type, unref(timePartials)[type]);
};
const adjustSpinners = () => {
adjustCurrentSpinner("hours");
adjustCurrentSpinner("minutes");
adjustCurrentSpinner("seconds");
};
const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
const adjustSpinner = (type, value) => {
if (props2.arrowControl) return;
const scrollbar = unref(listRefsMap[type]);
if (scrollbar && scrollbar.$el) {
getScrollbarElement(scrollbar.$el).scrollTop = Math.max(
0,
value * typeItemHeight(type)
);
}
};
const typeItemHeight = (type) => {
const scrollbar = unref(listRefsMap[type]);
const listItem = scrollbar == null ? void 0 : scrollbar.$el.querySelector("li");
if (listItem) {
return Number.parseFloat(getStyle(listItem, "height")) || 0;
}
return 0;
};
const onIncrement = () => {
scrollDown(1);
};
const onDecrement = () => {
scrollDown(-1);
};
const scrollDown = (step2) => {
if (!currentScrollbar.value) {
emitSelectRange("hours");
}
const label = currentScrollbar.value;
const now = unref(timePartials)[label];
const total2 = currentScrollbar.value === "hours" ? 24 : 60;
const next = findNextUnDisabled(label, now, step2, total2);
modifyDateField(label, next);
adjustSpinner(label, next);
nextTick(() => emitSelectRange(label));
};
const findNextUnDisabled = (type, now, step2, total2) => {
let next = (now + step2 + total2) % total2;
const list = unref(timeList)[type];
while (list[next] && next !== now) {
next = (next + step2 + total2) % total2;
}
return next;
};
const modifyDateField = (type, value) => {
const list = unref(timeList)[type];
const isDisabled = list[value];
if (isDisabled) return;
const { hours, minutes, seconds } = unref(timePartials);
let changeTo;
switch (type) {
case "hours":
changeTo = props2.spinnerDate.hour(value).minute(minutes).second(seconds);
break;
case "minutes":
changeTo = props2.spinnerDate.hour(hours).minute(value).second(seconds);
break;
case "seconds":
changeTo = props2.spinnerDate.hour(hours).minute(minutes).second(value);
break;
}
emit(CHANGE_EVENT, changeTo);
};
const handleClick = (type, { value, disabled }) => {
if (!disabled) {
modifyDateField(type, value);
emitSelectRange(type);
adjustSpinner(type, value);
}
};
const handleScroll2 = (type) => {
const scrollbar = unref(listRefsMap[type]);
if (!scrollbar) return;
isScrolling = true;
debouncedResetScroll(type);
const value = Math.min(
Math.round(
(getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)
),
type === "hours" ? 23 : 59
);
modifyDateField(type, value);
};
const scrollBarHeight = (type) => {
return unref(listRefsMap[type]).$el.offsetHeight;
};
const bindScrollEvent = () => {
const bindFunction = (type) => {
const scrollbar = unref(listRefsMap[type]);
if (scrollbar && scrollbar.$el) {
getScrollbarElement(scrollbar.$el).onscroll = () => {
handleScroll2(type);
};
}
};
bindFunction("hours");
bindFunction("minutes");
bindFunction("seconds");
};
onMounted(() => {
nextTick(() => {
!props2.arrowControl && bindScrollEvent();
adjustSpinners();
if (props2.role === "start") emitSelectRange("hours");
});
});
const setRef = (scrollbar, type) => {
listRefsMap[type].value = scrollbar != null ? scrollbar : void 0;
};
emit("set-option", [`${props2.role}_scrollDown`, scrollDown]);
emit("set-option", [`${props2.role}_emitSelectRange`, emitSelectRange]);
watch(
() => props2.spinnerDate,
() => {
if (isScrolling) return;
adjustSpinners();
}
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }])
},
[
!_ctx.arrowControl ? (openBlock(true), createElementBlock(
Fragment,
{ key: 0 },
renderList(spinnerItems.value, (item) => {
return openBlock(), createBlock(unref(ElScrollbar), {
key: item,
ref_for: true,
ref: (scrollbar) => setRef(scrollbar, item),
class: normalizeClass(unref(ns).be("spinner", "wrapper")),
"wrap-style": "max-height: inherit;",
"view-class": unref(ns).be("spinner", "list"),
noresize: "",
tag: "ul",
onMouseenter: ($event) => emitSelectRange(item),
onMousemove: ($event) => adjustCurrentSpinner(item)
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(timeList.value[item], (disabled, key) => {
return openBlock(), createElementBlock("li", {
key,
class: normalizeClass([
unref(ns).be("spinner", "item"),
unref(ns).is("active", key === timePartials.value[item]),
unref(ns).is("disabled", disabled)
]),
onClick: ($event) => handleClick(item, { value: key, disabled })
}, [
item === "hours" ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createTextVNode(
toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
createTextVNode(
toDisplayString(("0" + key).slice(-2)),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
))
], 10, _hoisted_126);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 2
/* DYNAMIC */
}, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]);
}),
128
/* KEYED_FRAGMENT */
)) : createCommentVNode("v-if", true),
_ctx.arrowControl ? (openBlock(true), createElementBlock(
Fragment,
{ key: 1 },
renderList(spinnerItems.value, (item) => {
return openBlock(), createElementBlock("div", {
key: item,
class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]),
onMouseenter: ($event) => emitSelectRange(item)
}, [
withDirectives((openBlock(), createBlock(unref(ElIcon), {
class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")])
}, {
default: withCtx(() => [
createVNode(unref(arrow_up_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])), [
[unref(vRepeatClick), onDecrement]
]),
withDirectives((openBlock(), createBlock(unref(ElIcon), {
class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")])
}, {
default: withCtx(() => [
createVNode(unref(arrow_down_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])), [
[unref(vRepeatClick), onIncrement]
]),
createBaseVNode(
"ul",
{
class: normalizeClass(unref(ns).be("spinner", "list"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(arrowControlTimeList.value[item], (time, key) => {
return openBlock(), createElementBlock(
"li",
{
key,
class: normalizeClass([
unref(ns).be("spinner", "item"),
unref(ns).is("active", time === timePartials.value[item]),
unref(ns).is("disabled", timeList.value[item][time])
])
},
[
unref(isNumber)(time) ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
item === "hours" ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createTextVNode(
toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + toDisplayString(getAmPmFlag(time)),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
createTextVNode(
toDisplayString(("0" + time).slice(-2)),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
))
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
], 42, _hoisted_211);
}),
128
/* KEYED_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/time-picker/src/time-picker-com/panel-time-pick.vue2.mjs
var _sfc_main65 = defineComponent({
__name: "panel-time-pick",
props: panelTimePickerProps,
emits: ["pick", "select-range", "set-picker-option"],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const {
arrowControl,
disabledHours,
disabledMinutes,
disabledSeconds,
defaultValue
} = pickerBase.props;
const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds);
const ns = useNamespace("time");
const { t, lang } = useLocale();
const selectionRange = ref([0, 2]);
const oldValue = useOldValue(props2);
const transitionName = computed(() => {
return isUndefined(props2.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : "";
});
const showSeconds = computed(() => {
return props2.format.includes("ss");
});
const amPmMode = computed(() => {
if (props2.format.includes("A")) return "A";
if (props2.format.includes("a")) return "a";
return "";
});
const isValidValue3 = (_date) => {
const parsedDate = (0, import_dayjs5.default)(_date).locale(lang.value);
const result = getRangeAvailableTime(parsedDate);
return parsedDate.isSame(result);
};
const handleCancel = () => {
const old = oldValue.value;
emit("pick", old, false);
nextTick(() => {
oldValue.value = old;
});
};
const handleConfirm = (visible = false, first = false) => {
if (first) return;
emit("pick", props2.parsedValue, visible);
};
const handleChange = (_date) => {
if (!props2.visible) {
return;
}
const result = getRangeAvailableTime(_date).millisecond(0);
emit("pick", result, true);
};
const setSelectionRange = (start, end) => {
emit("select-range", start, end);
selectionRange.value = [start, end];
};
const changeSelectionRange = (step2) => {
const actualFormat = props2.format;
const hourIndex = actualFormat.indexOf("HH");
const minuteIndex = actualFormat.indexOf("mm");
const secondIndex = actualFormat.indexOf("ss");
const list = [];
const mapping = [];
if (hourIndex !== -1) {
list.push(hourIndex);
mapping.push("hours");
}
if (minuteIndex !== -1) {
list.push(minuteIndex);
mapping.push("minutes");
}
if (secondIndex !== -1 && showSeconds.value) {
list.push(secondIndex);
mapping.push("seconds");
}
const index = list.indexOf(selectionRange.value[0]);
const next = (index + step2 + list.length) % list.length;
timePickerOptions["start_emitSelectRange"](mapping[next]);
};
const handleKeydown = (event) => {
const code = getEventCode(event);
const { left, right, up, down } = EVENT_CODE;
if ([left, right].includes(code)) {
const step2 = code === left ? -1 : 1;
changeSelectionRange(step2);
event.preventDefault();
return;
}
if ([up, down].includes(code)) {
const step2 = code === up ? -1 : 1;
timePickerOptions["start_scrollDown"](step2);
event.preventDefault();
return;
}
};
const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({
getAvailableHours,
getAvailableMinutes,
getAvailableSeconds
});
const getRangeAvailableTime = (date) => {
return getAvailableTime(date, props2.datetimeRole || "", true);
};
const parseUserInput = (value) => {
if (!value) return null;
return (0, import_dayjs5.default)(value, props2.format).locale(lang.value);
};
const getDefaultValue2 = () => {
return (0, import_dayjs5.default)(defaultValue).locale(lang.value);
};
emit("set-picker-option", ["isValidValue", isValidValue3]);
emit("set-picker-option", ["parseUserInput", parseUserInput]);
emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
emit("set-picker-option", ["getDefaultValue", getDefaultValue2]);
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, { name: transitionName.value }, {
default: withCtx(() => [
_ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).b("panel"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": showSeconds.value }])
},
[
createVNode(_sfc_main64, {
ref: "spinner",
role: _ctx.datetimeRole || "start",
"arrow-control": unref(arrowControl),
"show-seconds": showSeconds.value,
"am-pm-mode": amPmMode.value,
"spinner-date": (
// https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
_ctx.parsedValue
),
"disabled-hours": unref(disabledHours),
"disabled-minutes": unref(disabledMinutes),
"disabled-seconds": unref(disabledSeconds),
onChange: handleChange,
onSetOption: unref(onSetOption),
onSelectRange: setSelectionRange
}, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).be("panel", "footer"))
},
[
createBaseVNode(
"button",
{
type: "button",
class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]),
onClick: handleCancel
},
toDisplayString(unref(t)("el.datepicker.cancel")),
3
/* TEXT, CLASS */
),
createBaseVNode(
"button",
{
type: "button",
class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]),
onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm())
},
toDisplayString(unref(t)("el.datepicker.confirm")),
3
/* TEXT, CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
}, 8, ["name"]);
};
}
});
// node_modules/element-plus/es/components/time-picker/src/time-picker-com/panel-time-range.vue2.mjs
var import_dayjs6 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/time-picker/src/props/panel-time-range.mjs
var panelTimeRangeProps = buildProps({
...timePanelSharedProps,
parsedValue: {
type: definePropType(Array)
}
});
// node_modules/element-plus/es/components/time-picker/src/time-picker-com/panel-time-range.vue2.mjs
var _hoisted_127 = ["disabled"];
var _sfc_main66 = defineComponent({
__name: "panel-time-range",
props: panelTimeRangeProps,
emits: ["pick", "select-range", "set-picker-option"],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const makeSelectRange = (start, end) => {
const result = [];
for (let i = start; i <= end; i++) {
result.push(i);
}
return result;
};
const { t, lang } = useLocale();
const nsTime = useNamespace("time");
const nsPicker = useNamespace("picker");
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const {
arrowControl,
disabledHours,
disabledMinutes,
disabledSeconds,
defaultValue
} = pickerBase.props;
const startContainerKls = computed(() => [
nsTime.be("range-picker", "body"),
nsTime.be("panel", "content"),
nsTime.is("arrow", arrowControl),
showSeconds.value ? "has-seconds" : ""
]);
const endContainerKls = computed(() => [
nsTime.be("range-picker", "body"),
nsTime.be("panel", "content"),
nsTime.is("arrow", arrowControl),
showSeconds.value ? "has-seconds" : ""
]);
const startTime = computed(() => props2.parsedValue[0]);
const endTime = computed(() => props2.parsedValue[1]);
const oldValue = useOldValue(props2);
const handleCancel = () => {
const old = oldValue.value;
emit("pick", old, false);
nextTick(() => {
oldValue.value = old;
});
};
const showSeconds = computed(() => {
return props2.format.includes("ss");
});
const amPmMode = computed(() => {
if (props2.format.includes("A")) return "A";
if (props2.format.includes("a")) return "a";
return "";
});
const handleConfirm = (visible = false) => {
emit("pick", [startTime.value, endTime.value], visible);
};
const handleMinChange = (date) => {
handleChange(date.millisecond(0), endTime.value);
};
const handleMaxChange = (date) => {
handleChange(startTime.value, date.millisecond(0));
};
const isValidValue3 = (_date) => {
const parsedDate = _date.map((_2) => (0, import_dayjs6.default)(_2).locale(lang.value));
const result = getRangeAvailableTime(parsedDate);
return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]);
};
const handleChange = (start, end) => {
if (!props2.visible) {
return;
}
emit("pick", [start, end], true);
};
const btnConfirmDisabled = computed(() => {
return startTime.value > endTime.value;
});
const selectionRange = ref([0, 2]);
const setMinSelectionRange = (start, end) => {
emit("select-range", start, end, "min");
selectionRange.value = [start, end];
};
const offset3 = computed(() => showSeconds.value ? 11 : 8);
const setMaxSelectionRange = (start, end) => {
emit("select-range", start, end, "max");
const _offset = unref(offset3);
selectionRange.value = [start + _offset, end + _offset];
};
const changeSelectionRange = (step2) => {
const list = showSeconds.value ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
const mapping = ["hours", "minutes"].concat(
showSeconds.value ? ["seconds"] : []
);
const index = list.indexOf(selectionRange.value[0]);
const next = (index + step2 + list.length) % list.length;
const half = list.length / 2;
if (next < half) {
timePickerOptions["start_emitSelectRange"](mapping[next]);
} else {
timePickerOptions["end_emitSelectRange"](mapping[next - half]);
}
};
const handleKeydown = (event) => {
const code = getEventCode(event);
const { left, right, up, down } = EVENT_CODE;
if ([left, right].includes(code)) {
const step2 = code === left ? -1 : 1;
changeSelectionRange(step2);
event.preventDefault();
return;
}
if ([up, down].includes(code)) {
const step2 = code === up ? -1 : 1;
const role = selectionRange.value[0] < offset3.value ? "start" : "end";
timePickerOptions[`${role}_scrollDown`](step2);
event.preventDefault();
return;
}
};
const disabledHours_ = (role, compare) => {
const defaultDisable = disabledHours ? disabledHours(role) : [];
const isStart = role === "start";
const compareDate = compare || (isStart ? endTime.value : startTime.value);
const compareHour = compareDate.hour();
const nextDisable = isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1);
return union_default(defaultDisable, nextDisable);
};
const disabledMinutes_ = (hour, role, compare) => {
const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : [];
const isStart = role === "start";
const compareDate = compare || (isStart ? endTime.value : startTime.value);
const compareHour = compareDate.hour();
if (hour !== compareHour) {
return defaultDisable;
}
const compareMinute = compareDate.minute();
const nextDisable = isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1);
return union_default(defaultDisable, nextDisable);
};
const disabledSeconds_ = (hour, minute, role, compare) => {
const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : [];
const isStart = role === "start";
const compareDate = compare || (isStart ? endTime.value : startTime.value);
const compareHour = compareDate.hour();
const compareMinute = compareDate.minute();
if (hour !== compareHour || minute !== compareMinute) {
return defaultDisable;
}
const compareSecond = compareDate.second();
const nextDisable = isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1);
return union_default(defaultDisable, nextDisable);
};
const getRangeAvailableTime = ([start, end]) => {
return [
getAvailableTime(start, "start", true, end),
getAvailableTime(end, "end", false, start)
];
};
const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(
disabledHours_,
disabledMinutes_,
disabledSeconds_
);
const {
timePickerOptions,
getAvailableTime,
onSetOption
} = useTimePanel({
getAvailableHours,
getAvailableMinutes,
getAvailableSeconds
});
const parseUserInput = (days) => {
if (!days) return null;
if (isArray(days)) {
return days.map((d2) => (0, import_dayjs6.default)(d2, props2.format).locale(lang.value));
}
return (0, import_dayjs6.default)(days, props2.format).locale(lang.value);
};
const getDefaultValue2 = () => {
if (isArray(defaultValue)) {
return defaultValue.map((d2) => (0, import_dayjs6.default)(d2).locale(lang.value));
}
const defaultDay = (0, import_dayjs6.default)(defaultValue).locale(lang.value);
return [defaultDay, defaultDay.add(60, "m")];
};
emit("set-picker-option", ["parseUserInput", parseUserInput]);
emit("set-picker-option", ["isValidValue", isValidValue3]);
emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
emit("set-picker-option", ["getDefaultValue", getDefaultValue2]);
emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
return (_ctx, _cache) => {
return _ctx.actualVisible ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass([unref(nsTime).b("range-picker"), unref(nsPicker).b("panel")])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("range-picker", "content"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("range-picker", "cell"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("range-picker", "header"))
},
toDisplayString(unref(t)("el.datepicker.startTime")),
3
/* TEXT, CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(startContainerKls.value)
},
[
createVNode(_sfc_main64, {
ref: "minSpinner",
role: "start",
"show-seconds": showSeconds.value,
"am-pm-mode": amPmMode.value,
"arrow-control": unref(arrowControl),
"spinner-date": startTime.value,
"disabled-hours": disabledHours_,
"disabled-minutes": disabledMinutes_,
"disabled-seconds": disabledSeconds_,
onChange: handleMinChange,
onSetOption: unref(onSetOption),
onSelectRange: setMinSelectionRange
}, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
],
2
/* CLASS */
)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("range-picker", "cell"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("range-picker", "header"))
},
toDisplayString(unref(t)("el.datepicker.endTime")),
3
/* TEXT, CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(endContainerKls.value)
},
[
createVNode(_sfc_main64, {
ref: "maxSpinner",
role: "end",
"show-seconds": showSeconds.value,
"am-pm-mode": amPmMode.value,
"arrow-control": unref(arrowControl),
"spinner-date": endTime.value,
"disabled-hours": disabledHours_,
"disabled-minutes": disabledMinutes_,
"disabled-seconds": disabledSeconds_,
onChange: handleMaxChange,
onSetOption: unref(onSetOption),
onSelectRange: setMaxSelectionRange
}, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsTime).be("panel", "footer"))
},
[
createBaseVNode(
"button",
{
type: "button",
class: normalizeClass([unref(nsTime).be("panel", "btn"), "cancel"]),
onClick: _cache[0] || (_cache[0] = ($event) => handleCancel())
},
toDisplayString(unref(t)("el.datepicker.cancel")),
3
/* TEXT, CLASS */
),
createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(nsTime).be("panel", "btn"), "confirm"]),
disabled: btnConfirmDisabled.value,
onClick: _cache[1] || (_cache[1] = ($event) => handleConfirm())
}, toDisplayString(unref(t)("el.datepicker.confirm")), 11, _hoisted_127)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true);
};
}
});
// node_modules/element-plus/es/components/time-picker/src/time-picker.mjs
import_dayjs7.default.extend(import_customParseFormat.default);
var TimePicker = defineComponent({
name: "ElTimePicker",
install: null,
props: {
...timePickerDefaultProps,
/**
* @description whether to pick a time range
*/
isRange: Boolean
},
emits: [UPDATE_MODEL_EVENT],
setup(props2, ctx) {
const commonPicker = ref();
const [type, Panel] = props2.isRange ? ["timerange", _sfc_main66] : ["time", _sfc_main65];
const modelUpdater = (value) => ctx.emit(UPDATE_MODEL_EVENT, value);
provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, props2.popperOptions);
ctx.expose({
/**
* @description focus the Input component
*/
focus: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.focus();
},
/**
* @description blur the Input component
*/
blur: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.blur();
},
/**
* @description open the TimePicker popper
*/
handleOpen: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.handleOpen();
},
/**
* @description close the TimePicker popper
*/
handleClose: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.handleClose();
}
});
return () => {
var _a;
const format = (_a = props2.format) != null ? _a : DEFAULT_FORMATS_TIME;
return createVNode(_sfc_main63, mergeProps(props2, {
"ref": commonPicker,
"type": type,
"format": format,
"onUpdate:modelValue": modelUpdater
}), {
default: (props22) => createVNode(Panel, props22, null)
});
};
}
});
// node_modules/element-plus/es/components/time-picker/index.mjs
var ElTimePicker = withInstall(TimePicker);
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-panel.mjs
var import_dayjs18 = __toESM(require_dayjs_min(), 1);
var import_customParseFormat2 = __toESM(require_customParseFormat(), 1);
var import_advancedFormat = __toESM(require_advancedFormat(), 1);
var import_localeData2 = __toESM(require_localeData(), 1);
var import_weekOfYear = __toESM(require_weekOfYear(), 1);
var import_weekYear = __toESM(require_weekYear(), 1);
var import_dayOfYear = __toESM(require_dayOfYear(), 1);
var import_isSameOrAfter = __toESM(require_isSameOrAfter(), 1);
var import_isSameOrBefore = __toESM(require_isSameOrBefore(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/date-picker-panel.mjs
var datePickerPanelProps = buildProps({
/**
* @description optional, format of binding value. If not specified, the binding value will be a Date object
*/
valueFormat: String,
/**
* @description optional, format of the date displayed in input's inner panel
*/
dateFormat: String,
/**
* @description optional, format of the time displayed in input's inner panel
*/
timeFormat: String,
/**
* @description whether picker is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description binding value, if it is an array, the length should be 2
*/
modelValue: {
type: definePropType([Date, Array, String, Number]),
default: ""
},
/**
* @description optional, default date of the calendar
*/
defaultValue: {
type: definePropType([Date, Array])
},
/**
* @description optional, the time value to use when selecting date range
*/
defaultTime: {
type: definePropType([Date, Array])
},
/**
* @description whether to pick a time range
*/
isRange: Boolean,
...disabledTimeListsProps,
/**
* @description a function determining if a date is disabled with that date as its parameter. Should return a Boolean
*/
disabledDate: {
type: Function
},
/**
* @description set custom className
*/
cellClassName: {
type: Function
},
/**
* @description an object array to set shortcut options
*/
shortcuts: {
type: Array,
default: () => []
},
/**
* @description whether to pick time using arrow buttons
*/
arrowControl: Boolean,
/**
* @description unlink two date-panels in range-picker
*/
unlinkPanels: Boolean,
/**
* @description whether to show the now button
*/
showNow: {
type: Boolean,
default: true
},
/**
* @description whether to show the confirm button
*/
showConfirm: Boolean,
/**
* @description whether to show footer
*/
showFooter: Boolean,
/**
* @description whether to show the number of the calendar week
*/
showWeekNumber: Boolean,
/**
* @description type of the picker
*/
type: {
type: definePropType(String),
default: "date"
},
/**
* @description whether to show clear button in range mode
*/
clearable: {
type: Boolean,
default: true
},
/**
* @description whether the date picker is bordered
*/
border: {
type: Boolean,
default: true
},
/**
* @description whether the input is editable
*/
editable: {
type: Boolean,
default: true
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/constants.mjs
var ROOT_PICKER_INJECTION_KEY = /* @__PURE__ */ Symbol("rootPickerContextKey");
var ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY = "ElIsDefaultFormat";
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue2.mjs
var import_dayjs12 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/shared.mjs
var selectionModes = [
"date",
"dates",
"year",
"years",
"month",
"months",
"week",
"range"
];
var datePickerSharedProps = buildProps({
cellClassName: {
type: definePropType(Function)
},
disabledDate: {
type: definePropType(Function)
},
date: {
type: definePropType(Object),
required: true
},
minDate: {
type: definePropType(Object)
},
maxDate: {
type: definePropType(Object)
},
parsedValue: {
type: definePropType([Object, Array])
},
rangeState: {
type: definePropType(Object),
default: () => ({
endDate: null,
selecting: false
})
},
disabled: Boolean
});
var panelSharedProps = buildProps({
type: {
type: definePropType(String),
required: true,
values: datePickTypes
},
dateFormat: String,
timeFormat: String,
showNow: {
type: Boolean,
default: true
},
showConfirm: Boolean,
showFooter: {
type: Boolean,
default: true
},
showWeekNumber: Boolean,
border: Boolean,
disabled: Boolean,
editable: {
type: Boolean,
default: true
}
});
var panelRangeSharedProps = buildProps({
unlinkPanels: Boolean,
visible: {
type: Boolean,
default: true
},
showConfirm: Boolean,
showFooter: {
type: Boolean,
default: true
},
border: Boolean,
disabled: Boolean,
parsedValue: {
type: definePropType(Array)
}
});
var selectionModeWithDefault = (mode) => {
return {
type: String,
values: selectionModes,
default: mode
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/props/panel-date-pick.mjs
var panelDatePickProps = buildProps({
...panelSharedProps,
parsedValue: {
type: definePropType([Object, Array])
},
visible: {
type: Boolean,
default: true
},
format: {
type: String,
default: ""
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/utils.mjs
var import_dayjs8 = __toESM(require_dayjs_min(), 1);
var isValidRange2 = (range) => {
if (!isArray(range)) return false;
const [left, right] = range;
return import_dayjs8.default.isDayjs(left) && import_dayjs8.default.isDayjs(right) && (0, import_dayjs8.default)(left).isValid() && (0, import_dayjs8.default)(right).isValid() && left.isSameOrBefore(right);
};
var getDefaultValue = (defaultValue, { lang, step: step2 = 1, unit: unit4, unlinkPanels }) => {
let start;
if (isArray(defaultValue)) {
let [left, right] = defaultValue.map((d2) => (0, import_dayjs8.default)(d2).locale(lang));
if (!unlinkPanels) {
right = left.add(step2, unit4);
}
return [left, right];
} else if (defaultValue) {
start = (0, import_dayjs8.default)(defaultValue);
} else {
start = (0, import_dayjs8.default)();
}
start = start.locale(lang);
return [start, start.add(step2, unit4)];
};
var buildPickerTable = (dimension, rows, {
columnIndexOffset,
startDate,
nextEndDate,
now,
unit: unit4,
relativeDateGetter,
setCellMetadata,
setRowMetadata
}) => {
for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {
const row = rows[rowIndex];
for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {
let cell = row[columnIndex + columnIndexOffset];
if (!cell) {
cell = {
row: rowIndex,
column: columnIndex,
type: "normal",
inRange: false,
start: false,
end: false
};
}
const index = rowIndex * dimension.column + columnIndex;
const nextStartDate = relativeDateGetter(index);
cell.dayjs = nextStartDate;
cell.date = nextStartDate.toDate();
cell.timestamp = nextStartDate.valueOf();
cell.type = "normal";
cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit4) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit4)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit4) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit4));
if (startDate == null ? void 0 : startDate.isSameOrAfter(nextEndDate)) {
cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit4);
cell.end = startDate && nextStartDate.isSame(startDate, unit4);
} else {
cell.start = !!startDate && nextStartDate.isSame(startDate, unit4);
cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit4);
}
const isToday = nextStartDate.isSame(now, unit4);
if (isToday) {
cell.type = "today";
}
setCellMetadata == null ? void 0 : setCellMetadata(cell, { rowIndex, columnIndex });
row[columnIndex + columnIndexOffset] = cell;
}
setRowMetadata == null ? void 0 : setRowMetadata(row);
}
};
var datesInMonth = (date, year, month, lang) => {
const firstDay = (0, import_dayjs8.default)().locale(lang).startOf("month").month(month).year(year).hour(date.hour()).minute(date.minute()).second(date.second());
const numOfDays = firstDay.daysInMonth();
return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
};
var getValidDateOfMonth = (date, year, month, lang, disabledDate) => {
const _value = (0, import_dayjs8.default)().year(year).month(month).startOf("month").hour(date.hour()).minute(date.minute()).second(date.second());
const _date = datesInMonth(date, year, month, lang).find((date2) => {
return !(disabledDate == null ? void 0 : disabledDate(date2));
});
if (_date) {
return (0, import_dayjs8.default)(_date).locale(lang);
}
return _value.locale(lang);
};
var getValidDateOfYear = (value, lang, disabledDate) => {
const year = value.year();
if (!(disabledDate == null ? void 0 : disabledDate(value.toDate()))) {
return value.locale(lang);
}
const month = value.month();
if (!datesInMonth(value, year, month, lang).every(disabledDate)) {
return getValidDateOfMonth(value, year, month, lang, disabledDate);
}
for (let i = 0; i < 12; i++) {
if (!datesInMonth(value, year, i, lang).every(disabledDate)) {
return getValidDateOfMonth(value, year, i, lang, disabledDate);
}
}
return value;
};
var correctlyParseUserInput = (value, format, lang, defaultFormat) => {
if (isArray(value)) {
return value.map(
(v2) => correctlyParseUserInput(v2, format, lang, defaultFormat)
);
}
if (isString(value)) {
const dayjsValue = (defaultFormat == null ? void 0 : defaultFormat.value) ? (0, import_dayjs8.default)(value) : (0, import_dayjs8.default)(value, format);
if (!dayjsValue.isValid()) {
return dayjsValue;
}
}
return (0, import_dayjs8.default)(value, format).locale(lang);
};
// node_modules/element-plus/es/components/date-picker-panel/src/props/basic-date-table.mjs
var basicDateTableProps = buildProps({
...datePickerSharedProps,
showWeekNumber: Boolean,
selectionMode: selectionModeWithDefault("date")
});
var basicDateTableEmits = ["changerange", "pick", "select"];
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-basic-date-table.mjs
var import_dayjs9 = __toESM(require_dayjs_min(), 1);
var isNormalDay = (type = "") => {
return ["normal", "today"].includes(type);
};
var useBasicDateTable = (props2, emit) => {
const { lang } = useLocale();
const tbodyRef = ref();
const currentCellRef = ref();
const lastRow = ref();
const lastColumn = ref();
const tableRows = ref([[], [], [], [], [], []]);
let focusWithClick = false;
const firstDayOfWeek = props2.date.$locale().weekStart || 7;
const WEEKS_CONSTANT = props2.date.locale("en").localeData().weekdaysShort().map((_2) => _2.toLowerCase());
const offsetDay = computed(() => {
return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek;
});
const startDate = computed(() => {
const startDayOfMonth = props2.date.startOf("month");
return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
});
const WEEKS = computed(() => {
return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(
firstDayOfWeek,
firstDayOfWeek + 7
);
});
const hasCurrent = computed(() => {
return flatten_default(unref(rows)).some((row) => {
return row.isCurrent;
});
});
const days = computed(() => {
const startOfMonth = props2.date.startOf("month");
const startOfMonthDay = startOfMonth.day() || 7;
const dateCountOfMonth = startOfMonth.daysInMonth();
const dateCountOfLastMonth = startOfMonth.subtract(1, "month").daysInMonth();
return {
startOfMonthDay,
dateCountOfMonth,
dateCountOfLastMonth
};
});
const selectedDate = computed(() => {
return props2.selectionMode === "dates" ? castArray(props2.parsedValue) : [];
});
const setDateText = (cell, { count, rowIndex, columnIndex }) => {
const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = unref(days);
const offset3 = unref(offsetDay);
if (rowIndex >= 0 && rowIndex <= 1) {
const numberOfDaysFromPreviousMonth = startOfMonthDay + offset3 < 0 ? 7 + startOfMonthDay + offset3 : startOfMonthDay + offset3;
if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) {
cell.text = count;
return true;
} else {
cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7;
cell.type = "prev-month";
}
} else {
if (count <= dateCountOfMonth) {
cell.text = count;
} else {
cell.text = count - dateCountOfMonth;
cell.type = "next-month";
}
return true;
}
return false;
};
const setCellMetadata = (cell, { columnIndex, rowIndex }, count) => {
const { disabledDate, cellClassName } = props2;
const _selectedDate = unref(selectedDate);
const shouldIncrement = setDateText(cell, { count, rowIndex, columnIndex });
const cellDate = cell.dayjs.toDate();
cell.selected = _selectedDate.find((d2) => d2.isSame(cell.dayjs, "day"));
cell.isSelected = !!cell.selected;
cell.isCurrent = isCurrent(cell);
cell.disabled = disabledDate == null ? void 0 : disabledDate(cellDate);
cell.customClass = cellClassName == null ? void 0 : cellClassName(cellDate);
return shouldIncrement;
};
const setRowMetadata = (row) => {
if (props2.selectionMode === "week") {
const [start, end] = props2.showWeekNumber ? [1, 7] : [0, 6];
const isActive = isWeekActive(row[start + 1]);
row[start].inRange = isActive;
row[start].start = isActive;
row[end].inRange = isActive;
row[end].end = isActive;
}
};
const rows = computed(() => {
const { minDate, maxDate, rangeState, showWeekNumber } = props2;
const offset3 = unref(offsetDay);
const rows_ = unref(tableRows);
const dateUnit = "day";
let count = 1;
buildPickerTable({ row: 6, column: 7 }, rows_, {
startDate: minDate,
columnIndexOffset: showWeekNumber ? 1 : 0,
nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null,
now: (0, import_dayjs9.default)().locale(unref(lang)).startOf(dateUnit),
unit: dateUnit,
relativeDateGetter: (idx) => unref(startDate).add(idx - offset3, dateUnit),
setCellMetadata: (...args) => {
if (setCellMetadata(...args, count)) {
count += 1;
}
},
setRowMetadata
});
if (showWeekNumber) {
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
if (rows_[rowIndex][1].dayjs) {
rows_[rowIndex][0] = {
type: "week",
text: rows_[rowIndex][1].dayjs.week()
};
}
}
}
return rows_;
});
watch(
() => props2.date,
async () => {
var _a;
if ((_a = unref(tbodyRef)) == null ? void 0 : _a.contains(document.activeElement)) {
await nextTick();
await focus();
}
}
);
const focus = async () => {
var _a;
return (_a = unref(currentCellRef)) == null ? void 0 : _a.focus();
};
const isCurrent = (cell) => {
return props2.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props2.parsedValue);
};
const cellMatchesDate = (cell, date) => {
if (!date) return false;
return (0, import_dayjs9.default)(date).locale(unref(lang)).isSame(props2.date.date(Number(cell.text)), "day");
};
const getDateOfCell = (row, column2) => {
const startOfMonthDay = unref(days).startOfMonthDay;
const offset3 = unref(offsetDay);
const numberOfDaysFromPreviousMonth = startOfMonthDay + offset3 < 0 ? 7 + startOfMonthDay + offset3 : startOfMonthDay + offset3;
const offsetFromStart = row * 7 + (column2 - (props2.showWeekNumber ? 1 : 0));
return props2.date.startOf("month").subtract(numberOfDaysFromPreviousMonth, "day").add(offsetFromStart, "day");
};
const handleMouseMove = (event) => {
var _a;
if (!props2.rangeState.selecting) return;
let target2 = event.target;
if (target2.tagName === "SPAN") {
target2 = (_a = target2.parentNode) == null ? void 0 : _a.parentNode;
}
if (target2.tagName === "DIV") {
target2 = target2.parentNode;
}
if (target2.tagName !== "TD") return;
const row = target2.parentNode.rowIndex - 1;
const column2 = target2.cellIndex;
if (unref(rows)[row][column2].disabled) return;
if (row !== unref(lastRow) || column2 !== unref(lastColumn)) {
lastRow.value = row;
lastColumn.value = column2;
emit("changerange", {
selecting: true,
endDate: getDateOfCell(row, column2)
});
}
};
const isSelectedCell = (cell) => {
return !unref(hasCurrent) && (cell == null ? void 0 : cell.text) === 1 && isNormalDay(cell.type) || cell.isCurrent;
};
const handleFocus = (event) => {
if (focusWithClick || unref(hasCurrent) || props2.selectionMode !== "date")
return;
handlePickDate(event, true);
};
const handleMouseDown = (event) => {
const target2 = event.target.closest("td");
if (!target2) return;
focusWithClick = true;
};
const handleMouseUp = (event) => {
const target2 = event.target.closest("td");
if (!target2) return;
focusWithClick = false;
};
const handleRangePick = (newDate) => {
if (!props2.rangeState.selecting || !props2.minDate) {
emit("pick", { minDate: newDate, maxDate: null });
emit("select", true);
} else {
if (newDate >= props2.minDate) {
emit("pick", { minDate: props2.minDate, maxDate: newDate });
} else {
emit("pick", { minDate: newDate, maxDate: props2.minDate });
}
emit("select", false);
}
};
const handleWeekPick = (newDate) => {
const weekNumber = newDate.week();
const value = `${newDate.year()}w${weekNumber}`;
emit("pick", {
year: newDate.year(),
week: weekNumber,
value,
date: newDate.startOf("week")
});
};
const handleDatesPick = (newDate, selected) => {
const newValue = selected ? castArray(props2.parsedValue).filter(
(d2) => (d2 == null ? void 0 : d2.valueOf()) !== newDate.valueOf()
) : castArray(props2.parsedValue).concat([newDate]);
emit("pick", newValue);
};
const handlePickDate = (event, isKeyboardMovement = false) => {
if (props2.disabled) return;
const target2 = event.target.closest("td");
if (!target2) return;
const row = target2.parentNode.rowIndex - 1;
const column2 = target2.cellIndex;
const cell = unref(rows)[row][column2];
if (cell.disabled || cell.type === "week") return;
const newDate = getDateOfCell(row, column2);
switch (props2.selectionMode) {
case "range": {
handleRangePick(newDate);
break;
}
case "date": {
emit("pick", newDate, isKeyboardMovement);
break;
}
case "week": {
handleWeekPick(newDate);
break;
}
case "dates": {
handleDatesPick(newDate, !!cell.selected);
break;
}
}
};
const isWeekActive = (cell) => {
if (props2.selectionMode !== "week") return false;
let newDate = props2.date.startOf("day");
if (cell.type === "prev-month") {
newDate = newDate.subtract(1, "month");
}
if (cell.type === "next-month") {
newDate = newDate.add(1, "month");
}
newDate = newDate.date(Number.parseInt(cell.text, 10));
if (props2.parsedValue && !isArray(props2.parsedValue)) {
const dayOffset = (props2.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
const weekDate = props2.parsedValue.subtract(dayOffset, "day");
return weekDate.isSame(newDate, "day");
}
return false;
};
return {
WEEKS,
rows,
tbodyRef,
currentCellRef,
// cellMatchesDate,
// getDateOfCell,
focus,
isCurrent,
isWeekActive,
isSelectedCell,
handlePickDate,
handleMouseUp,
handleMouseDown,
handleMouseMove,
handleFocus
};
};
var useBasicDateTableDOM = (props2, {
isCurrent,
isWeekActive
}) => {
const ns = useNamespace("date-table");
const { t } = useLocale();
const tableKls = computed(() => [
ns.b(),
ns.is("week-mode", props2.selectionMode === "week" && !props2.disabled)
]);
const tableLabel = computed(() => t("el.datepicker.dateTablePrompt"));
const getCellClasses = (cell) => {
const classes = [];
if (isNormalDay(cell.type) && !cell.disabled) {
classes.push("available");
if (cell.type === "today") {
classes.push("today");
}
} else {
classes.push(cell.type);
}
if (isCurrent(cell)) {
classes.push("current");
}
if (cell.inRange && (isNormalDay(cell.type) || props2.selectionMode === "week")) {
classes.push("in-range");
if (cell.start) {
classes.push("start-date");
}
if (cell.end) {
classes.push("end-date");
}
}
if (cell.disabled || props2.disabled) {
classes.push("disabled");
}
if (cell.selected) {
classes.push("selected");
}
if (cell.customClass) {
classes.push(cell.customClass);
}
return classes.join(" ");
};
const getRowKls = (cell) => [
ns.e("row"),
{ current: isWeekActive(cell) }
];
return {
tableKls,
tableLabel,
weekHeaderClass: ns.e("week-header"),
getCellClasses,
getRowKls,
t
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/props/basic-cell.mjs
var basicCellProps = buildProps({
cell: {
type: definePropType(Object)
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-cell-render.mjs
var ElDatePickerCell = defineComponent({
name: "ElDatePickerCell",
props: basicCellProps,
setup(props2) {
const ns = useNamespace("date-table-cell");
const {
slots
} = inject(ROOT_PICKER_INJECTION_KEY);
return () => {
const {
cell
} = props2;
return renderSlot(slots, "default", {
...cell
}, () => {
var _a;
return [createVNode("div", {
"class": ns.b()
}, [createVNode("span", {
"class": ns.e("text")
}, [(_a = cell == null ? void 0 : cell.renderText) != null ? _a : cell == null ? void 0 : cell.text])])];
});
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-date-table.vue2.mjs
var _hoisted_128 = ["aria-label"];
var _hoisted_212 = ["aria-label"];
var _hoisted_34 = ["aria-current", "aria-selected", "tabindex", "aria-disabled"];
var _sfc_main67 = defineComponent({
__name: "basic-date-table",
props: basicDateTableProps,
emits: basicDateTableEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const {
WEEKS,
rows,
tbodyRef,
currentCellRef,
focus,
isCurrent,
isWeekActive,
isSelectedCell,
handlePickDate,
handleMouseUp,
handleMouseDown,
handleMouseMove,
handleFocus
} = useBasicDateTable(props2, emit);
const { tableLabel, tableKls, getCellClasses, getRowKls, weekHeaderClass, t } = useBasicDateTableDOM(props2, {
isCurrent,
isWeekActive
});
let isUnmounting = false;
onBeforeUnmount(() => {
isUnmounting = true;
});
__expose({
/**
* @description focus on current cell
*/
focus
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("table", {
"aria-label": unref(tableLabel),
class: normalizeClass(unref(tableKls)),
cellspacing: "0",
cellpadding: "0",
role: "grid",
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handlePickDate) && unref(handlePickDate)(...args)),
onMousemove: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(handleMouseMove) && unref(handleMouseMove)(...args)),
onMousedown: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(handleMouseDown) && unref(handleMouseDown)(...args)),
onMouseup: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(handleMouseUp) && unref(handleMouseUp)(...args))
}, [
createBaseVNode(
"tbody",
{
ref_key: "tbodyRef",
ref: tbodyRef
},
[
createBaseVNode("tr", null, [
_ctx.showWeekNumber ? (openBlock(), createElementBlock(
"th",
{
key: 0,
scope: "col",
class: normalizeClass(unref(weekHeaderClass))
},
null,
2
/* CLASS */
)) : createCommentVNode("v-if", true),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(WEEKS), (week, key) => {
return openBlock(), createElementBlock("th", {
key,
"aria-label": unref(t)("el.datepicker.weeksFull." + week),
scope: "col"
}, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, _hoisted_212);
}),
128
/* KEYED_FRAGMENT */
))
]),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(rows), (row, rowKey2) => {
return openBlock(), createElementBlock(
"tr",
{
key: rowKey2,
class: normalizeClass(unref(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1]))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(row, (cell, columnKey) => {
return openBlock(), createElementBlock("td", {
key: `${rowKey2}.${columnKey}`,
ref_for: true,
ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el),
class: normalizeClass(unref(getCellClasses)(cell)),
"aria-current": cell.isCurrent ? "date" : void 0,
"aria-selected": cell.isCurrent,
tabindex: _ctx.disabled ? void 0 : unref(isSelectedCell)(cell) ? 0 : -1,
"aria-disabled": _ctx.disabled,
onFocus: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleFocus) && unref(handleFocus)(...args))
}, [
createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
], 42, _hoisted_34);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
],
512
/* NEED_PATCH */
)
], 42, _hoisted_128);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-month-table.vue2.mjs
var import_dayjs10 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/basic-month-table.mjs
var basicMonthTableProps = buildProps({
...datePickerSharedProps,
selectionMode: selectionModeWithDefault("month")
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-month-table.vue2.mjs
var _hoisted_129 = ["aria-label"];
var _hoisted_213 = ["aria-selected", "aria-label", "tabindex", "onKeydown"];
var _sfc_main68 = defineComponent({
__name: "basic-month-table",
props: basicMonthTableProps,
emits: ["changerange", "pick", "select"],
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("month-table");
const { t, lang } = useLocale();
const tbodyRef = ref();
const currentCellRef = ref();
const months = ref(
props2.date.locale("en").localeData().monthsShort().map((_2) => _2.toLowerCase())
);
const tableRows = ref([[], [], []]);
const lastRow = ref();
const lastColumn = ref();
const rows = computed(() => {
var _a, _b, _c;
const rows2 = tableRows.value;
const now = (0, import_dayjs10.default)().locale(lang.value).startOf("month");
for (let i = 0; i < 3; i++) {
const row = rows2[i];
for (let j = 0; j < 4; j++) {
const cell = row[j] || (row[j] = {
row: i,
column: j,
type: "normal",
inRange: false,
start: false,
end: false,
text: -1,
disabled: false,
isSelected: false,
customClass: void 0,
date: void 0,
dayjs: void 0,
isCurrent: void 0,
selected: void 0,
renderText: void 0,
timestamp: void 0
});
cell.type = "normal";
const index = i * 4 + j;
const calTime = props2.date.startOf("year").month(index);
const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null;
cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "month") && calEndDate && calTime.isSameOrBefore(calEndDate, "month")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "month") && calEndDate && calTime.isSameOrAfter(calEndDate, "month"));
if ((_a = props2.minDate) == null ? void 0 : _a.isSameOrAfter(calEndDate)) {
cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month"));
cell.end = props2.minDate && calTime.isSame(props2.minDate, "month");
} else {
cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "month"));
cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month"));
}
const isToday = now.isSame(calTime);
if (isToday) {
cell.type = "today";
}
const cellDate = calTime.toDate();
cell.text = index;
cell.disabled = ((_b = props2.disabledDate) == null ? void 0 : _b.call(props2, cellDate)) || false;
cell.date = cellDate;
cell.customClass = (_c = props2.cellClassName) == null ? void 0 : _c.call(props2, cellDate);
cell.dayjs = calTime;
cell.timestamp = calTime.valueOf();
cell.isSelected = isSelectedCell(cell);
}
}
return rows2;
});
const focus = () => {
var _a;
(_a = currentCellRef.value) == null ? void 0 : _a.focus();
};
const getCellStyle = (cell) => {
const style = {};
const year = props2.date.year();
const today = /* @__PURE__ */ new Date();
const month = cell.text;
style.disabled = props2.disabled || (props2.disabledDate ? datesInMonth(props2.date, year, month, lang.value).every(
props2.disabledDate
) : false);
style.current = castArray(props2.parsedValue).some(
(date) => import_dayjs10.default.isDayjs(date) && date.year() === year && date.month() === month
);
style.today = today.getFullYear() === year && today.getMonth() === month;
if (cell.customClass) {
style[cell.customClass] = true;
}
if (cell.inRange) {
style["in-range"] = true;
if (cell.start) {
style["start-date"] = true;
}
if (cell.end) {
style["end-date"] = true;
}
}
return style;
};
const isSelectedCell = (cell) => {
const year = props2.date.year();
const month = cell.text;
return castArray(props2.date).some(
(date) => date.year() === year && date.month() === month
);
};
const handleMouseMove = (event) => {
var _a;
if (!props2.rangeState.selecting) return;
let target2 = event.target;
if (target2.tagName === "SPAN") {
target2 = (_a = target2.parentNode) == null ? void 0 : _a.parentNode;
}
if (target2.tagName === "DIV") {
target2 = target2.parentNode;
}
if (target2.tagName !== "TD") return;
const row = target2.parentNode.rowIndex;
const column2 = target2.cellIndex;
if (rows.value[row][column2].disabled) return;
if (row !== lastRow.value || column2 !== lastColumn.value) {
lastRow.value = row;
lastColumn.value = column2;
emit("changerange", {
selecting: true,
endDate: props2.date.startOf("year").month(row * 4 + column2)
});
}
};
const handleMonthTableClick = (event) => {
var _a;
if (props2.disabled) return;
const target2 = (_a = event.target) == null ? void 0 : _a.closest(
"td"
);
if ((target2 == null ? void 0 : target2.tagName) !== "TD") return;
if (hasClass(target2, "disabled")) return;
const column2 = target2.cellIndex;
const row = target2.parentNode.rowIndex;
const month = row * 4 + column2;
const newDate = props2.date.startOf("year").month(month);
if (props2.selectionMode === "months") {
if (event.type === "keydown") {
emit("pick", castArray(props2.parsedValue), false);
return;
}
const newMonth = getValidDateOfMonth(
props2.date,
props2.date.year(),
month,
lang.value,
props2.disabledDate
);
const newValue = hasClass(target2, "current") ? castArray(props2.parsedValue).filter(
(d2) => (
// Filter out the selected month only when both year and month match
// This allows remove same months from different years #20019
(d2 == null ? void 0 : d2.year()) !== newMonth.year() || (d2 == null ? void 0 : d2.month()) !== newMonth.month()
)
) : castArray(props2.parsedValue).concat([(0, import_dayjs10.default)(newMonth)]);
emit("pick", newValue);
} else if (props2.selectionMode === "range") {
if (!props2.rangeState.selecting) {
emit("pick", { minDate: newDate, maxDate: null });
emit("select", true);
} else {
if (props2.minDate && newDate >= props2.minDate) {
emit("pick", { minDate: props2.minDate, maxDate: newDate });
} else {
emit("pick", { minDate: newDate, maxDate: props2.minDate });
}
emit("select", false);
}
} else {
emit("pick", month);
}
};
watch(
() => props2.date,
async () => {
var _a, _b;
if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
await nextTick();
(_b = currentCellRef.value) == null ? void 0 : _b.focus();
}
}
);
__expose({
/**
* @description focus current cell
*/
focus
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("table", {
role: "grid",
"aria-label": unref(t)("el.datepicker.monthTablePrompt"),
class: normalizeClass(unref(ns).b()),
onClick: handleMonthTableClick,
onMousemove: handleMouseMove
}, [
createBaseVNode(
"tbody",
{
ref_key: "tbodyRef",
ref: tbodyRef
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(rows.value, (row, key) => {
return openBlock(), createElementBlock("tr", { key }, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(row, (cell, key_) => {
return openBlock(), createElementBlock("td", {
key: key_,
ref_for: true,
ref: (el) => cell.isSelected && (currentCellRef.value = el),
class: normalizeClass(getCellStyle(cell)),
"aria-selected": !!cell.isSelected,
"aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`),
tabindex: cell.isSelected ? 0 : -1,
onKeydown: [
withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]),
withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])
]
}, [
createVNode(unref(ElDatePickerCell), {
cell: {
...cell,
renderText: unref(t)("el.datepicker.months." + months.value[cell.text])
}
}, null, 8, ["cell"])
], 42, _hoisted_213);
}),
128
/* KEYED_FRAGMENT */
))
]);
}),
128
/* KEYED_FRAGMENT */
))
],
512
/* NEED_PATCH */
)
], 42, _hoisted_129);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-year-table.vue2.mjs
var import_dayjs11 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/basic-year-table.mjs
var basicYearTableProps = buildProps({
...datePickerSharedProps,
selectionMode: selectionModeWithDefault("year")
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-year-table.vue2.mjs
var _hoisted_130 = ["aria-label"];
var _hoisted_214 = ["aria-selected", "aria-label", "tabindex", "onKeydown"];
var _sfc_main69 = defineComponent({
__name: "basic-year-table",
props: basicYearTableProps,
emits: ["changerange", "pick", "select"],
setup(__props, { expose: __expose, emit: __emit }) {
const datesInYear = (year, lang2) => {
const firstDay = (0, import_dayjs11.default)(String(year)).locale(lang2).startOf("year");
const lastDay = firstDay.endOf("year");
const numOfDays = lastDay.dayOfYear();
return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
};
const props2 = __props;
const emit = __emit;
const ns = useNamespace("year-table");
const { t, lang } = useLocale();
const tbodyRef = ref();
const currentCellRef = ref();
const startYear = computed(() => {
return Math.floor(props2.date.year() / 10) * 10;
});
const tableRows = ref([[], [], []]);
const lastRow = ref();
const lastColumn = ref();
const rows = computed(() => {
var _a, _b, _c;
const rows2 = tableRows.value;
const now = (0, import_dayjs11.default)().locale(lang.value).startOf("year");
for (let i = 0; i < 3; i++) {
const row = rows2[i];
for (let j = 0; j < 4; j++) {
if (i * 4 + j >= 10) {
break;
}
let cell = row[j];
if (!cell) {
cell = {
row: i,
column: j,
type: "normal",
inRange: false,
start: false,
end: false,
text: -1,
disabled: false,
isSelected: false,
customClass: void 0,
date: void 0,
dayjs: void 0,
isCurrent: void 0,
selected: void 0,
renderText: void 0,
timestamp: void 0
};
}
cell.type = "normal";
const index = i * 4 + j + startYear.value;
const calTime = (0, import_dayjs11.default)().year(index);
const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null;
cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "year") && calEndDate && calTime.isSameOrBefore(calEndDate, "year")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "year") && calEndDate && calTime.isSameOrAfter(calEndDate, "year"));
if ((_a = props2.minDate) == null ? void 0 : _a.isSameOrAfter(calEndDate)) {
cell.start = !!(calEndDate && calTime.isSame(calEndDate, "year"));
cell.end = !!(props2.minDate && calTime.isSame(props2.minDate, "year"));
} else {
cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "year"));
cell.end = !!(calEndDate && calTime.isSame(calEndDate, "year"));
}
const isToday = now.isSame(calTime);
if (isToday) {
cell.type = "today";
}
cell.text = index;
const cellDate = calTime.toDate();
cell.disabled = ((_b = props2.disabledDate) == null ? void 0 : _b.call(props2, cellDate)) || false;
cell.date = cellDate;
cell.customClass = (_c = props2.cellClassName) == null ? void 0 : _c.call(props2, cellDate);
cell.dayjs = calTime;
cell.timestamp = calTime.valueOf();
cell.isSelected = isSelectedCell(cell);
row[j] = cell;
}
}
return rows2;
});
const focus = () => {
var _a;
(_a = currentCellRef.value) == null ? void 0 : _a.focus();
};
const getCellKls = (cell) => {
const kls = {};
const today = (0, import_dayjs11.default)().locale(lang.value);
const year = cell.text;
kls.disabled = props2.disabled || (props2.disabledDate ? datesInYear(year, lang.value).every(props2.disabledDate) : false);
kls.today = today.year() === year;
kls.current = castArray(props2.parsedValue).some((d2) => d2.year() === year);
if (cell.customClass) {
kls[cell.customClass] = true;
}
if (cell.inRange) {
kls["in-range"] = true;
if (cell.start) {
kls["start-date"] = true;
}
if (cell.end) {
kls["end-date"] = true;
}
}
return kls;
};
const isSelectedCell = (cell) => {
const year = cell.text;
return castArray(props2.date).some((date) => date.year() === year);
};
const handleYearTableClick = (event) => {
var _a;
if (props2.disabled) return;
const target2 = (_a = event.target) == null ? void 0 : _a.closest(
"td"
);
if (!target2 || !target2.textContent || hasClass(target2, "disabled")) return;
const column2 = target2.cellIndex;
const row = target2.parentNode.rowIndex;
const selectedYear = row * 4 + column2 + startYear.value;
const newDate = (0, import_dayjs11.default)().year(selectedYear);
if (props2.selectionMode === "range") {
if (!props2.rangeState.selecting) {
emit("pick", { minDate: newDate, maxDate: null });
emit("select", true);
} else {
if (props2.minDate && newDate >= props2.minDate) {
emit("pick", { minDate: props2.minDate, maxDate: newDate });
} else {
emit("pick", { minDate: newDate, maxDate: props2.minDate });
}
emit("select", false);
}
} else if (props2.selectionMode === "years") {
if (event.type === "keydown") {
emit("pick", castArray(props2.parsedValue), false);
return;
}
const vaildYear = getValidDateOfYear(
newDate.startOf("year"),
lang.value,
props2.disabledDate
);
const newValue = hasClass(target2, "current") ? castArray(props2.parsedValue).filter((d2) => (d2 == null ? void 0 : d2.year()) !== selectedYear) : castArray(props2.parsedValue).concat([vaildYear]);
emit("pick", newValue);
} else {
emit("pick", selectedYear);
}
};
const handleMouseMove = (event) => {
var _a;
if (!props2.rangeState.selecting) return;
const target2 = (_a = event.target) == null ? void 0 : _a.closest(
"td"
);
if (!target2) return;
const row = target2.parentNode.rowIndex;
const column2 = target2.cellIndex;
if (rows.value[row][column2].disabled) return;
if (row !== lastRow.value || column2 !== lastColumn.value) {
lastRow.value = row;
lastColumn.value = column2;
emit("changerange", {
selecting: true,
endDate: (0, import_dayjs11.default)().year(startYear.value).add(row * 4 + column2, "year")
});
}
};
watch(
() => props2.date,
async () => {
var _a, _b;
if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
await nextTick();
(_b = currentCellRef.value) == null ? void 0 : _b.focus();
}
}
);
__expose({
/**
* @description focus on the current cell
*/
focus
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("table", {
role: "grid",
"aria-label": unref(t)("el.datepicker.yearTablePrompt"),
class: normalizeClass(unref(ns).b()),
onClick: handleYearTableClick,
onMousemove: handleMouseMove
}, [
createBaseVNode(
"tbody",
{
ref_key: "tbodyRef",
ref: tbodyRef
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(rows.value, (row, rowKey2) => {
return openBlock(), createElementBlock("tr", { key: rowKey2 }, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(row, (cell, cellKey) => {
return openBlock(), createElementBlock("td", {
key: `${rowKey2}_${cellKey}`,
ref_for: true,
ref: (el) => cell.isSelected && (currentCellRef.value = el),
class: normalizeClass(["available", getCellKls(cell)]),
"aria-selected": cell.isSelected,
"aria-label": String(cell.text),
tabindex: cell.isSelected ? 0 : -1,
onKeydown: [
withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]),
withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])
]
}, [
createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
], 42, _hoisted_214);
}),
128
/* KEYED_FRAGMENT */
))
]);
}),
128
/* KEYED_FRAGMENT */
))
],
512
/* NEED_PATCH */
)
], 42, _hoisted_130);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue2.mjs
var _hoisted_131 = ["disabled", "onClick"];
var _hoisted_215 = ["aria-label", "disabled"];
var _hoisted_35 = ["aria-label", "disabled"];
var _hoisted_42 = ["tabindex", "aria-disabled"];
var _hoisted_52 = ["tabindex", "aria-disabled"];
var _hoisted_62 = ["aria-label", "disabled"];
var _hoisted_7 = ["aria-label", "disabled"];
var _sfc_main70 = defineComponent({
__name: "panel-date-pick",
props: panelDatePickProps,
emits: ["pick", "set-picker-option", "panel-change"],
setup(__props, { emit: __emit }) {
const timeWithinRange = (_2, __, ___) => true;
const props2 = __props;
const contextEmit = __emit;
const ppNs = useNamespace("picker-panel");
const dpNs = useNamespace("date-picker");
const attrs = useAttrs();
const slots = useSlots();
const { t, lang } = useLocale();
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const isDefaultFormat = inject(
ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
void 0
);
const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
const defaultValue = toRef(pickerBase.props, "defaultValue");
const currentViewRef = ref();
const innerDate = ref((0, import_dayjs12.default)().locale(lang.value));
const isChangeToNow = ref(false);
let isShortcut = false;
const defaultTimeD = computed(() => {
return (0, import_dayjs12.default)(defaultTime).locale(lang.value);
});
const month = computed(() => {
return innerDate.value.month();
});
const year = computed(() => {
return innerDate.value.year();
});
const selectableRange = ref([]);
const userInputDate = ref(null);
const userInputTime = ref(null);
const checkDateWithinRange = (date) => {
return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props2.format || "HH:mm:ss") : true;
};
const formatEmit = (emitDayjs) => {
if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) {
return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
}
if (showTime.value) return emitDayjs.millisecond(0);
return emitDayjs.startOf("day");
};
const emit = (value, ...args) => {
if (!value) {
contextEmit("pick", value, ...args);
} else if (isArray(value)) {
const dates = value.map(formatEmit);
contextEmit("pick", dates, ...args);
} else {
contextEmit("pick", formatEmit(value), ...args);
}
userInputDate.value = null;
userInputTime.value = null;
isChangeToNow.value = false;
isShortcut = false;
};
const handleDatePick = async (value, keepOpen) => {
if (selectionMode.value === "date" && import_dayjs12.default.isDayjs(value)) {
const parsedDateValue = extractFirst(props2.parsedValue);
let newDate = parsedDateValue ? parsedDateValue.year(value.year()).month(value.month()).date(value.date()) : value;
if (!checkDateWithinRange(newDate)) ;
innerDate.value = newDate;
emit(newDate, showTime.value || keepOpen);
} else if (selectionMode.value === "week") {
emit(value.date);
} else if (selectionMode.value === "dates") {
emit(value, true);
}
};
const moveByMonth = (forward) => {
const action = forward ? "add" : "subtract";
innerDate.value = innerDate.value[action](1, "month");
handlePanelChange("month");
};
const moveByYear = (forward) => {
const currentDate = innerDate.value;
const action = forward ? "add" : "subtract";
innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
handlePanelChange("year");
};
const currentView = ref("date");
const yearLabel = computed(() => {
const yearTranslation = t("el.datepicker.year");
if (currentView.value === "year") {
const startYear = Math.floor(year.value / 10) * 10;
if (yearTranslation) {
return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
}
return `${startYear} - ${startYear + 9}`;
}
return `${year.value} ${yearTranslation}`;
});
const handleShortcutClick = (shortcut) => {
const shortcutValue = isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
if (shortcutValue) {
isShortcut = true;
emit((0, import_dayjs12.default)(shortcutValue).locale(lang.value));
return;
}
if (shortcut.onClick) {
shortcut.onClick({
attrs,
slots,
emit: contextEmit
});
}
};
const selectionMode = computed(() => {
const { type } = props2;
if (["week", "month", "months", "year", "years", "dates"].includes(type))
return type;
return "date";
});
const isMultipleType = computed(() => {
return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years";
});
const keyboardMode = computed(() => {
return selectionMode.value === "date" ? currentView.value : selectionMode.value;
});
const hasShortcuts = computed(() => !!shortcuts.length);
const handleMonthPick = async (month2, keepOpen) => {
if (selectionMode.value === "month") {
innerDate.value = getValidDateOfMonth(
innerDate.value,
innerDate.value.year(),
month2,
lang.value,
disabledDate
);
emit(innerDate.value, false);
} else if (selectionMode.value === "months") {
emit(month2, keepOpen != null ? keepOpen : true);
} else {
innerDate.value = getValidDateOfMonth(
innerDate.value,
innerDate.value.year(),
month2,
lang.value,
disabledDate
);
currentView.value = "date";
if (["month", "year", "date", "week"].includes(selectionMode.value)) {
emit(innerDate.value, true);
await nextTick();
handleFocusPicker();
}
}
handlePanelChange("month");
};
const handleYearPick = async (year2, keepOpen) => {
if (selectionMode.value === "year") {
const data = innerDate.value.startOf("year").year(year2);
innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);
emit(innerDate.value, false);
} else if (selectionMode.value === "years") {
emit(year2, keepOpen != null ? keepOpen : true);
} else {
const data = innerDate.value.year(year2);
innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);
currentView.value = "month";
if (["month", "year", "date", "week"].includes(selectionMode.value)) {
emit(innerDate.value, true);
await nextTick();
handleFocusPicker();
}
}
handlePanelChange("year");
};
const dateDisabled = useFormDisabled();
const showPicker = async (view) => {
if (dateDisabled.value) return;
currentView.value = view;
await nextTick();
handleFocusPicker();
};
const showTime = computed(
() => props2.type === "datetime" || props2.type === "datetimerange"
);
const footerVisible = computed(() => {
const showDateFooter = showTime.value || selectionMode.value === "dates";
const showYearFooter = selectionMode.value === "years";
const showMonthFooter = selectionMode.value === "months";
const isDateView = currentView.value === "date";
const isYearView = currentView.value === "year";
const isMonthView = currentView.value === "month";
return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
});
const footerFilled = computed(
() => !isMultipleType.value && props2.showNow || props2.showConfirm
);
const disabledConfirm = computed(() => {
if (!disabledDate) return false;
if (!props2.parsedValue) return true;
if (isArray(props2.parsedValue)) {
return disabledDate(props2.parsedValue[0].toDate());
}
return disabledDate(props2.parsedValue.toDate());
});
const onConfirm = () => {
if (isMultipleType.value) {
emit(props2.parsedValue);
} else {
let result = extractFirst(props2.parsedValue);
if (!result) {
const defaultTimeD2 = (0, import_dayjs12.default)(defaultTime).locale(lang.value);
const defaultValueD = getDefaultValue2();
result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
}
innerDate.value = result;
emit(result);
}
};
const disabledNow = computed(() => {
if (!disabledDate) return false;
return disabledDate((0, import_dayjs12.default)().locale(lang.value).toDate());
});
const changeToNow = () => {
const now = (0, import_dayjs12.default)().locale(lang.value);
const nowDate = now.toDate();
isChangeToNow.value = true;
if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
innerDate.value = (0, import_dayjs12.default)().locale(lang.value);
emit(innerDate.value);
}
};
const timeFormat = computed(() => {
return props2.timeFormat || extractTimeFormat(props2.format) || DEFAULT_FORMATS_TIME;
});
const dateFormat = computed(() => {
return props2.dateFormat || extractDateFormat(props2.format) || DEFAULT_FORMATS_DATE;
});
const visibleTime = computed(() => {
if (userInputTime.value) return userInputTime.value;
if (!props2.parsedValue && !defaultValue.value) return;
const dateValue = extractFirst(props2.parsedValue) || innerDate.value;
return dateValue.format(timeFormat.value);
});
const visibleDate = computed(() => {
if (userInputDate.value) return userInputDate.value;
if (!props2.parsedValue && !defaultValue.value) return;
const dateValue = extractFirst(props2.parsedValue) || innerDate.value;
return dateValue.format(dateFormat.value);
});
const timePickerVisible = ref(false);
const onTimePickerInputFocus = () => {
timePickerVisible.value = true;
};
const handleTimePickClose = () => {
timePickerVisible.value = false;
};
const getUnits = (date) => {
return {
hour: date.hour(),
minute: date.minute(),
second: date.second(),
year: date.year(),
month: date.month(),
date: date.date()
};
};
const handleTimePick = (value, visible, first) => {
const { hour, minute, second } = getUnits(value);
const parsedDateValue = extractFirst(props2.parsedValue);
const newDate = parsedDateValue ? parsedDateValue.hour(hour).minute(minute).second(second) : value;
innerDate.value = newDate;
emit(innerDate.value, true);
if (!first) {
timePickerVisible.value = visible;
}
};
const handleVisibleTimeChange = (value) => {
const newDate = (0, import_dayjs12.default)(value, timeFormat.value).locale(lang.value);
if (newDate.isValid() && checkDateWithinRange(newDate)) {
const { year: year2, month: month2, date } = getUnits(innerDate.value);
innerDate.value = newDate.year(year2).month(month2).date(date);
userInputTime.value = null;
timePickerVisible.value = false;
emit(innerDate.value, true);
}
};
const handleVisibleDateChange = (value) => {
const newDate = correctlyParseUserInput(
value,
dateFormat.value,
lang.value,
isDefaultFormat
);
if (newDate.isValid()) {
if (disabledDate && disabledDate(newDate.toDate())) {
return;
}
const { hour, minute, second } = getUnits(innerDate.value);
innerDate.value = newDate.hour(hour).minute(minute).second(second);
userInputDate.value = null;
emit(innerDate.value, true);
}
};
const isValidValue3 = (date) => {
return import_dayjs12.default.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
};
const parseUserInput = (value) => {
return correctlyParseUserInput(
value,
props2.format,
lang.value,
isDefaultFormat
);
};
const getDefaultValue2 = () => {
const parseDate2 = (0, import_dayjs12.default)(defaultValue.value).locale(lang.value);
if (!defaultValue.value) {
const defaultTimeDValue = defaultTimeD.value;
return (0, import_dayjs12.default)().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
}
return parseDate2;
};
const handleFocusPicker = () => {
var _a;
if (["week", "month", "year", "date"].includes(selectionMode.value)) {
(_a = currentViewRef.value) == null ? void 0 : _a.focus();
}
};
const _handleFocusPicker = () => {
handleFocusPicker();
if (selectionMode.value === "week") {
handleKeyControl(EVENT_CODE.down);
}
};
const handleKeydownTable = (event) => {
const code = getEventCode(event);
const validCode = [
EVENT_CODE.up,
EVENT_CODE.down,
EVENT_CODE.left,
EVENT_CODE.right,
EVENT_CODE.home,
EVENT_CODE.end,
EVENT_CODE.pageUp,
EVENT_CODE.pageDown
];
if (validCode.includes(code)) {
handleKeyControl(code);
event.stopPropagation();
event.preventDefault();
}
if ([EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(
code
) && userInputDate.value === null && userInputTime.value === null) {
event.preventDefault();
emit(innerDate.value, false);
}
};
const handleKeyControl = (code) => {
var _a;
const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE;
const mapping = {
year: {
[up]: -4,
[down]: 4,
[left]: -1,
[right]: 1,
offset: (date, step2) => date.setFullYear(date.getFullYear() + step2)
},
month: {
[up]: -4,
[down]: 4,
[left]: -1,
[right]: 1,
offset: (date, step2) => date.setMonth(date.getMonth() + step2)
},
week: {
[up]: -1,
[down]: 1,
[left]: -1,
[right]: 1,
offset: (date, step2) => date.setDate(date.getDate() + step2 * 7)
},
date: {
[up]: -7,
[down]: 7,
[left]: -1,
[right]: 1,
[home]: (date) => -date.getDay(),
[end]: (date) => -date.getDay() + 6,
[pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
[pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
offset: (date, step2) => date.setDate(date.getDate() + step2)
}
};
const newDate = innerDate.value.toDate();
while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
const map = mapping[keyboardMode.value];
if (!map) return;
map.offset(
newDate,
isFunction(map[code]) ? map[code](newDate) : (_a = map[code]) != null ? _a : 0
);
if (disabledDate && disabledDate(newDate)) {
break;
}
const result = (0, import_dayjs12.default)(newDate).locale(lang.value);
innerDate.value = result;
contextEmit("pick", result, true);
break;
}
};
const handlePanelChange = (mode) => {
contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
};
watch(
() => selectionMode.value,
(val) => {
if (["month", "year"].includes(val)) {
currentView.value = val;
return;
} else if (val === "years") {
currentView.value = "year";
return;
} else if (val === "months") {
currentView.value = "month";
return;
}
currentView.value = "date";
},
{ immediate: true }
);
watch(
() => defaultValue.value,
(val) => {
if (val) {
innerDate.value = getDefaultValue2();
}
},
{ immediate: true }
);
watch(
() => props2.parsedValue,
(val) => {
if (val) {
if (isMultipleType.value) return;
if (isArray(val)) return;
innerDate.value = val;
} else {
innerDate.value = getDefaultValue2();
}
},
{ immediate: true }
);
contextEmit("set-picker-option", ["isValidValue", isValidValue3]);
contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ppNs).b(),
unref(dpNs).b(),
unref(ppNs).is("border", _ctx.border),
unref(ppNs).is("disabled", unref(dateDisabled)),
{
"has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
"has-time": showTime.value
}
])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body-wrapper"))
},
[
renderSlot(_ctx.$slots, "sidebar", {
class: normalizeClass(unref(ppNs).e("sidebar"))
}),
hasShortcuts.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("sidebar"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(shortcuts), (shortcut, key) => {
return openBlock(), createElementBlock("button", {
key,
type: "button",
disabled: unref(dateDisabled),
class: normalizeClass(unref(ppNs).e("shortcut")),
onClick: ($event) => handleShortcutClick(shortcut)
}, toDisplayString(shortcut.text), 11, _hoisted_131);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body"))
},
[
showTime.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(dpNs).e("time-header"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(dpNs).e("editor-wrap"))
},
[
createVNode(unref(ElInput), {
placeholder: unref(t)("el.datepicker.selectDate"),
"model-value": visibleDate.value,
size: "small",
"validate-event": false,
disabled: unref(dateDisabled),
readonly: !_ctx.editable,
onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
onChange: handleVisibleDateChange
}, null, 8, ["placeholder", "model-value", "disabled", "readonly"])
],
2
/* CLASS */
),
withDirectives((openBlock(), createElementBlock(
"span",
{
class: normalizeClass(unref(dpNs).e("editor-wrap"))
},
[
createVNode(unref(ElInput), {
placeholder: unref(t)("el.datepicker.selectTime"),
"model-value": visibleTime.value,
size: "small",
"validate-event": false,
disabled: unref(dateDisabled),
readonly: !_ctx.editable,
onFocus: onTimePickerInputFocus,
onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
onChange: handleVisibleTimeChange
}, null, 8, ["placeholder", "model-value", "disabled", "readonly"]),
createVNode(unref(_sfc_main65), {
visible: timePickerVisible.value,
format: timeFormat.value,
"parsed-value": innerDate.value,
onPick: handleTimePick
}, null, 8, ["visible", "format", "parsed-value"])
],
2
/* CLASS */
)), [
[unref(ClickOutside), handleTimePickClose]
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
withDirectives(createBaseVNode(
"div",
{
class: normalizeClass([
unref(dpNs).e("header"),
(currentView.value === "year" || currentView.value === "month") && unref(dpNs).em("header", "bordered")
])
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(dpNs).e("prev-btn"))
},
[
createBaseVNode("button", {
type: "button",
"aria-label": unref(t)(`el.datepicker.prevYear`),
class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]),
disabled: unref(dateDisabled),
onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_215),
withDirectives(createBaseVNode("button", {
type: "button",
"aria-label": unref(t)(`el.datepicker.prevMonth`),
class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
disabled: unref(dateDisabled),
onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
}, [
renderSlot(_ctx.$slots, "prev-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_35), [
[vShow, currentView.value === "date"]
])
],
2
/* CLASS */
),
createBaseVNode("span", {
role: "button",
class: normalizeClass(unref(dpNs).e("header-label")),
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
onKeydown: _cache[4] || (_cache[4] = withKeys(($event) => showPicker("year"), ["enter"])),
onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
}, toDisplayString(yearLabel.value), 43, _hoisted_42),
withDirectives(createBaseVNode("span", {
role: "button",
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
class: normalizeClass([
unref(dpNs).e("header-label"),
{ active: currentView.value === "month" }
]),
onKeydown: _cache[6] || (_cache[6] = withKeys(($event) => showPicker("month"), ["enter"])),
onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
}, toDisplayString(unref(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_52), [
[vShow, currentView.value === "date"]
]),
createBaseVNode(
"span",
{
class: normalizeClass(unref(dpNs).e("next-btn"))
},
[
withDirectives(createBaseVNode("button", {
type: "button",
"aria-label": unref(t)(`el.datepicker.nextMonth`),
class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
disabled: unref(dateDisabled),
onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
}, [
renderSlot(_ctx.$slots, "next-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_62), [
[vShow, currentView.value === "date"]
]),
createBaseVNode("button", {
type: "button",
"aria-label": unref(t)(`el.datepicker.nextYear`),
class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
disabled: unref(dateDisabled),
onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_7)
],
2
/* CLASS */
)
],
2
/* CLASS */
), [
[vShow, currentView.value !== "time"]
]),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("content")),
onKeydown: handleKeydownTable
},
[
currentView.value === "date" ? (openBlock(), createBlock(_sfc_main67, {
key: 0,
ref_key: "currentViewRef",
ref: currentViewRef,
"selection-mode": selectionMode.value,
date: innerDate.value,
"parsed-value": _ctx.parsedValue,
"disabled-date": unref(disabledDate),
disabled: unref(dateDisabled),
"cell-class-name": unref(cellClassName),
"show-week-number": _ctx.showWeekNumber,
onPick: handleDatePick
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name", "show-week-number"])) : createCommentVNode("v-if", true),
currentView.value === "year" ? (openBlock(), createBlock(_sfc_main69, {
key: 1,
ref_key: "currentViewRef",
ref: currentViewRef,
"selection-mode": selectionMode.value,
date: innerDate.value,
"disabled-date": unref(disabledDate),
disabled: unref(dateDisabled),
"parsed-value": _ctx.parsedValue,
"cell-class-name": unref(cellClassName),
onPick: handleYearPick
}, null, 8, ["selection-mode", "date", "disabled-date", "disabled", "parsed-value", "cell-class-name"])) : createCommentVNode("v-if", true),
currentView.value === "month" ? (openBlock(), createBlock(_sfc_main68, {
key: 2,
ref_key: "currentViewRef",
ref: currentViewRef,
"selection-mode": selectionMode.value,
date: innerDate.value,
"parsed-value": _ctx.parsedValue,
"disabled-date": unref(disabledDate),
disabled: unref(dateDisabled),
"cell-class-name": unref(cellClassName),
onPick: handleMonthPick
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name"])) : createCommentVNode("v-if", true)
],
34
/* CLASS, NEED_HYDRATION */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
),
_ctx.showFooter && footerVisible.value && footerFilled.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("footer"))
},
[
withDirectives(createVNode(unref(ElButton), {
text: "",
size: "small",
class: normalizeClass(unref(ppNs).e("link-btn")),
disabled: disabledNow.value,
onClick: changeToNow
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.now")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class", "disabled"]), [
[vShow, !isMultipleType.value && _ctx.showNow]
]),
_ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
key: 0,
plain: "",
size: "small",
class: normalizeClass(unref(ppNs).e("link-btn")),
disabled: disabledConfirm.value,
onClick: onConfirm
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.confirm")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue2.mjs
var import_dayjs15 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/panel-date-range.mjs
var panelDateRangeProps = buildProps({
...panelSharedProps,
...panelRangeSharedProps
});
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-range-picker.mjs
var import_dayjs14 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-shortcut.mjs
var import_dayjs13 = __toESM(require_dayjs_min(), 1);
var useShortcut = (lang) => {
const { emit } = getCurrentInstance();
const attrs = useAttrs();
const slots = useSlots();
const handleShortcutClick = (shortcut) => {
const shortcutValues = isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
if (shortcutValues) {
emit("pick", [
(0, import_dayjs13.default)(shortcutValues[0]).locale(lang.value),
(0, import_dayjs13.default)(shortcutValues[1]).locale(lang.value)
]);
return;
}
if (shortcut.onClick) {
shortcut.onClick({
attrs,
slots,
emit
});
}
};
return handleShortcutClick;
};
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-range-picker.mjs
var useRangePicker = (props2, {
defaultValue,
defaultTime,
leftDate,
rightDate,
step: step2,
unit: unit4,
sortDates
}) => {
const { emit } = getCurrentInstance();
const { pickerNs } = inject(ROOT_PICKER_INJECTION_KEY);
const drpNs = useNamespace("date-range-picker");
const { t, lang } = useLocale();
const handleShortcutClick = useShortcut(lang);
const minDate = ref();
const maxDate = ref();
const rangeState = ref({
endDate: null,
selecting: false
});
const handleChangeRange = (val) => {
rangeState.value = val;
};
const handleRangeConfirm = (visible = false) => {
const _minDate = unref(minDate);
const _maxDate = unref(maxDate);
if (isValidRange2([_minDate, _maxDate])) {
emit("pick", [_minDate, _maxDate], visible);
}
};
const onSelect = (selecting) => {
rangeState.value.selecting = selecting;
if (!selecting) {
rangeState.value.endDate = null;
}
};
const parseValue = (parsedValue) => {
if (isArray(parsedValue) && parsedValue.length === 2) {
const [start, end] = parsedValue;
minDate.value = start;
leftDate.value = start;
maxDate.value = end;
sortDates(unref(minDate), unref(maxDate));
} else {
restoreDefault();
}
};
const restoreDefault = () => {
let [start, end] = getDefaultValue(unref(defaultValue), {
lang: unref(lang),
step: step2,
unit: unit4,
unlinkPanels: props2.unlinkPanels
});
const getShift = (day) => {
return day.diff(day.startOf("d"), "ms");
};
const maybeTimes = unref(defaultTime);
if (maybeTimes) {
let leftShift = 0;
let rightShift = 0;
if (isArray(maybeTimes)) {
const [timeStart, timeEnd] = maybeTimes.map(import_dayjs14.default);
leftShift = getShift(timeStart);
rightShift = getShift(timeEnd);
} else {
const shift3 = getShift((0, import_dayjs14.default)(maybeTimes));
leftShift = shift3;
rightShift = shift3;
}
start = start.startOf("d").add(leftShift, "ms");
end = end.startOf("d").add(rightShift, "ms");
}
minDate.value = void 0;
maxDate.value = void 0;
leftDate.value = start;
rightDate.value = end;
};
watch(
defaultValue,
(val) => {
if (val) {
restoreDefault();
}
},
{ immediate: true }
);
watch(
() => props2.parsedValue,
(parsedValue) => {
if (!(parsedValue == null ? void 0 : parsedValue.length) || !isEqual_default(parsedValue, [minDate.value, maxDate.value])) {
parseValue(parsedValue);
}
},
{
immediate: true
}
);
watch(
() => props2.visible,
() => {
if (props2.visible) {
parseValue(props2.parsedValue);
}
},
{ immediate: true }
);
return {
minDate,
maxDate,
rangeState,
lang,
ppNs: pickerNs,
drpNs,
handleChangeRange,
handleRangeConfirm,
handleShortcutClick,
onSelect,
parseValue,
t
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-panel-date-range.mjs
var usePanelDateRange = (props2, emit, leftDate, rightDate) => {
const leftCurrentView = ref("date");
const leftCurrentViewRef = ref();
const rightCurrentView = ref("date");
const rightCurrentViewRef = ref();
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const { disabledDate } = pickerBase.props;
const { t, lang } = useLocale();
const leftYear = computed(() => {
return leftDate.value.year();
});
const leftMonth = computed(() => {
return leftDate.value.month();
});
const rightYear = computed(() => {
return rightDate.value.year();
});
const rightMonth = computed(() => {
return rightDate.value.month();
});
function computedYearLabel(currentView, yearValue) {
const yearTranslation = t("el.datepicker.year");
if (currentView.value === "year") {
const startYear = Math.floor(yearValue.value / 10) * 10;
return yearTranslation ? `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}` : `${startYear} - ${startYear + 9}`;
}
return `${yearValue.value} ${yearTranslation}`;
}
function focusPicker(currentViewRef) {
currentViewRef == null ? void 0 : currentViewRef.focus();
}
async function showPicker(pickerType, view) {
if (props2.disabled) return;
const currentView = pickerType === "left" ? leftCurrentView : rightCurrentView;
const currentViewRef = pickerType === "left" ? leftCurrentViewRef : rightCurrentViewRef;
currentView.value = view;
await nextTick();
focusPicker(currentViewRef.value);
}
async function handlePick(mode, pickerType, value) {
if (props2.disabled) return;
const isLeftPicker = pickerType === "left";
const startDate = isLeftPicker ? leftDate : rightDate;
const endDate = isLeftPicker ? rightDate : leftDate;
const currentView = isLeftPicker ? leftCurrentView : rightCurrentView;
const currentViewRef = isLeftPicker ? leftCurrentViewRef : rightCurrentViewRef;
if (mode === "year") {
const data = startDate.value.year(value);
startDate.value = getValidDateOfYear(data, lang.value, disabledDate);
}
if (mode === "month") {
startDate.value = getValidDateOfMonth(
startDate.value,
startDate.value.year(),
value,
lang.value,
disabledDate
);
}
if (!props2.unlinkPanels) {
endDate.value = pickerType === "left" ? startDate.value.add(1, "month") : startDate.value.subtract(1, "month");
}
currentView.value = mode === "year" ? "month" : "date";
await nextTick();
focusPicker(currentViewRef.value);
handlePanelChange(mode);
}
function handlePanelChange(mode) {
emit(
"panel-change",
[leftDate.value.toDate(), rightDate.value.toDate()],
mode
);
}
function adjustDateByView(currentView, date, forward) {
const action = forward ? "add" : "subtract";
return currentView === "year" ? date[action](10, "year") : date[action](1, "year");
}
return {
leftCurrentView,
rightCurrentView,
leftCurrentViewRef,
rightCurrentViewRef,
leftYear,
rightYear,
leftMonth,
rightMonth,
leftYearLabel: computed(() => computedYearLabel(leftCurrentView, leftYear)),
rightYearLabel: computed(
() => computedYearLabel(rightCurrentView, rightYear)
),
showLeftPicker: (view) => showPicker("left", view),
showRightPicker: (view) => showPicker("right", view),
handleLeftYearPick: (year) => handlePick("year", "left", year),
handleRightYearPick: (year) => handlePick("year", "right", year),
handleLeftMonthPick: (month) => handlePick("month", "left", month),
handleRightMonthPick: (month) => handlePick("month", "right", month),
handlePanelChange,
adjustDateByView
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue2.mjs
var _hoisted_132 = ["disabled", "onClick"];
var _hoisted_216 = ["aria-label", "disabled"];
var _hoisted_36 = ["aria-label", "disabled"];
var _hoisted_43 = ["disabled", "aria-label"];
var _hoisted_53 = ["disabled", "aria-label"];
var _hoisted_63 = ["tabindex", "aria-disabled"];
var _hoisted_72 = ["tabindex", "aria-disabled"];
var _hoisted_8 = ["disabled", "aria-label"];
var _hoisted_9 = ["disabled", "aria-label"];
var _hoisted_10 = ["aria-label", "disabled"];
var _hoisted_11 = ["disabled", "aria-label"];
var _hoisted_1210 = ["tabindex", "aria-disabled"];
var _hoisted_133 = ["tabindex", "aria-disabled"];
var unit = "month";
var _sfc_main71 = defineComponent({
__name: "panel-date-range",
props: panelDateRangeProps,
emits: [
"pick",
"set-picker-option",
"calendar-change",
"panel-change",
"clear"
],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const isDefaultFormat = inject(
ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
void 0
);
const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props;
const format = toRef(pickerBase.props, "format");
const shortcuts = toRef(pickerBase.props, "shortcuts");
const defaultValue = toRef(pickerBase.props, "defaultValue");
const { lang } = useLocale();
const leftDate = ref((0, import_dayjs15.default)().locale(lang.value));
const rightDate = ref((0, import_dayjs15.default)().locale(lang.value).add(1, unit));
const {
minDate,
maxDate,
rangeState,
ppNs,
drpNs,
handleChangeRange,
handleRangeConfirm,
handleShortcutClick,
onSelect,
parseValue,
t
} = useRangePicker(props2, {
defaultValue,
defaultTime,
leftDate,
rightDate,
unit,
sortDates
});
watch(
() => props2.visible,
(visible) => {
if (!visible && rangeState.value.selecting) {
parseValue(props2.parsedValue);
onSelect(false);
}
}
);
const dateUserInput = ref({
min: null,
max: null
});
const timeUserInput = ref({
min: null,
max: null
});
const {
leftCurrentView,
rightCurrentView,
leftCurrentViewRef,
rightCurrentViewRef,
leftYear,
rightYear,
leftMonth,
rightMonth,
leftYearLabel,
rightYearLabel,
showLeftPicker,
showRightPicker,
handleLeftYearPick,
handleRightYearPick,
handleLeftMonthPick,
handleRightMonthPick,
handlePanelChange,
adjustDateByView
} = usePanelDateRange(props2, emit, leftDate, rightDate);
const hasShortcuts = computed(() => !!shortcuts.value.length);
const minVisibleDate = computed(() => {
if (dateUserInput.value.min !== null) return dateUserInput.value.min;
if (minDate.value) return minDate.value.format(dateFormat.value);
return "";
});
const maxVisibleDate = computed(() => {
if (dateUserInput.value.max !== null) return dateUserInput.value.max;
if (maxDate.value || minDate.value)
return (maxDate.value || minDate.value).format(dateFormat.value);
return "";
});
const minVisibleTime = computed(() => {
if (timeUserInput.value.min !== null) return timeUserInput.value.min;
if (minDate.value) return minDate.value.format(timeFormat.value);
return "";
});
const maxVisibleTime = computed(() => {
if (timeUserInput.value.max !== null) return timeUserInput.value.max;
if (maxDate.value || minDate.value)
return (maxDate.value || minDate.value).format(timeFormat.value);
return "";
});
const timeFormat = computed(() => {
return props2.timeFormat || extractTimeFormat(format.value || "") || DEFAULT_FORMATS_TIME;
});
const dateFormat = computed(() => {
return props2.dateFormat || extractDateFormat(format.value || "") || DEFAULT_FORMATS_DATE;
});
const isValidValue3 = (date) => {
return isValidRange2(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
};
const leftPrevYear = () => {
leftDate.value = adjustDateByView(
leftCurrentView.value,
leftDate.value,
false
);
if (!props2.unlinkPanels) {
rightDate.value = leftDate.value.add(1, "month");
}
handlePanelChange("year");
};
const leftPrevMonth = () => {
leftDate.value = leftDate.value.subtract(1, "month");
if (!props2.unlinkPanels) {
rightDate.value = leftDate.value.add(1, "month");
}
handlePanelChange("month");
};
const rightNextYear = () => {
if (!props2.unlinkPanels) {
leftDate.value = adjustDateByView(
rightCurrentView.value,
leftDate.value,
true
);
rightDate.value = leftDate.value.add(1, "month");
} else {
rightDate.value = adjustDateByView(
rightCurrentView.value,
rightDate.value,
true
);
}
handlePanelChange("year");
};
const rightNextMonth = () => {
if (!props2.unlinkPanels) {
leftDate.value = leftDate.value.add(1, "month");
rightDate.value = leftDate.value.add(1, "month");
} else {
rightDate.value = rightDate.value.add(1, "month");
}
handlePanelChange("month");
};
const leftNextYear = () => {
leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, true);
handlePanelChange("year");
};
const leftNextMonth = () => {
leftDate.value = leftDate.value.add(1, "month");
handlePanelChange("month");
};
const rightPrevYear = () => {
rightDate.value = adjustDateByView(
rightCurrentView.value,
rightDate.value,
false
);
handlePanelChange("year");
};
const rightPrevMonth = () => {
rightDate.value = rightDate.value.subtract(1, "month");
handlePanelChange("month");
};
const enableMonthArrow = computed(() => {
const nextMonth = (leftMonth.value + 1) % 12;
const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0;
return props2.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value);
});
const enableYearArrow = computed(() => {
return props2.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12;
});
const dateRangeDisabled = useFormDisabled();
const btnDisabled = computed(() => {
return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange2([minDate.value, maxDate.value]) && !dateRangeDisabled.value);
});
const showTime = computed(
() => props2.type === "datetime" || props2.type === "datetimerange"
);
const formatEmit = (emitDayjs, index) => {
if (!emitDayjs) return;
if (defaultTime) {
const defaultTimeD = (0, import_dayjs15.default)(
defaultTime[index] || defaultTime
).locale(lang.value);
return defaultTimeD.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
}
return emitDayjs;
};
const handleRangePick = (val, close2 = true) => {
const min_ = val.minDate;
const max_ = val.maxDate;
const minDate_ = formatEmit(min_, 0);
const maxDate_ = formatEmit(max_, 1);
if (maxDate.value === maxDate_ && minDate.value === minDate_) {
return;
}
emit("calendar-change", [min_.toDate(), max_ && max_.toDate()]);
maxDate.value = maxDate_;
minDate.value = minDate_;
if (!showTime.value && close2) {
close2 = !minDate_ || !maxDate_;
}
handleRangeConfirm(close2);
};
const minTimePickerVisible = ref(false);
const maxTimePickerVisible = ref(false);
const handleMinTimeClose = () => {
minTimePickerVisible.value = false;
};
const handleMaxTimeClose = () => {
maxTimePickerVisible.value = false;
};
const handleDateInput = (value, type) => {
dateUserInput.value[type] = value;
const parsedValueD = (0, import_dayjs15.default)(value, dateFormat.value).locale(lang.value);
if (parsedValueD.isValid()) {
if (disabledDate && disabledDate(parsedValueD.toDate())) {
return;
}
if (type === "min") {
leftDate.value = parsedValueD;
minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
if (!props2.unlinkPanels && (!maxDate.value || maxDate.value.isBefore(minDate.value))) {
rightDate.value = parsedValueD.add(1, "month");
maxDate.value = minDate.value.add(1, "month");
}
} else {
rightDate.value = parsedValueD;
maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
if (!props2.unlinkPanels && (!minDate.value || minDate.value.isAfter(maxDate.value))) {
leftDate.value = parsedValueD.subtract(1, "month");
minDate.value = maxDate.value.subtract(1, "month");
}
}
sortDates(minDate.value, maxDate.value);
handleRangeConfirm(true);
}
};
const handleDateChange = (_2, type) => {
dateUserInput.value[type] = null;
};
const handleTimeInput = (value, type) => {
timeUserInput.value[type] = value;
const parsedValueD = (0, import_dayjs15.default)(value, timeFormat.value).locale(lang.value);
if (parsedValueD.isValid()) {
if (type === "min") {
minTimePickerVisible.value = true;
minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
leftDate.value = minDate.value;
} else {
maxTimePickerVisible.value = true;
maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
rightDate.value = maxDate.value;
}
}
};
const handleTimeChange = (_value, type) => {
timeUserInput.value[type] = null;
if (type === "min") {
leftDate.value = minDate.value;
minTimePickerVisible.value = false;
if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
maxDate.value = minDate.value;
}
} else {
rightDate.value = maxDate.value;
maxTimePickerVisible.value = false;
if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
minDate.value = maxDate.value;
}
}
handleRangeConfirm(true);
};
const handleMinTimePick = (value, visible, first) => {
if (timeUserInput.value.min) return;
if (value) {
minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
}
if (!first) {
minTimePickerVisible.value = visible;
}
if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
maxDate.value = minDate.value;
rightDate.value = value;
nextTick(() => {
parseValue(props2.parsedValue);
});
}
handleRangeConfirm(true);
};
const handleMaxTimePick = (value, visible, first) => {
if (timeUserInput.value.max) return;
if (value) {
maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
}
if (!first) {
maxTimePickerVisible.value = visible;
}
if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
minDate.value = maxDate.value;
}
handleRangeConfirm(true);
};
const onClear = () => {
handleClear();
emit("clear");
};
const handleClear = () => {
let valueOnClear = null;
if (pickerBase == null ? void 0 : pickerBase.emptyValues) {
valueOnClear = pickerBase.emptyValues.valueOnClear.value;
}
leftDate.value = getDefaultValue(unref(defaultValue), {
lang: unref(lang),
unit: "month",
unlinkPanels: props2.unlinkPanels
})[0];
rightDate.value = leftDate.value.add(1, "month");
maxDate.value = void 0;
minDate.value = void 0;
handleRangeConfirm(true);
emit("pick", valueOnClear);
};
const parseUserInput = (value) => {
return correctlyParseUserInput(
value,
format.value || "",
lang.value,
isDefaultFormat
);
};
function sortDates(minDate2, maxDate2) {
if (props2.unlinkPanels && maxDate2) {
const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
const minDateMonth = (minDate2 == null ? void 0 : minDate2.month()) || 0;
const maxDateYear = maxDate2.year();
const maxDateMonth = maxDate2.month();
rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate2.add(1, unit) : maxDate2;
} else {
rightDate.value = leftDate.value.add(1, unit);
if (maxDate2) {
rightDate.value = rightDate.value.hour(maxDate2.hour()).minute(maxDate2.minute()).second(maxDate2.second());
}
}
}
emit("set-picker-option", ["isValidValue", isValidValue3]);
emit("set-picker-option", ["parseUserInput", parseUserInput]);
emit("set-picker-option", ["handleClear", handleClear]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ppNs).b(),
unref(drpNs).b(),
unref(ppNs).is("border", _ctx.border),
unref(ppNs).is("disabled", unref(dateRangeDisabled)),
{
"has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
"has-time": showTime.value
}
])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body-wrapper"))
},
[
renderSlot(_ctx.$slots, "sidebar", {
class: normalizeClass(unref(ppNs).e("sidebar"))
}),
hasShortcuts.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("sidebar"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(shortcuts.value, (shortcut, key) => {
return openBlock(), createElementBlock("button", {
key,
type: "button",
disabled: unref(dateRangeDisabled),
class: normalizeClass(unref(ppNs).e("shortcut")),
onClick: ($event) => unref(handleShortcutClick)(shortcut)
}, toDisplayString(shortcut.text), 11, _hoisted_132);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body"))
},
[
showTime.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(drpNs).e("time-header"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(drpNs).e("editors-wrap"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
},
[
createVNode(unref(ElInput), {
size: "small",
disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
placeholder: unref(t)("el.datepicker.startDate"),
class: normalizeClass(unref(drpNs).e("editor")),
"model-value": minVisibleDate.value,
"validate-event": false,
readonly: !_ctx.editable,
onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")),
onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min"))
}, null, 8, ["disabled", "placeholder", "class", "model-value", "readonly"])
],
2
/* CLASS */
),
withDirectives((openBlock(), createElementBlock(
"span",
{
class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
},
[
createVNode(unref(ElInput), {
size: "small",
class: normalizeClass(unref(drpNs).e("editor")),
disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
placeholder: unref(t)("el.datepicker.startTime"),
"model-value": minVisibleTime.value,
"validate-event": false,
readonly: !_ctx.editable,
onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true),
onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")),
onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min"))
}, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"]),
createVNode(unref(_sfc_main65), {
visible: minTimePickerVisible.value,
format: timeFormat.value,
"datetime-role": "start",
"parsed-value": unref(minDate) || leftDate.value,
onPick: handleMinTimePick
}, null, 8, ["visible", "format", "parsed-value"])
],
2
/* CLASS */
)), [
[unref(ClickOutside), handleMinTimeClose]
])
],
2
/* CLASS */
),
createBaseVNode("span", null, [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
]),
createBaseVNode(
"span",
{
class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"])
},
[
createBaseVNode(
"span",
{
class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
},
[
createVNode(unref(ElInput), {
size: "small",
class: normalizeClass(unref(drpNs).e("editor")),
disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
placeholder: unref(t)("el.datepicker.endDate"),
"model-value": maxVisibleDate.value,
readonly: !unref(minDate) || !_ctx.editable,
"validate-event": false,
onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")),
onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max"))
}, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"])
],
2
/* CLASS */
),
withDirectives((openBlock(), createElementBlock(
"span",
{
class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
},
[
createVNode(unref(ElInput), {
size: "small",
class: normalizeClass(unref(drpNs).e("editor")),
disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
placeholder: unref(t)("el.datepicker.endTime"),
"model-value": maxVisibleTime.value,
readonly: !unref(minDate) || !_ctx.editable,
"validate-event": false,
onFocus: _cache[7] || (_cache[7] = ($event) => unref(minDate) && (maxTimePickerVisible.value = true)),
onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")),
onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max"))
}, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"]),
createVNode(unref(_sfc_main65), {
"datetime-role": "end",
visible: maxTimePickerVisible.value,
format: timeFormat.value,
"parsed-value": unref(maxDate) || rightDate.value,
onPick: handleMaxTimePick
}, null, 8, ["visible", "format", "parsed-value"])
],
2
/* CLASS */
)), [
[unref(ClickOutside), handleMaxTimeClose]
])
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
"aria-label": unref(t)(`el.datepicker.prevYear`),
disabled: unref(dateRangeDisabled),
onClick: leftPrevYear
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_216),
withDirectives(createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
"aria-label": unref(t)(`el.datepicker.prevMonth`),
disabled: unref(dateRangeDisabled),
onClick: leftPrevMonth
}, [
renderSlot(_ctx.$slots, "prev-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_36), [
[vShow, unref(leftCurrentView) === "date"]
]),
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(dateRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))
], "d-arrow-right"]),
"aria-label": unref(t)(`el.datepicker.nextYear`),
onClick: leftNextYear
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_43)) : createCommentVNode("v-if", true),
_ctx.unlinkPanels && unref(leftCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
key: 1,
type: "button",
disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))
], "arrow-right"]),
"aria-label": unref(t)(`el.datepicker.nextMonth`),
onClick: leftNextMonth
}, [
renderSlot(_ctx.$slots, "next-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_53)) : createCommentVNode("v-if", true),
createBaseVNode("div", null, [
createBaseVNode("span", {
role: "button",
class: normalizeClass(unref(drpNs).e("header-label")),
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
onKeydown: _cache[10] || (_cache[10] = withKeys(($event) => unref(showLeftPicker)("year"), ["enter"])),
onClick: _cache[11] || (_cache[11] = ($event) => unref(showLeftPicker)("year"))
}, toDisplayString(unref(leftYearLabel)), 43, _hoisted_63),
withDirectives(createBaseVNode("span", {
role: "button",
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
class: normalizeClass([
unref(drpNs).e("header-label"),
{ active: unref(leftCurrentView) === "month" }
]),
onKeydown: _cache[12] || (_cache[12] = withKeys(($event) => unref(showLeftPicker)("month"), ["enter"])),
onClick: _cache[13] || (_cache[13] = ($event) => unref(showLeftPicker)("month"))
}, toDisplayString(unref(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, _hoisted_72), [
[vShow, unref(leftCurrentView) === "date"]
])
])
],
2
/* CLASS */
),
unref(leftCurrentView) === "date" ? (openBlock(), createBlock(_sfc_main67, {
key: 0,
ref_key: "leftCurrentViewRef",
ref: leftCurrentViewRef,
"selection-mode": "range",
date: leftDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
"cell-class-name": unref(cellClassName),
"show-week-number": _ctx.showWeekNumber,
disabled: unref(dateRangeDisabled),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
unref(leftCurrentView) === "year" ? (openBlock(), createBlock(_sfc_main69, {
key: 1,
ref_key: "leftCurrentViewRef",
ref: leftCurrentViewRef,
"selection-mode": "year",
date: leftDate.value,
"disabled-date": unref(disabledDate),
"parsed-value": _ctx.parsedValue,
disabled: unref(dateRangeDisabled),
onPick: unref(handleLeftYearPick)
}, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
unref(leftCurrentView) === "month" ? (openBlock(), createBlock(_sfc_main68, {
key: 2,
ref_key: "leftCurrentViewRef",
ref: leftCurrentViewRef,
"selection-mode": "month",
date: leftDate.value,
"parsed-value": _ctx.parsedValue,
"disabled-date": unref(disabledDate),
disabled: unref(dateRangeDisabled),
onPick: unref(handleLeftMonthPick)
}, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(dateRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))
], "d-arrow-left"]),
"aria-label": unref(t)(`el.datepicker.prevYear`),
onClick: rightPrevYear
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_8)) : createCommentVNode("v-if", true),
_ctx.unlinkPanels && unref(rightCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
key: 1,
type: "button",
disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))
], "arrow-left"]),
"aria-label": unref(t)(`el.datepicker.prevMonth`),
onClick: rightPrevMonth
}, [
renderSlot(_ctx.$slots, "prev-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_9)) : createCommentVNode("v-if", true),
createBaseVNode("button", {
type: "button",
"aria-label": unref(t)(`el.datepicker.nextYear`),
class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
disabled: unref(dateRangeDisabled),
onClick: rightNextYear
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_10),
withDirectives(createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
disabled: unref(dateRangeDisabled),
"aria-label": unref(t)(`el.datepicker.nextMonth`),
onClick: rightNextMonth
}, [
renderSlot(_ctx.$slots, "next-month", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_11), [
[vShow, unref(rightCurrentView) === "date"]
]),
createBaseVNode("div", null, [
createBaseVNode("span", {
role: "button",
class: normalizeClass(unref(drpNs).e("header-label")),
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
onKeydown: _cache[14] || (_cache[14] = withKeys(($event) => unref(showRightPicker)("year"), ["enter"])),
onClick: _cache[15] || (_cache[15] = ($event) => unref(showRightPicker)("year"))
}, toDisplayString(unref(rightYearLabel)), 43, _hoisted_1210),
withDirectives(createBaseVNode("span", {
role: "button",
"aria-live": "polite",
tabindex: _ctx.disabled ? void 0 : 0,
"aria-disabled": _ctx.disabled,
class: normalizeClass([
unref(drpNs).e("header-label"),
{ active: unref(rightCurrentView) === "month" }
]),
onKeydown: _cache[16] || (_cache[16] = withKeys(($event) => unref(showRightPicker)("month"), ["enter"])),
onClick: _cache[17] || (_cache[17] = ($event) => unref(showRightPicker)("month"))
}, toDisplayString(unref(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, _hoisted_133), [
[vShow, unref(rightCurrentView) === "date"]
])
])
],
2
/* CLASS */
),
unref(rightCurrentView) === "date" ? (openBlock(), createBlock(_sfc_main67, {
key: 0,
ref_key: "rightCurrentViewRef",
ref: rightCurrentViewRef,
"selection-mode": "range",
date: rightDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
"cell-class-name": unref(cellClassName),
"show-week-number": _ctx.showWeekNumber,
disabled: unref(dateRangeDisabled),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
unref(rightCurrentView) === "year" ? (openBlock(), createBlock(_sfc_main69, {
key: 1,
ref_key: "rightCurrentViewRef",
ref: rightCurrentViewRef,
"selection-mode": "year",
date: rightDate.value,
"disabled-date": unref(disabledDate),
"parsed-value": _ctx.parsedValue,
disabled: unref(dateRangeDisabled),
onPick: unref(handleRightYearPick)
}, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
unref(rightCurrentView) === "month" ? (openBlock(), createBlock(_sfc_main68, {
key: 2,
ref_key: "rightCurrentViewRef",
ref: rightCurrentViewRef,
"selection-mode": "month",
date: rightDate.value,
"parsed-value": _ctx.parsedValue,
"disabled-date": unref(disabledDate),
disabled: unref(dateRangeDisabled),
onPick: unref(handleRightMonthPick)
}, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
),
_ctx.showFooter && showTime.value && (_ctx.showConfirm || unref(clearable)) ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("footer"))
},
[
unref(clearable) ? (openBlock(), createBlock(unref(ElButton), {
key: 0,
text: "",
size: "small",
class: normalizeClass(unref(ppNs).e("link-btn")),
onClick: onClear
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.clear")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
_ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
key: 1,
plain: "",
size: "small",
class: normalizeClass(unref(ppNs).e("link-btn")),
disabled: btnDisabled.value,
onClick: _cache[18] || (_cache[18] = ($event) => unref(handleRangeConfirm)(false))
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(t)("el.datepicker.confirm")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue2.mjs
var import_dayjs16 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/panel-month-range.mjs
var panelMonthRangeProps = buildProps({
...panelRangeSharedProps
});
var panelMonthRangeEmits = [
"pick",
"set-picker-option",
"calendar-change"
];
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-month-range-header.mjs
var useMonthRangeHeader = ({
unlinkPanels,
leftDate,
rightDate
}) => {
const { t } = useLocale();
const leftPrevYear = () => {
leftDate.value = leftDate.value.subtract(1, "year");
if (!unlinkPanels.value) {
rightDate.value = rightDate.value.subtract(1, "year");
}
};
const rightNextYear = () => {
if (!unlinkPanels.value) {
leftDate.value = leftDate.value.add(1, "year");
}
rightDate.value = rightDate.value.add(1, "year");
};
const leftNextYear = () => {
leftDate.value = leftDate.value.add(1, "year");
};
const rightPrevYear = () => {
rightDate.value = rightDate.value.subtract(1, "year");
};
const leftLabel = computed(() => {
return `${leftDate.value.year()} ${t("el.datepicker.year")}`;
});
const rightLabel = computed(() => {
return `${rightDate.value.year()} ${t("el.datepicker.year")}`;
});
const leftYear = computed(() => {
return leftDate.value.year();
});
const rightYear = computed(() => {
return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year();
});
return {
leftPrevYear,
rightNextYear,
leftNextYear,
rightPrevYear,
leftLabel,
rightLabel,
leftYear,
rightYear
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue2.mjs
var _hoisted_134 = ["disabled", "onClick"];
var _hoisted_217 = ["disabled"];
var _hoisted_37 = ["disabled"];
var _hoisted_44 = ["disabled"];
var _hoisted_54 = ["disabled"];
var unit2 = "year";
var _sfc_main72 = defineComponent({
...{
name: "DatePickerMonthRange"
},
__name: "panel-month-range",
props: panelMonthRangeProps,
emits: panelMonthRangeEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { lang } = useLocale();
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const isDefaultFormat = inject(
ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
void 0
);
const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
const format = toRef(pickerBase.props, "format");
const defaultValue = toRef(pickerBase.props, "defaultValue");
const leftDate = ref((0, import_dayjs16.default)().locale(lang.value));
const rightDate = ref((0, import_dayjs16.default)().locale(lang.value).add(1, unit2));
const {
minDate,
maxDate,
rangeState,
ppNs,
drpNs,
handleChangeRange,
handleRangeConfirm,
handleShortcutClick,
onSelect,
parseValue
} = useRangePicker(props2, {
defaultValue,
leftDate,
rightDate,
unit: unit2,
sortDates
});
const hasShortcuts = computed(() => !!shortcuts.length);
const {
leftPrevYear,
rightNextYear,
leftNextYear,
rightPrevYear,
leftLabel,
rightLabel,
leftYear,
rightYear
} = useMonthRangeHeader({
unlinkPanels: toRef(props2, "unlinkPanels"),
leftDate,
rightDate
});
const enableYearArrow = computed(() => {
return props2.unlinkPanels && rightYear.value > leftYear.value + 1;
});
const handleRangePick = (val, close2 = true) => {
const minDate_ = val.minDate;
const maxDate_ = val.maxDate;
if (maxDate.value === maxDate_ && minDate.value === minDate_) {
return;
}
emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
maxDate.value = maxDate_;
minDate.value = minDate_;
if (!close2) return;
handleRangeConfirm();
};
const handleClear = () => {
let valueOnClear = null;
if (pickerBase == null ? void 0 : pickerBase.emptyValues) {
valueOnClear = pickerBase.emptyValues.valueOnClear.value;
}
leftDate.value = getDefaultValue(unref(defaultValue), {
lang: unref(lang),
unit: "year",
unlinkPanels: props2.unlinkPanels
})[0];
rightDate.value = leftDate.value.add(1, "year");
emit("pick", valueOnClear);
};
const parseUserInput = (value) => {
return correctlyParseUserInput(
value,
format.value,
lang.value,
isDefaultFormat
);
};
function sortDates(minDate2, maxDate2) {
if (props2.unlinkPanels && maxDate2) {
const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
const maxDateYear = maxDate2.year();
rightDate.value = minDateYear === maxDateYear ? maxDate2.add(1, unit2) : maxDate2;
} else {
rightDate.value = leftDate.value.add(1, unit2);
}
}
const monthRangeDisabled = useFormDisabled();
watch(
() => props2.visible,
(visible) => {
if (!visible && rangeState.value.selecting) {
parseValue(props2.parsedValue);
onSelect(false);
}
}
);
emit("set-picker-option", ["isValidValue", isValidRange2]);
emit("set-picker-option", ["parseUserInput", parseUserInput]);
emit("set-picker-option", ["handleClear", handleClear]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ppNs).b(),
unref(drpNs).b(),
unref(ppNs).is("border", _ctx.border),
unref(ppNs).is("disabled", unref(monthRangeDisabled)),
{
"has-sidebar": Boolean(_ctx.$slots.sidebar) || hasShortcuts.value
}
])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body-wrapper"))
},
[
renderSlot(_ctx.$slots, "sidebar", {
class: normalizeClass(unref(ppNs).e("sidebar"))
}),
hasShortcuts.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("sidebar"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(shortcuts), (shortcut, key) => {
return openBlock(), createElementBlock("button", {
key,
type: "button",
class: normalizeClass(unref(ppNs).e("shortcut")),
disabled: unref(monthRangeDisabled),
onClick: ($event) => unref(handleShortcutClick)(shortcut)
}, toDisplayString(shortcut.text), 11, _hoisted_134);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
disabled: unref(monthRangeDisabled),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_217),
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(monthRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))
], "d-arrow-right"]),
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_37)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
null,
toDisplayString(unref(leftLabel)),
1
/* TEXT */
)
],
2
/* CLASS */
),
createVNode(_sfc_main68, {
"selection-mode": "range",
date: leftDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
disabled: unref(monthRangeDisabled),
"cell-class-name": unref(cellClassName),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(monthRangeDisabled),
class: normalizeClass([[
unref(ppNs).e("icon-btn"),
unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))
], "d-arrow-left"]),
onClick: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_44)) : createCommentVNode("v-if", true),
createBaseVNode("button", {
type: "button",
class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
disabled: unref(monthRangeDisabled),
onClick: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_54),
createBaseVNode(
"div",
null,
toDisplayString(unref(rightLabel)),
1
/* TEXT */
)
],
2
/* CLASS */
),
createVNode(_sfc_main68, {
"selection-mode": "range",
date: rightDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
disabled: unref(monthRangeDisabled),
"cell-class-name": unref(cellClassName),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue2.mjs
var import_dayjs17 = __toESM(require_dayjs_min(), 1);
// node_modules/element-plus/es/components/date-picker-panel/src/props/panel-year-range.mjs
var panelYearRangeProps = buildProps({
...panelRangeSharedProps
});
var panelYearRangeEmits = [
"pick",
"set-picker-option",
"calendar-change"
];
// node_modules/element-plus/es/components/date-picker-panel/src/composables/use-year-range-header.mjs
var useYearRangeHeader = ({
unlinkPanels,
leftDate,
rightDate
}) => {
const leftPrevYear = () => {
leftDate.value = leftDate.value.subtract(10, "year");
if (!unlinkPanels.value) {
rightDate.value = rightDate.value.subtract(10, "year");
}
};
const rightNextYear = () => {
if (!unlinkPanels.value) {
leftDate.value = leftDate.value.add(10, "year");
}
rightDate.value = rightDate.value.add(10, "year");
};
const leftNextYear = () => {
leftDate.value = leftDate.value.add(10, "year");
};
const rightPrevYear = () => {
rightDate.value = rightDate.value.subtract(10, "year");
};
const leftLabel = computed(() => {
const leftStartDate = Math.floor(leftDate.value.year() / 10) * 10;
return `${leftStartDate}-${leftStartDate + 9}`;
});
const rightLabel = computed(() => {
const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
return `${rightStartDate}-${rightStartDate + 9}`;
});
const leftYear = computed(() => {
const leftEndDate = Math.floor(leftDate.value.year() / 10) * 10 + 9;
return leftEndDate;
});
const rightYear = computed(() => {
const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
return rightStartDate;
});
return {
leftPrevYear,
rightNextYear,
leftNextYear,
rightPrevYear,
leftLabel,
rightLabel,
leftYear,
rightYear
};
};
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue2.mjs
var _hoisted_135 = ["disabled", "onClick"];
var _hoisted_218 = ["disabled"];
var _hoisted_38 = ["disabled"];
var _hoisted_45 = ["disabled"];
var _hoisted_55 = ["disabled"];
var step = 10;
var unit3 = "year";
var _sfc_main73 = defineComponent({
...{
name: "DatePickerYearRange"
},
__name: "panel-year-range",
props: panelYearRangeProps,
emits: panelYearRangeEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { lang } = useLocale();
const leftDate = ref((0, import_dayjs17.default)().locale(lang.value));
const rightDate = ref((0, import_dayjs17.default)().locale(lang.value).add(step, unit3));
const isDefaultFormat = inject(
ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
void 0
);
const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
const format = toRef(pickerBase.props, "format");
const defaultValue = toRef(pickerBase.props, "defaultValue");
const {
minDate,
maxDate,
rangeState,
ppNs,
drpNs,
handleChangeRange,
handleRangeConfirm,
handleShortcutClick,
onSelect,
parseValue
} = useRangePicker(props2, {
defaultValue,
leftDate,
rightDate,
step,
unit: unit3,
sortDates
});
const {
leftPrevYear,
rightNextYear,
leftNextYear,
rightPrevYear,
leftLabel,
rightLabel,
leftYear,
rightYear
} = useYearRangeHeader({
unlinkPanels: toRef(props2, "unlinkPanels"),
leftDate,
rightDate
});
const yearRangeDisabled = useFormDisabled();
const hasShortcuts = computed(() => !!shortcuts.length);
const panelKls = computed(() => [
ppNs.b(),
drpNs.b(),
ppNs.is("border", props2.border),
ppNs.is("disabled", yearRangeDisabled.value),
{
"has-sidebar": Boolean(useSlots().sidebar) || hasShortcuts.value
}
]);
const leftPanelKls = computed(() => {
return {
content: [ppNs.e("content"), drpNs.e("content"), "is-left"],
arrowLeftBtn: [ppNs.e("icon-btn"), "d-arrow-left"],
arrowRightBtn: [
ppNs.e("icon-btn"),
ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
"d-arrow-right"
]
};
});
const rightPanelKls = computed(() => {
return {
content: [ppNs.e("content"), drpNs.e("content"), "is-right"],
arrowLeftBtn: [
ppNs.e("icon-btn"),
ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
"d-arrow-left"
],
arrowRightBtn: [ppNs.e("icon-btn"), "d-arrow-right"]
};
});
const enableYearArrow = computed(() => {
return props2.unlinkPanels && rightYear.value > leftYear.value + 1;
});
const handleRangePick = (val, close2 = true) => {
const minDate_ = val.minDate;
const maxDate_ = val.maxDate;
if (maxDate.value === maxDate_ && minDate.value === minDate_) {
return;
}
emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
maxDate.value = maxDate_;
minDate.value = minDate_;
if (!close2) return;
handleRangeConfirm();
};
const parseUserInput = (value) => {
return correctlyParseUserInput(
value,
format.value,
lang.value,
isDefaultFormat
);
};
const isValidValue3 = (date) => {
return isValidRange2(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
};
const handleClear = () => {
let valueOnClear = null;
if (pickerBase == null ? void 0 : pickerBase.emptyValues) {
valueOnClear = pickerBase.emptyValues.valueOnClear.value;
}
const defaultArr = getDefaultValue(unref(defaultValue), {
lang: unref(lang),
step,
unit: unit3,
unlinkPanels: props2.unlinkPanels
});
leftDate.value = defaultArr[0];
rightDate.value = defaultArr[1];
emit("pick", valueOnClear);
};
function sortDates(minDate2, maxDate2) {
if (props2.unlinkPanels && maxDate2) {
const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
const maxDateYear = maxDate2.year();
rightDate.value = minDateYear + step > maxDateYear ? maxDate2.add(step, unit3) : maxDate2;
} else {
rightDate.value = leftDate.value.add(step, unit3);
}
}
watch(
() => props2.visible,
(visible) => {
if (!visible && rangeState.value.selecting) {
parseValue(props2.parsedValue);
onSelect(false);
}
}
);
emit("set-picker-option", ["isValidValue", isValidValue3]);
emit("set-picker-option", ["parseUserInput", parseUserInput]);
emit("set-picker-option", ["handleClear", handleClear]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(panelKls.value)
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body-wrapper"))
},
[
renderSlot(_ctx.$slots, "sidebar", {
class: normalizeClass(unref(ppNs).e("sidebar"))
}),
hasShortcuts.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ppNs).e("sidebar"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(shortcuts), (shortcut, key) => {
return openBlock(), createElementBlock("button", {
key,
type: "button",
class: normalizeClass(unref(ppNs).e("shortcut")),
disabled: unref(yearRangeDisabled),
onClick: ($event) => unref(handleShortcutClick)(shortcut)
}, toDisplayString(shortcut.text), 11, _hoisted_135);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ppNs).e("body"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(leftPanelKls.value.content)
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
createBaseVNode("button", {
type: "button",
class: normalizeClass(leftPanelKls.value.arrowLeftBtn),
disabled: unref(yearRangeDisabled),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_218),
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(yearRangeDisabled),
class: normalizeClass(leftPanelKls.value.arrowRightBtn),
onClick: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_38)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
null,
toDisplayString(unref(leftLabel)),
1
/* TEXT */
)
],
2
/* CLASS */
),
createVNode(_sfc_main69, {
"selection-mode": "range",
date: leftDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
disabled: unref(yearRangeDisabled),
"cell-class-name": unref(cellClassName),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(rightPanelKls.value.content)
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(drpNs).e("header"))
},
[
_ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
key: 0,
type: "button",
disabled: !enableYearArrow.value || unref(yearRangeDisabled),
class: normalizeClass(rightPanelKls.value.arrowLeftBtn),
onClick: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
}, [
renderSlot(_ctx.$slots, "prev-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_left_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_45)) : createCommentVNode("v-if", true),
createBaseVNode("button", {
type: "button",
class: normalizeClass(rightPanelKls.value.arrowRightBtn),
disabled: unref(yearRangeDisabled),
onClick: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
}, [
renderSlot(_ctx.$slots, "next-year", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(d_arrow_right_default))
]),
_: 1
/* STABLE */
})
])
], 10, _hoisted_55),
createBaseVNode(
"div",
null,
toDisplayString(unref(rightLabel)),
1
/* TEXT */
)
],
2
/* CLASS */
),
createVNode(_sfc_main69, {
"selection-mode": "range",
date: rightDate.value,
"min-date": unref(minDate),
"max-date": unref(maxDate),
"range-state": unref(rangeState),
"disabled-date": unref(disabledDate),
disabled: unref(yearRangeDisabled),
"cell-class-name": unref(cellClassName),
onChangerange: unref(handleChangeRange),
onPick: handleRangePick,
onSelect: unref(onSelect)
}, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/src/panel-utils.mjs
var getPanel = function(type) {
switch (type) {
case "daterange":
case "datetimerange": {
return _sfc_main71;
}
case "monthrange": {
return _sfc_main72;
}
case "yearrange": {
return _sfc_main73;
}
default: {
return _sfc_main70;
}
}
};
// node_modules/element-plus/es/components/date-picker-panel/src/date-picker-panel.mjs
function _isSlot(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
import_dayjs18.default.extend(import_localeData2.default);
import_dayjs18.default.extend(import_advancedFormat.default);
import_dayjs18.default.extend(import_customParseFormat2.default);
import_dayjs18.default.extend(import_weekOfYear.default);
import_dayjs18.default.extend(import_weekYear.default);
import_dayjs18.default.extend(import_dayOfYear.default);
import_dayjs18.default.extend(import_isSameOrAfter.default);
import_dayjs18.default.extend(import_isSameOrBefore.default);
var DatePickerPanel = defineComponent({
name: "ElDatePickerPanel",
install: null,
inheritAttrs: false,
props: datePickerPanelProps,
emits: [UPDATE_MODEL_EVENT, "calendar-change", "panel-change", "visible-change", "clear"],
setup(props2, {
slots,
emit,
attrs
}) {
const ns = useNamespace("picker-panel");
const pickerInjection = inject(PICKER_BASE_INJECTION_KEY, void 0);
if (isUndefined(pickerInjection)) {
const _props = reactive({
...toRefs(props2)
});
provide(PICKER_BASE_INJECTION_KEY, {
props: _props
});
}
provide(ROOT_PICKER_INJECTION_KEY, {
slots,
pickerNs: ns
});
const {
parsedValue,
onCalendarChange,
onPanelChange,
onSetPickerOption,
onPick
} = inject(ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker(props2, emit), true);
return () => {
const Component = getPanel(props2.type);
return createVNode(Component, mergeProps(omit_default(attrs, "onPick"), props2, {
"parsedValue": parsedValue.value,
"onSet-picker-option": onSetPickerOption,
"onCalendar-change": onCalendarChange,
"onPanel-change": onPanelChange,
"onClear": () => emit("clear"),
"onPick": onPick
}), _isSlot(slots) ? slots : {
default: () => [slots]
});
};
}
});
// node_modules/element-plus/es/components/date-picker-panel/index.mjs
var ElDatePickerPanel = withInstall(DatePickerPanel);
// node_modules/element-plus/es/components/date-picker/src/props.mjs
var datePickerProps = buildProps({
...timePickerDefaultProps,
/**
* @description type of the picker
*/
type: {
type: definePropType(String),
default: "date"
}
});
// node_modules/element-plus/es/components/date-picker/src/date-picker.mjs
function _isSlot2(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var DatePicker = defineComponent({
name: "ElDatePicker",
install: null,
props: datePickerProps,
emits: [UPDATE_MODEL_EVENT],
setup(props2, {
expose,
emit,
slots
}) {
const isDefaultFormat = computed(() => {
return !props2.format;
});
provide(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, isDefaultFormat);
provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, reactive(toRef(props2, "popperOptions")));
const commonPicker = ref();
const refProps = {
focus: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.focus();
},
blur: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.blur();
},
handleOpen: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.handleOpen();
},
handleClose: () => {
var _a;
(_a = commonPicker.value) == null ? void 0 : _a.handleClose();
}
};
expose(refProps);
const onModelValueUpdated = (val) => {
emit(UPDATE_MODEL_EVENT, val);
};
return () => {
var _a;
const format = (_a = props2.format) != null ? _a : DEFAULT_FORMATS_DATEPICKER[props2.type] || DEFAULT_FORMATS_DATE;
return createVNode(_sfc_main63, mergeProps(props2, {
"format": format,
"type": props2.type,
"ref": commonPicker,
"onUpdate:modelValue": onModelValueUpdated
}), {
default: (scopedProps) => createVNode(ElDatePickerPanel, mergeProps({
"disabled": props2.disabled,
"editable": props2.editable,
"border": false
}, scopedProps), _isSlot2(slots) ? slots : {
default: () => [slots]
}),
"range-separator": slots["range-separator"]
});
};
}
});
// node_modules/element-plus/es/components/date-picker/index.mjs
var ElDatePicker = withInstall(DatePicker);
// node_modules/element-plus/es/components/descriptions/src/description.mjs
var descriptionProps = buildProps({
/**
* @description with or without border
*/
border: Boolean,
/**
* @description numbers of `Descriptions Item` in one line
*/
column: {
type: Number,
default: 3
},
/**
* @description direction of list
*/
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
/**
* @description size of list
*/
size: useSizeProp,
/**
* @description title text, display on the top left
*/
title: {
type: String,
default: ""
},
/**
* @description extra text, display on the top right
*/
extra: {
type: String,
default: ""
},
/**
* @description width of every label column
*/
labelWidth: {
type: [String, Number]
}
});
// node_modules/element-plus/es/components/descriptions/src/descriptions-row.mjs
var descriptionsRowProps = buildProps({
row: {
type: definePropType(Array),
default: () => []
}
});
// node_modules/element-plus/es/components/descriptions/src/token.mjs
var descriptionsKey = /* @__PURE__ */ Symbol("elDescriptions");
// node_modules/element-plus/es/components/descriptions/src/descriptions-cell.mjs
var ElDescriptionsCell = defineComponent({
name: "ElDescriptionsCell",
props: {
cell: {
type: Object
},
tag: {
type: String,
default: "td"
},
type: {
type: String
}
},
setup() {
const descriptions = inject(descriptionsKey, {});
return {
descriptions
};
},
render() {
var _a, _b, _c, _d;
const item = getNormalizedProps(
this.cell
);
const directives = (((_a = this.cell) == null ? void 0 : _a.dirs) || []).map((dire) => {
const { dir, arg, modifiers, value } = dire;
return [dir, value, arg, modifiers];
});
const { border, direction: direction2 } = this.descriptions;
const isVertical = direction2 === "vertical";
const renderLabel = () => {
var _a2, _b2, _c2;
return ((_c2 = (_b2 = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b2.label) == null ? void 0 : _c2.call(_b2)) || item.label;
};
const renderContent = () => {
var _a2, _b2, _c2;
return (_c2 = (_b2 = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b2.default) == null ? void 0 : _c2.call(_b2);
};
const span = item.span;
const rowspan = item.rowspan;
const align = item.align ? `is-${item.align}` : "";
const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
const className = item.className;
const labelClassName = item.labelClassName;
const width = this.type === "label" ? (_c = (_b = item.labelWidth) != null ? _b : this.descriptions.labelWidth) != null ? _c : item.width : item.width;
const style = {
width: addUnit(width),
minWidth: addUnit(item.minWidth)
};
const ns = useNamespace("descriptions");
switch (this.type) {
case "label":
return withDirectives(
h(
this.tag,
{
style,
class: [
ns.e("cell"),
ns.e("label"),
ns.is("bordered-label", border),
ns.is("vertical-label", isVertical),
labelAlign,
labelClassName
],
colSpan: isVertical ? span : 1,
rowspan: isVertical ? 1 : rowspan
},
renderLabel()
),
directives
);
case "content":
return withDirectives(
h(
this.tag,
{
style,
class: [
ns.e("cell"),
ns.e("content"),
ns.is("bordered-content", border),
ns.is("vertical-content", isVertical),
align,
className
],
colSpan: isVertical ? span : span * 2 - 1,
rowspan: isVertical ? rowspan * 2 - 1 : rowspan
},
renderContent()
),
directives
);
default: {
const label = renderLabel();
const labelStyle = {};
const width2 = addUnit((_d = item.labelWidth) != null ? _d : this.descriptions.labelWidth);
if (width2) {
labelStyle.width = width2;
labelStyle.display = "inline-block";
}
return withDirectives(
h(
"td",
{
style,
class: [ns.e("cell"), align],
colSpan: span,
rowspan
},
[
!isNil_default(label) ? h(
"span",
{
style: labelStyle,
class: [ns.e("label"), labelClassName]
},
label
) : void 0,
h(
"span",
{
class: [ns.e("content"), className]
},
renderContent()
)
]
),
directives
);
}
}
}
});
// node_modules/element-plus/es/components/descriptions/src/descriptions-row.vue2.mjs
var _hoisted_136 = { key: 1 };
var _sfc_main74 = defineComponent({
...{
name: "ElDescriptionsRow"
},
__name: "descriptions-row",
props: descriptionsRowProps,
setup(__props) {
const descriptions = inject(descriptionsKey, {});
return (_ctx, _cache) => {
return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createBaseVNode("tr", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.row, (cell, _index) => {
return openBlock(), createBlock(unref(ElDescriptionsCell), {
key: `tr1-${_index}`,
cell,
tag: "th",
type: "label"
}, null, 8, ["cell"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
createBaseVNode("tr", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.row, (cell, _index) => {
return openBlock(), createBlock(unref(ElDescriptionsCell), {
key: `tr2-${_index}`,
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"]);
}),
128
/* KEYED_FRAGMENT */
))
])
],
64
/* STABLE_FRAGMENT */
)) : (openBlock(), createElementBlock("tr", _hoisted_136, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.row, (cell, _index) => {
return openBlock(), createElementBlock(
Fragment,
{
key: `tr3-${_index}`
},
[
unref(descriptions).border ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createVNode(unref(ElDescriptionsCell), {
cell,
tag: "td",
type: "label"
}, null, 8, ["cell"]),
createVNode(unref(ElDescriptionsCell), {
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"])
],
64
/* STABLE_FRAGMENT */
)) : (openBlock(), createBlock(unref(ElDescriptionsCell), {
key: 1,
cell,
tag: "td",
type: "both"
}, null, 8, ["cell"]))
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
))
]));
};
}
});
// node_modules/element-plus/es/components/descriptions/src/constants.mjs
var COMPONENT_NAME11 = "ElDescriptionsItem";
// node_modules/element-plus/es/components/descriptions/src/description.vue2.mjs
var _sfc_main75 = defineComponent({
...{
name: "ElDescriptions"
},
__name: "description",
props: descriptionProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("descriptions");
const descriptionsSize = useFormSize();
const slots = useSlots();
provide(descriptionsKey, props2);
const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
const filledNode = (node, span, count, isLast = false) => {
if (!node.props) {
node.props = {};
}
if (span > count) {
node.props.span = count;
}
if (isLast) {
node.props.span = span;
}
return node;
};
const getRows = () => {
if (!slots.default) return [];
const children = flattedChildren(slots.default()).filter(
(node) => {
var _a;
return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === COMPONENT_NAME11;
}
);
const rows = [];
let temp = [];
let count = props2.column;
let totalSpan = 0;
const rowspanTemp = [];
children.forEach((node, index) => {
var _a, _b, _c;
const span = ((_a = node.props) == null ? void 0 : _a.span) || 1;
const rowspan = ((_b = node.props) == null ? void 0 : _b.rowspan) || 1;
const rowNo = rows.length;
rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0);
if (rowspan > 1) {
for (let i = 1; i < rowspan; i++) {
rowspanTemp[_c = rowNo + i] || (rowspanTemp[_c] = 0);
rowspanTemp[rowNo + i]++;
totalSpan++;
}
}
if (rowspanTemp[rowNo] > 0) {
count -= rowspanTemp[rowNo];
rowspanTemp[rowNo] = 0;
}
if (index < children.length - 1) {
totalSpan += span > count ? count : span;
}
if (index === children.length - 1) {
const lastSpan = props2.column - totalSpan % props2.column;
temp.push(filledNode(node, lastSpan, count, true));
rows.push(temp);
return;
}
if (span < count) {
count -= span;
temp.push(node);
} else {
temp.push(filledNode(node, span, count));
rows.push(temp);
count = props2.column;
temp = [];
}
});
return rows;
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(descriptionKls.value)
},
[
__props.title || __props.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("header"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("title"))
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("extra"))
},
[
renderSlot(_ctx.$slots, "extra", {}, () => [
createTextVNode(
toDisplayString(__props.extra),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("body"))
},
[
createBaseVNode(
"table",
{
class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", __props.border)])
},
[
createBaseVNode("tbody", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(getRows(), (row, _index) => {
return openBlock(), createBlock(_sfc_main74, {
key: _index,
row
}, null, 8, ["row"]);
}),
128
/* KEYED_FRAGMENT */
))
])
],
2
/* CLASS */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/constants/column-alignment.mjs
var columnAlignment = ["left", "center", "right"];
// node_modules/element-plus/es/components/descriptions/src/description-item.mjs
var descriptionItemProps = buildProps({
/**
* @description label text
*/
label: {
type: String,
default: ""
},
/**
* @description colspan of column
*/
span: {
type: Number,
default: 1
},
/**
* @description the number of rows a cell should span
*/
rowspan: {
type: Number,
default: 1
},
/**
* @description column width, the width of the same column in different rows is set by the max value (If no `border`, width contains label and content)
*/
width: {
type: [String, Number],
default: ""
},
/**
* @description column minimum width, columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion (If no`border`, width contains label and content)
*/
minWidth: {
type: [String, Number],
default: ""
},
/**
* @description column label width, if not set, it will be the same as the width of the column. Higher priority than the `label-width` of `Descriptions`
*/
labelWidth: {
type: [String, Number]
},
/**
* @description column content alignment (If no `border`, effective for both label and content)
*/
align: {
type: String,
values: columnAlignment,
default: "left"
},
/**
* @description column label alignment, if omitted, the value of the above `align` attribute will be applied (If no `border`, please use `align` attribute)
*/
labelAlign: {
type: String,
values: columnAlignment
},
/**
* @description column content custom class name
*/
className: {
type: String,
default: ""
},
/**
* @description column label custom class name
*/
labelClassName: {
type: String,
default: ""
}
});
var DescriptionItem = defineComponent({
name: COMPONENT_NAME11,
props: descriptionItemProps
});
// node_modules/element-plus/es/components/descriptions/index.mjs
var ElDescriptions = withInstall(_sfc_main75, {
DescriptionsItem: DescriptionItem
});
var ElDescriptionsItem = withNoopInstall(DescriptionItem);
// node_modules/element-plus/es/components/dialog/src/dialog-content.mjs
var dialogContentProps = buildProps({
/**
* @description whether to align the header and footer in center
*/
center: Boolean,
/**
* @description whether to align the dialog both horizontally and vertically
*/
alignCenter: {
type: Boolean,
default: void 0
},
/**
* @description custom close icon, default is Close
*/
closeIcon: {
type: iconPropType
},
/**
* @description enable dragging feature for Dialog
*/
draggable: {
type: Boolean,
default: void 0
},
/**
* @description draggable Dialog can overflow the viewport
*/
overflow: {
type: Boolean,
default: void 0
},
/**
* @description whether the Dialog takes up full screen
*/
fullscreen: Boolean,
/**
* @description custom class names for header wrapper
*/
headerClass: String,
/**
* @description custom class names for body wrapper
*/
bodyClass: String,
/**
* @description custom class names for footer wrapper
*/
footerClass: String,
/**
* @description whether to show a close button
*/
showClose: {
type: Boolean,
default: true
},
/**
* @description title of Dialog. Can also be passed with a named slot (see the following table)
*/
title: {
type: String,
default: ""
},
/**
* @description header's aria-level attribute
*/
ariaLevel: {
type: String,
default: "2"
}
});
var dialogContentEmits = {
close: () => true
};
var dialogContentPropsDefaults = {
alignCenter: void 0,
draggable: void 0,
overflow: void 0,
showClose: true,
title: "",
ariaLevel: "2"
};
// node_modules/element-plus/es/components/dialog/src/dialog.mjs
var dialogProps = buildProps({
...dialogContentProps,
/**
* @description whether to append Dialog itself to body. A nested Dialog should have this attribute set to `true`
*/
appendToBody: Boolean,
/**
* @description which element the Dialog appends to
*/
appendTo: {
type: teleportProps.to.type,
default: "body"
},
/**
* @description callback before Dialog closes, and it will prevent Dialog from closing, use done to close the dialog
*/
beforeClose: {
type: definePropType(Function)
},
/**
* @description destroy elements in Dialog when closed
*/
destroyOnClose: Boolean,
/**
* @description whether the Dialog can be closed by clicking the mask
*/
closeOnClickModal: {
type: Boolean,
default: true
},
/**
* @description whether the Dialog can be closed by pressing ESC
*/
closeOnPressEscape: {
type: Boolean,
default: true
},
/**
* @description whether scroll of body is disabled while Dialog is displayed
*/
lockScroll: {
type: Boolean,
default: true
},
/**
* @description whether a mask is displayed
*/
modal: {
type: Boolean,
default: true
},
/**
* @description whether the mask is penetrable
*/
modalPenetrable: Boolean,
/**
* @description the Time(milliseconds) before open
*/
openDelay: {
type: Number,
default: 0
},
/**
* @description the Time(milliseconds) before close
*/
closeDelay: {
type: Number,
default: 0
},
/**
* @description value for `margin-top` of Dialog CSS, default is 15vh
*/
top: {
type: String
},
/**
* @description visibility of Dialog
*/
modelValue: Boolean,
/**
* @description custom class names for mask
*/
modalClass: String,
/**
* @description custom class names for header wrapper
*/
headerClass: String,
/**
* @description custom class names for body wrapper
*/
bodyClass: String,
/**
* @description custom class names for footer wrapper
*/
footerClass: String,
/**
* @description width of Dialog, default is 50%
*/
width: {
type: [String, Number]
},
/**
* @description same as z-index in native CSS, z-order of dialog
*/
zIndex: {
type: Number
},
trapFocus: Boolean,
/**
* @description header's aria-level attribute
*/
headerAriaLevel: {
type: String,
default: "2"
},
/**
* @description custom transition configuration for dialog animation, it can be a string (transition name) or an object with Vue transition props
*/
transition: {
type: definePropType([String, Object]),
default: void 0
}
});
var dialogEmits = {
open: () => true,
opened: () => true,
close: () => true,
closed: () => true,
[UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
openAutoFocus: () => true,
closeAutoFocus: () => true
};
var dialogContextKey = /* @__PURE__ */ Symbol("dialogContextKey");
var dialogPropsDefaults = {
...dialogContentPropsDefaults,
appendTo: "body",
closeOnClickModal: true,
closeOnPressEscape: true,
lockScroll: true,
modal: true,
openDelay: 0,
closeDelay: 0,
headerAriaLevel: "2",
transition: void 0
};
// node_modules/element-plus/es/hooks/use-same-target/index.mjs
var useSameTarget = (handleClick) => {
if (!handleClick) {
return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
}
let mousedownTarget = false;
let mouseupTarget = false;
const onClick = (e) => {
if (mousedownTarget && mouseupTarget) {
handleClick(e);
}
mousedownTarget = mouseupTarget = false;
};
const onMousedown = (e) => {
mousedownTarget = e.target === e.currentTarget;
};
const onMouseup = (e) => {
mouseupTarget = e.target === e.currentTarget;
};
return { onClick, onMousedown, onMouseup };
};
// node_modules/element-plus/es/components/overlay/src/overlay.mjs
var overlayProps = buildProps({
mask: {
type: Boolean,
default: true
},
customMaskEvent: Boolean,
overlayClass: {
type: definePropType([
String,
Array,
Object
])
},
zIndex: {
type: definePropType([String, Number])
}
});
var overlayEmits = {
click: (evt) => evt instanceof MouseEvent
};
var BLOCK = "overlay";
var Overlay = defineComponent({
name: "ElOverlay",
props: overlayProps,
emits: overlayEmits,
setup(props2, { slots, emit }) {
const ns = useNamespace(BLOCK);
const onMaskClick = (e) => {
emit("click", e);
};
const { onClick, onMousedown, onMouseup } = useSameTarget(
props2.customMaskEvent ? void 0 : onMaskClick
);
return () => {
return props2.mask ? createVNode(
"div",
{
class: [ns.b(), props2.overlayClass],
style: {
zIndex: props2.zIndex
},
onClick,
onMousedown,
onMouseup
},
[renderSlot(slots, "default")],
PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS,
["onClick", "onMouseup", "onMousedown"]
) : h(
"div",
{
class: props2.overlayClass,
style: {
zIndex: props2.zIndex,
position: "fixed",
top: "0px",
right: "0px",
bottom: "0px",
left: "0px"
}
},
[renderSlot(slots, "default")]
);
};
}
});
// node_modules/element-plus/es/components/overlay/index.mjs
var ElOverlay = Overlay;
// node_modules/element-plus/es/components/dialog/src/constants.mjs
var dialogInjectionKey = /* @__PURE__ */ Symbol("dialogInjectionKey");
var DEFAULT_DIALOG_TRANSITION = "dialog-fade";
// node_modules/element-plus/es/utils/vue/refs.mjs
var composeRefs = (...refs) => {
return (el) => {
refs.forEach((ref2) => {
ref2.value = el;
});
};
};
// node_modules/element-plus/es/hooks/use-draggable/index.mjs
var useDraggable = (targetRef, dragRef, draggable2, overflow) => {
const transform = {
offsetX: 0,
offsetY: 0
};
const isDragging2 = ref(false);
const adjustPosition = (moveX, moveY) => {
if (targetRef.value) {
const { offsetX, offsetY } = transform;
const targetRect = targetRef.value.getBoundingClientRect();
const targetLeft = targetRect.left;
const targetTop = targetRect.top;
const targetWidth = targetRect.width;
const targetHeight = targetRect.height;
const clientWidth = document.documentElement.clientWidth;
const clientHeight = document.documentElement.clientHeight;
const minLeft = -targetLeft + offsetX;
const minTop = -targetTop + offsetY;
const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
const maxTop = clientHeight - targetTop - (targetHeight < clientHeight ? targetHeight : 0) + offsetY;
if (!(overflow == null ? void 0 : overflow.value)) {
moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
moveY = Math.min(Math.max(moveY, minTop), maxTop);
}
transform.offsetX = moveX;
transform.offsetY = moveY;
targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(
moveY
)})`;
}
};
const onMousedown = (e) => {
const downX = e.clientX;
const downY = e.clientY;
const { offsetX, offsetY } = transform;
const onMousemove = (e2) => {
if (!isDragging2.value) {
isDragging2.value = true;
}
const moveX = offsetX + e2.clientX - downX;
const moveY = offsetY + e2.clientY - downY;
adjustPosition(moveX, moveY);
};
const onMouseup = () => {
isDragging2.value = false;
document.removeEventListener("mousemove", onMousemove);
document.removeEventListener("mouseup", onMouseup);
};
document.addEventListener("mousemove", onMousemove);
document.addEventListener("mouseup", onMouseup);
};
const onDraggable = () => {
if (dragRef.value && targetRef.value) {
dragRef.value.addEventListener("mousedown", onMousedown);
window.addEventListener("resize", updatePosition);
}
};
const offDraggable = () => {
if (dragRef.value && targetRef.value) {
dragRef.value.removeEventListener("mousedown", onMousedown);
window.removeEventListener("resize", updatePosition);
}
};
const resetPosition = () => {
transform.offsetX = 0;
transform.offsetY = 0;
if (targetRef.value) {
targetRef.value.style.transform = "";
}
};
const updatePosition = () => {
const { offsetX, offsetY } = transform;
adjustPosition(offsetX, offsetY);
};
onMounted(() => {
watchEffect(() => {
if (draggable2.value) {
onDraggable();
} else {
offDraggable();
}
});
});
onBeforeUnmount(() => {
offDraggable();
});
return {
isDragging: isDragging2,
resetPosition,
updatePosition
};
};
// node_modules/element-plus/es/components/dialog/src/dialog-content.vue2.mjs
var _hoisted_137 = ["aria-level"];
var _hoisted_219 = ["aria-label"];
var _hoisted_39 = ["id"];
var _sfc_main76 = defineComponent({
...{ name: "ElDialogContent" },
__name: "dialog-content",
props: dialogContentProps,
emits: dialogContentEmits,
setup(__props, { expose: __expose }) {
const { t } = useLocale();
const { Close } = CloseComponents;
const props2 = __props;
const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
const draggable2 = computed(() => !!props2.draggable);
const overflow = computed(() => !!props2.overflow);
const { resetPosition, updatePosition, isDragging: isDragging2 } = useDraggable(
dialogRef,
headerRef,
draggable2,
overflow
);
const dialogKls = computed(() => [
ns.b(),
ns.is("fullscreen", props2.fullscreen),
ns.is("draggable", draggable2.value),
ns.is("dragging", isDragging2.value),
ns.is("align-center", !!props2.alignCenter),
{ [ns.m("center")]: props2.center }
]);
__expose({
resetPosition,
updatePosition
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref: unref(composedDialogRef),
class: normalizeClass(dialogKls.value),
style: normalizeStyle(unref(style)),
tabindex: "-1"
},
[
createBaseVNode(
"header",
{
ref_key: "headerRef",
ref: headerRef,
class: normalizeClass([unref(ns).e("header"), __props.headerClass, { "show-close": __props.showClose }])
},
[
renderSlot(_ctx.$slots, "header", {}, () => [
createBaseVNode("span", {
role: "heading",
"aria-level": __props.ariaLevel,
class: normalizeClass(unref(ns).e("title"))
}, toDisplayString(__props.title), 11, _hoisted_137)
]),
__props.showClose ? (openBlock(), createElementBlock("button", {
key: 0,
"aria-label": unref(t)("el.dialog.close"),
class: normalizeClass(unref(ns).e("headerbtn")),
type: "button",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
}, [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(ns).e("close"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.closeIcon || unref(Close))))
]),
_: 1
/* STABLE */
}, 8, ["class"])
], 10, _hoisted_219)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
createBaseVNode("div", {
id: unref(bodyId),
class: normalizeClass([unref(ns).e("body"), __props.bodyClass])
}, [
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_39),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"footer",
{
key: 0,
class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/hooks/use-lockscreen/index.mjs
var useLockscreen = (trigger, options = {}) => {
if (!isRef(trigger)) {
throwError(
"[useLockscreen]",
"You need to pass a ref param to this function"
);
}
const ns = options.ns || useNamespace("popup");
const hiddenCls = computed(() => ns.bm("parent", "hidden"));
let scrollBarWidth2 = 0;
let withoutHiddenClass = false;
let bodyWidth = "0";
let cleaned = false;
const cleanup = () => {
if (cleaned) return;
cleaned = true;
setTimeout(() => {
if (typeof document === "undefined") return;
if (withoutHiddenClass && document) {
document.body.style.width = bodyWidth;
removeClass(document.body, hiddenCls.value);
}
}, 200);
};
watch(trigger, (val) => {
if (!val) {
cleanup();
return;
}
cleaned = false;
withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
if (withoutHiddenClass) {
bodyWidth = document.body.style.width;
addClass(document.body, hiddenCls.value);
}
scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
const bodyOverflowY = getStyle(document.body, "overflowY");
if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
}
});
onScopeDispose(() => cleanup());
};
// node_modules/element-plus/es/components/dialog/src/use-dialog.mjs
var COMPONENT_NAME12 = "ElDialog";
var useDialog = (props2, targetRef) => {
var _a;
const instance = getCurrentInstance();
const emit = instance.emit;
const { nextZIndex } = useZIndex();
let lastPosition = "";
const titleId = useId();
const bodyId = useId();
const visible = ref(false);
const closed = ref(false);
const rendered = ref(false);
const zIndex2 = ref((_a = props2.zIndex) != null ? _a : nextZIndex());
const closing = ref(false);
let openTimer = void 0;
let closeTimer = void 0;
const config = useGlobalConfig();
const namespace = computed(() => {
var _a2, _b;
return (_b = (_a2 = config.value) == null ? void 0 : _a2.namespace) != null ? _b : defaultNamespace;
});
const globalConfig2 = computed(() => {
var _a2;
return (_a2 = config.value) == null ? void 0 : _a2.dialog;
});
const style = computed(() => {
const style2 = {};
const varPrefix = `--${namespace.value}-dialog`;
if (!props2.fullscreen) {
if (props2.top) {
style2[`${varPrefix}-margin-top`] = props2.top;
}
const width = addUnit(props2.width);
if (width) {
style2[`${varPrefix}-width`] = width;
}
}
return style2;
});
const _draggable = computed(
() => {
var _a2, _b, _c;
return ((_c = (_b = props2.draggable) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.draggable) != null ? _c : false) && !props2.fullscreen;
}
);
const _alignCenter = computed(
() => {
var _a2, _b, _c;
return (_c = (_b = props2.alignCenter) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.alignCenter) != null ? _c : false;
}
);
const _overflow = computed(
() => {
var _a2, _b, _c;
return (_c = (_b = props2.overflow) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.overflow) != null ? _c : false;
}
);
const overlayDialogStyle = computed(() => {
if (_alignCenter.value) {
return { display: "flex" };
}
return {};
});
const transitionConfig = computed(() => {
var _a2, _b, _c;
const transition = (_c = (_b = props2.transition) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.transition) != null ? _c : DEFAULT_DIALOG_TRANSITION;
const baseConfig = {
name: transition,
onAfterEnter: afterEnter,
onBeforeLeave: beforeLeave,
onAfterLeave: afterLeave
};
if (isObject(transition)) {
const config2 = { ...transition };
const _mergeHook = (userHook, defaultHook) => {
return (el) => {
if (isArray(userHook)) {
userHook.forEach((fn2) => {
if (isFunction(fn2)) fn2(el);
});
} else if (isFunction(userHook)) {
userHook(el);
}
defaultHook();
};
};
config2.onAfterEnter = _mergeHook(config2.onAfterEnter, afterEnter);
config2.onBeforeLeave = _mergeHook(config2.onBeforeLeave, beforeLeave);
config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave);
if (!config2.name) {
config2.name = DEFAULT_DIALOG_TRANSITION;
debugWarn(
COMPONENT_NAME12,
`transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`
);
}
return config2;
}
return baseConfig;
});
function afterEnter() {
emit("opened");
}
function afterLeave() {
emit("closed");
emit(UPDATE_MODEL_EVENT, false);
if (props2.destroyOnClose) {
rendered.value = false;
}
closing.value = false;
}
function beforeLeave() {
closing.value = true;
emit("close");
}
function open() {
closeTimer == null ? void 0 : closeTimer();
openTimer == null ? void 0 : openTimer();
if (props2.openDelay && props2.openDelay > 0) {
({ stop: openTimer } = useTimeoutFn(() => doOpen(), props2.openDelay));
} else {
doOpen();
}
}
function close2() {
openTimer == null ? void 0 : openTimer();
closeTimer == null ? void 0 : closeTimer();
if (props2.closeDelay && props2.closeDelay > 0) {
({ stop: closeTimer } = useTimeoutFn(() => doClose(), props2.closeDelay));
} else {
doClose();
}
}
function handleClose() {
function hide2(shouldCancel) {
if (shouldCancel) return;
closed.value = true;
visible.value = false;
}
if (props2.beforeClose) {
props2.beforeClose(hide2);
} else {
close2();
}
}
function onModalClick() {
if (props2.closeOnClickModal) {
handleClose();
}
}
function doOpen() {
if (!isClient) return;
visible.value = true;
}
function doClose() {
visible.value = false;
}
function onOpenAutoFocus() {
emit("openAutoFocus");
}
function onCloseAutoFocus() {
emit("closeAutoFocus");
}
function onFocusoutPrevented(event) {
var _a2;
if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
event.preventDefault();
}
}
if (props2.lockScroll) {
useLockscreen(visible);
}
function onCloseRequested() {
if (props2.closeOnPressEscape) {
handleClose();
}
}
watch(
() => props2.zIndex,
() => {
var _a2;
zIndex2.value = (_a2 = props2.zIndex) != null ? _a2 : nextZIndex();
}
);
watch(
() => props2.modelValue,
(val) => {
var _a2;
if (val) {
closed.value = false;
closing.value = false;
open();
rendered.value = true;
zIndex2.value = (_a2 = props2.zIndex) != null ? _a2 : nextZIndex();
nextTick(() => {
emit("open");
if (targetRef.value) {
targetRef.value.parentElement.scrollTop = 0;
targetRef.value.parentElement.scrollLeft = 0;
targetRef.value.scrollTop = 0;
}
});
} else {
if (visible.value) {
close2();
}
}
}
);
watch(
() => props2.fullscreen,
(val) => {
if (!targetRef.value) return;
if (val) {
lastPosition = targetRef.value.style.transform;
targetRef.value.style.transform = "";
} else {
targetRef.value.style.transform = lastPosition;
}
}
);
onMounted(() => {
if (props2.modelValue) {
visible.value = true;
rendered.value = true;
open();
}
});
return {
afterEnter,
afterLeave,
beforeLeave,
handleClose,
onModalClick,
close: close2,
doClose,
onOpenAutoFocus,
onCloseAutoFocus,
onCloseRequested,
onFocusoutPrevented,
titleId,
bodyId,
closed,
style,
overlayDialogStyle,
rendered,
visible,
zIndex: zIndex2,
transitionConfig,
_draggable,
_alignCenter,
_overflow,
closing
};
};
// node_modules/element-plus/es/components/dialog/src/dialog.vue2.mjs
var _hoisted_138 = ["aria-label", "aria-labelledby", "aria-describedby"];
var _sfc_main77 = defineComponent({
...{
name: "ElDialog",
inheritAttrs: false
},
__name: "dialog",
props: dialogProps,
emits: dialogEmits,
setup(__props, { expose: __expose }) {
const props2 = __props;
const slots = useSlots();
useDeprecated(
{
scope: "el-dialog",
from: "the title slot",
replacement: "the header slot",
version: "3.0.0",
ref: "https://element-plus.org/en-US/component/dialog.html#slots"
},
computed(() => !!slots.title)
);
const ns = useNamespace("dialog");
const dialogRef = ref();
const headerRef = ref();
const dialogContentRef = ref();
const {
visible,
titleId,
bodyId,
style,
overlayDialogStyle,
rendered,
transitionConfig,
zIndex: zIndex2,
_draggable,
_alignCenter,
_overflow,
handleClose,
onModalClick,
onOpenAutoFocus,
onCloseAutoFocus,
onCloseRequested,
onFocusoutPrevented,
closing
} = useDialog(props2, dialogRef);
provide(dialogInjectionKey, {
dialogRef,
headerRef,
bodyId,
ns,
rendered,
style
});
const overlayEvent = useSameTarget(onModalClick);
const penetrable = computed(
() => props2.modalPenetrable && !props2.modal && !props2.fullscreen
);
const resetPosition = () => {
var _a;
(_a = dialogContentRef.value) == null ? void 0 : _a.resetPosition();
};
__expose({
/** @description whether the dialog is visible */
visible,
dialogContentRef,
resetPosition,
handleClose
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTeleport), {
to: __props.appendTo,
disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
}, {
default: withCtx(() => [
createVNode(
Transition,
mergeProps(unref(transitionConfig), { persisted: "" }),
{
default: withCtx(() => {
var _a;
return [
withDirectives(createVNode(unref(ElOverlay), {
"custom-mask-event": "",
mask: __props.modal,
"overlay-class": [
(_a = __props.modalClass) != null ? _a : "",
`${unref(ns).namespace.value}-modal-dialog`,
unref(ns).is("penetrable", penetrable.value)
],
"z-index": unref(zIndex2)
}, {
default: withCtx(() => [
createBaseVNode("div", {
role: "dialog",
"aria-modal": "true",
"aria-label": __props.title || void 0,
"aria-labelledby": !__props.title ? unref(titleId) : void 0,
"aria-describedby": unref(bodyId),
class: normalizeClass([
`${unref(ns).namespace.value}-overlay-dialog`,
unref(ns).is("closing", unref(closing))
]),
style: normalizeStyle(unref(overlayDialogStyle)),
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
onMousedown: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
onMouseup: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
}, [
createVNode(unref(ElFocusTrap), {
loop: "",
trapped: unref(visible),
"focus-start-el": "container",
onFocusAfterTrapped: unref(onOpenAutoFocus),
onFocusAfterReleased: unref(onCloseAutoFocus),
onFocusoutPrevented: unref(onFocusoutPrevented),
onReleaseRequested: unref(onCloseRequested)
}, {
default: withCtx(() => [
unref(rendered) ? (openBlock(), createBlock(_sfc_main76, mergeProps({
key: 0,
ref_key: "dialogContentRef",
ref: dialogContentRef
}, _ctx.$attrs, {
center: __props.center,
"align-center": unref(_alignCenter),
"close-icon": __props.closeIcon,
draggable: unref(_draggable),
overflow: unref(_overflow),
fullscreen: __props.fullscreen,
"header-class": __props.headerClass,
"body-class": __props.bodyClass,
"footer-class": __props.footerClass,
"show-close": __props.showClose,
title: __props.title,
"aria-level": __props.headerAriaLevel,
onClose: unref(handleClose)
}), createSlots({
header: withCtx(() => [
!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
key: 0,
close: unref(handleClose),
titleId: unref(titleId),
titleClass: unref(ns).e("title")
}) : renderSlot(_ctx.$slots, "title", { key: 1 })
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.footer ? {
name: "footer",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "footer")
]),
key: "0"
} : void 0
]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose"])) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
], 46, _hoisted_138)
]),
_: 3
/* FORWARDED */
}, 8, ["mask", "overlay-class", "z-index"]), [
[vShow, unref(visible)]
])
];
}),
_: 3
/* FORWARDED */
},
16
/* FULL_PROPS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["to", "disabled"]);
};
}
});
// node_modules/element-plus/es/components/dialog/index.mjs
var ElDialog = withInstall(_sfc_main77);
// node_modules/element-plus/es/components/divider/src/divider.mjs
var dividerProps = buildProps({
/**
* @description Set divider's direction
*/
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
/**
* @description Set the style of divider
*/
contentPosition: {
type: String,
values: ["left", "center", "right"],
default: "center"
},
/**
* @description the position of the customized content on the divider line
*/
borderStyle: {
type: definePropType(String),
default: "solid"
}
});
// node_modules/element-plus/es/components/divider/src/divider.vue2.mjs
var _sfc_main78 = defineComponent({
...{
name: "ElDivider"
},
__name: "divider",
props: dividerProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("divider");
const dividerStyle = computed(() => {
return ns.cssVar({
"border-style": props2.borderStyle
});
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b(), unref(ns).m(__props.direction)]),
style: normalizeStyle(dividerStyle.value),
role: "separator"
},
[
_ctx.$slots.default && __props.direction !== "vertical" ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass([unref(ns).e("text"), unref(ns).is(__props.contentPosition)])
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/divider/index.mjs
var ElDivider = withInstall(_sfc_main78);
// node_modules/element-plus/es/components/drawer/src/drawer.mjs
var drawerProps = buildProps({
...dialogProps,
direction: {
type: String,
default: "rtl",
values: ["ltr", "rtl", "ttb", "btt"]
},
resizable: Boolean,
size: {
type: [String, Number],
default: "30%"
},
withHeader: {
type: Boolean,
default: true
},
modalFade: {
type: Boolean,
default: true
},
headerAriaLevel: {
type: String,
default: "2"
}
});
var drawerEmits = {
...dialogEmits,
"resize-start": (evt, size2) => evt instanceof MouseEvent && typeof size2 === "number",
resize: (evt, size2) => evt instanceof MouseEvent && typeof size2 === "number",
"resize-end": (evt, size2) => evt instanceof MouseEvent && typeof size2 === "number"
};
// node_modules/element-plus/es/components/drawer/src/composables/useResizable.mjs
function useResizable(props2, target2, emit) {
const { width, height } = useWindowSize();
const isHorizontal2 = computed(() => ["ltr", "rtl"].includes(props2.direction));
const sign = computed(
() => ["ltr", "ttb"].includes(props2.direction) ? 1 : -1
);
const windowSize = computed(
() => isHorizontal2.value ? width.value : height.value
);
const getSize = computed(() => {
return clamp(
startSize.value + sign.value * offset3.value,
4,
windowSize.value
);
});
const startSize = ref(0);
const offset3 = ref(0);
const isResizing = ref(false);
const hasStartedDragging = ref(false);
let startPos = [];
let cleanups = [];
const getActualSize = () => {
var _a;
const drawerEl = (_a = target2.value) == null ? void 0 : _a.closest('[aria-modal="true"]');
if (drawerEl) {
return isHorizontal2.value ? drawerEl.offsetWidth : drawerEl.offsetHeight;
}
return 100;
};
watch(
() => [props2.size, props2.resizable],
() => {
hasStartedDragging.value = false;
startSize.value = 0;
offset3.value = 0;
onMouseUp();
}
);
const onMousedown = (e) => {
if (!props2.resizable) return;
if (!hasStartedDragging.value) {
startSize.value = getActualSize();
hasStartedDragging.value = true;
}
startPos = [e.pageX, e.pageY];
isResizing.value = true;
emit("resize-start", e, startSize.value);
cleanups.push(
useEventListener(window, "mouseup", onMouseUp),
useEventListener(window, "mousemove", onMouseMove)
);
};
const onMouseMove = (e) => {
const { pageX, pageY } = e;
const offsetX = pageX - startPos[0];
const offsetY = pageY - startPos[1];
offset3.value = isHorizontal2.value ? offsetX : offsetY;
emit("resize", e, getSize.value);
};
const onMouseUp = (e) => {
if (!isResizing.value) return;
startPos = [];
startSize.value = getSize.value;
offset3.value = 0;
isResizing.value = false;
cleanups.forEach((cleanup2) => cleanup2 == null ? void 0 : cleanup2());
cleanups = [];
if (e) {
emit("resize-end", e, startSize.value);
}
};
const cleanup = useEventListener(target2, "mousedown", onMousedown);
onBeforeUnmount(() => {
cleanup();
onMouseUp();
});
return {
size: computed(() => {
return hasStartedDragging.value ? `${getSize.value}px` : addUnit(props2.size);
}),
isResizing,
isHorizontal: isHorizontal2
};
}
// node_modules/element-plus/es/components/drawer/src/drawer.vue2.mjs
var _hoisted_139 = ["aria-label", "aria-labelledby", "aria-describedby"];
var _hoisted_220 = ["id", "aria-level"];
var _hoisted_310 = ["aria-label"];
var _hoisted_46 = ["id"];
var _sfc_main79 = defineComponent({
...{
name: "ElDrawer",
inheritAttrs: false
},
__name: "drawer",
props: drawerProps,
emits: drawerEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const slots = useSlots();
useDeprecated(
{
scope: "el-drawer",
from: "the title slot",
replacement: "the header slot",
version: "3.0.0",
ref: "https://element-plus.org/en-US/component/drawer.html#slots"
},
computed(() => !!slots.title)
);
const drawerRef = ref();
const focusStartRef = ref();
const draggerRef = ref();
const ns = useNamespace("drawer");
const { t } = useLocale();
const {
afterEnter,
afterLeave,
beforeLeave,
visible,
rendered,
titleId,
bodyId,
zIndex: zIndex2,
onModalClick,
onOpenAutoFocus,
onCloseAutoFocus,
onFocusoutPrevented,
onCloseRequested,
handleClose
} = useDialog(props2, drawerRef);
const { isHorizontal: isHorizontal2, size: size2, isResizing } = useResizable(props2, draggerRef, emit);
const penetrable = computed(() => props2.modalPenetrable && !props2.modal);
__expose({
handleClose,
afterEnter,
afterLeave
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTeleport), {
to: __props.appendTo,
disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
}, {
default: withCtx(() => [
createVNode(Transition, {
name: unref(ns).b("fade"),
onAfterEnter: unref(afterEnter),
onAfterLeave: unref(afterLeave),
onBeforeLeave: unref(beforeLeave),
persisted: ""
}, {
default: withCtx(() => {
var _a;
return [
withDirectives(createVNode(unref(ElOverlay), {
mask: __props.modal,
"overlay-class": [
unref(ns).is("drawer"),
(_a = __props.modalClass) != null ? _a : "",
`${unref(ns).namespace.value}-modal-drawer`,
unref(ns).is("penetrable", penetrable.value)
],
"z-index": unref(zIndex2),
onClick: unref(onModalClick)
}, {
default: withCtx(() => [
createVNode(unref(ElFocusTrap), {
loop: "",
trapped: unref(visible),
"focus-trap-el": drawerRef.value,
"focus-start-el": focusStartRef.value,
onFocusAfterTrapped: unref(onOpenAutoFocus),
onFocusAfterReleased: unref(onCloseAutoFocus),
onFocusoutPrevented: unref(onFocusoutPrevented),
onReleaseRequested: unref(onCloseRequested)
}, {
default: withCtx(() => [
createBaseVNode("div", mergeProps({
ref_key: "drawerRef",
ref: drawerRef,
"aria-modal": "true",
"aria-label": __props.title || void 0,
"aria-labelledby": !__props.title ? unref(titleId) : void 0,
"aria-describedby": unref(bodyId)
}, _ctx.$attrs, {
class: [
unref(ns).b(),
__props.direction,
unref(visible) && "open",
unref(ns).is("dragging", unref(isResizing))
],
style: { [unref(isHorizontal2) ? "width" : "height"]: unref(size2) },
role: "dialog",
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["stop"]))
}), [
createBaseVNode(
"span",
{
ref_key: "focusStartRef",
ref: focusStartRef,
class: normalizeClass(unref(ns).e("sr-focus")),
tabindex: "-1"
},
null,
2
/* CLASS */
),
__props.withHeader ? (openBlock(), createElementBlock(
"header",
{
key: 0,
class: normalizeClass([unref(ns).e("header"), __props.headerClass])
},
[
!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
key: 0,
close: unref(handleClose),
titleId: unref(titleId),
titleClass: unref(ns).e("title")
}, () => [
createBaseVNode("span", {
id: unref(titleId),
role: "heading",
"aria-level": __props.headerAriaLevel,
class: normalizeClass(unref(ns).e("title"))
}, toDisplayString(__props.title), 11, _hoisted_220)
]) : renderSlot(_ctx.$slots, "title", { key: 1 }, () => [
createCommentVNode(" DEPRECATED SLOT ")
]),
__props.showClose ? (openBlock(), createElementBlock("button", {
key: 2,
"aria-label": unref(t)("el.drawer.close"),
class: normalizeClass(unref(ns).e("close-btn")),
type: "button",
onClick: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleClose) && unref(handleClose)(...args))
}, [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(ns).e("close"))
}, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])
], 10, _hoisted_310)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
unref(rendered) ? (openBlock(), createElementBlock("div", {
key: 1,
id: unref(bodyId),
class: normalizeClass([unref(ns).e("body"), __props.bodyClass])
}, [
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_46)) : createCommentVNode("v-if", true),
_ctx.$slots.footer ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
__props.resizable ? (openBlock(), createElementBlock(
"div",
{
key: 3,
ref_key: "draggerRef",
ref: draggerRef,
style: normalizeStyle({ zIndex: unref(zIndex2) }),
class: normalizeClass(unref(ns).e("dragger"))
},
null,
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true)
], 16, _hoisted_139)
]),
_: 3
/* FORWARDED */
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
]),
_: 3
/* FORWARDED */
}, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
[vShow, unref(visible)]
])
];
}),
_: 3
/* FORWARDED */
}, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
]),
_: 3
/* FORWARDED */
}, 8, ["to", "disabled"]);
};
}
});
// node_modules/element-plus/es/components/drawer/index.mjs
var ElDrawer = withInstall(_sfc_main79);
// node_modules/element-plus/es/components/collection/src/collection.vue2.mjs
var _sfc_main80 = defineComponent({
inheritAttrs: false
});
// node_modules/element-plus/es/components/collection/src/collection.vue.mjs
function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
return renderSlot(_ctx.$slots, "default");
}
var Collection = _export_sfc(_sfc_main80, [["render", _sfc_render6]]);
// node_modules/element-plus/es/components/collection/src/collection-item.vue2.mjs
var _sfc_main81 = defineComponent({
name: "ElCollectionItem",
inheritAttrs: false
});
// node_modules/element-plus/es/components/collection/src/collection-item.vue.mjs
function _sfc_render7(_ctx, _cache, $props, $setup, $data, $options) {
return renderSlot(_ctx.$slots, "default");
}
var CollectionItem = _export_sfc(_sfc_main81, [["render", _sfc_render7]]);
// node_modules/element-plus/es/components/collection/src/collection.mjs
var COLLECTION_ITEM_SIGN = `data-el-collection-item`;
var createCollectionWithScope = (name) => {
const COLLECTION_NAME = `El${name}Collection`;
const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
const COLLECTION_INJECTION_KEY2 = Symbol(COLLECTION_NAME);
const COLLECTION_ITEM_INJECTION_KEY2 = Symbol(COLLECTION_ITEM_NAME);
const ElCollection2 = Object.assign({}, Collection, {
name: COLLECTION_NAME,
setup() {
const collectionRef = ref();
const itemMap = /* @__PURE__ */ new Map();
const getItems = (() => {
const collectionEl = unref(collectionRef);
if (!collectionEl) return [];
const orderedNodes = Array.from(
collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`)
);
const items = [...itemMap.values()];
return items.sort(
(a2, b2) => orderedNodes.indexOf(a2.ref) - orderedNodes.indexOf(b2.ref)
);
});
provide(COLLECTION_INJECTION_KEY2, {
itemMap,
getItems,
collectionRef
});
}
});
const ElCollectionItem2 = Object.assign({}, CollectionItem, {
name: COLLECTION_ITEM_NAME,
setup(_2, { attrs }) {
const collectionItemRef = ref();
const collectionInjection = inject(COLLECTION_INJECTION_KEY2, void 0);
provide(COLLECTION_ITEM_INJECTION_KEY2, {
collectionItemRef
});
onMounted(() => {
const collectionItemEl = unref(collectionItemRef);
if (collectionItemEl) {
collectionInjection.itemMap.set(collectionItemEl, {
ref: collectionItemEl,
...attrs
});
}
});
onBeforeUnmount(() => {
const collectionItemEl = unref(collectionItemRef);
collectionInjection.itemMap.delete(collectionItemEl);
});
}
});
return {
COLLECTION_INJECTION_KEY: COLLECTION_INJECTION_KEY2,
COLLECTION_ITEM_INJECTION_KEY: COLLECTION_ITEM_INJECTION_KEY2,
ElCollection: ElCollection2,
ElCollectionItem: ElCollectionItem2
};
};
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group.mjs
var rovingFocusGroupProps = buildProps({
style: { type: definePropType([String, Array, Object]) },
currentTabId: {
type: definePropType(String)
},
defaultCurrentTabId: String,
loop: Boolean,
dir: {
type: String,
// left for direction support
values: ["ltr", "rtl"],
default: "ltr"
},
orientation: {
// left for orientation support
type: definePropType(String)
},
onBlur: Function,
onFocus: Function,
onMousedown: Function
});
var {
ElCollection,
ElCollectionItem,
COLLECTION_INJECTION_KEY,
COLLECTION_ITEM_INJECTION_KEY
} = createCollectionWithScope("RovingFocusGroup");
// node_modules/element-plus/es/components/roving-focus-group/src/tokens.mjs
var ROVING_FOCUS_GROUP_INJECTION_KEY = /* @__PURE__ */ Symbol("elRovingFocusGroup");
var ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = /* @__PURE__ */ Symbol("elRovingFocusGroupItem");
// node_modules/element-plus/es/components/roving-focus-group/src/utils.mjs
var MAP_KEY_TO_FOCUS_INTENT = {
ArrowLeft: "prev",
ArrowUp: "prev",
ArrowRight: "next",
ArrowDown: "next",
PageUp: "first",
Home: "first",
PageDown: "last",
End: "last"
};
var getDirectionAwareKey = (key, dir) => {
if (dir !== "rtl") return key;
switch (key) {
case EVENT_CODE.right:
return EVENT_CODE.left;
case EVENT_CODE.left:
return EVENT_CODE.right;
default:
return key;
}
};
var getFocusIntent = (event, orientation, dir) => {
const code = getEventCode(event);
const key = getDirectionAwareKey(code, dir);
if (orientation === "vertical" && [EVENT_CODE.left, EVENT_CODE.right].includes(key))
return void 0;
if (orientation === "horizontal" && [EVENT_CODE.up, EVENT_CODE.down].includes(key))
return void 0;
return MAP_KEY_TO_FOCUS_INTENT[key];
};
var reorderArray = (array, atIdx) => {
return array.map((_2, idx) => array[(idx + atIdx) % array.length]);
};
var focusFirst = (elements) => {
const { activeElement: prevActive } = document;
for (const element of elements) {
if (element === prevActive) return;
element.focus();
if (prevActive !== document.activeElement) return;
}
};
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group-impl.vue2.mjs
var CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
var ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
var EVT_OPTS = { bubbles: false, cancelable: true };
var _sfc_main82 = defineComponent({
name: "ElRovingFocusGroupImpl",
inheritAttrs: false,
props: rovingFocusGroupProps,
emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"],
setup(props2, { emit }) {
var _a;
const currentTabbedId = ref(
(_a = props2.currentTabId || props2.defaultCurrentTabId) != null ? _a : null
);
const isBackingOut = ref(false);
const isClickFocus = ref(false);
const rovingFocusGroupRef = ref();
const { getItems } = inject(
COLLECTION_INJECTION_KEY,
void 0
);
const rovingFocusGroupRootStyle = computed(() => {
return [
{
outline: "none"
},
props2.style
];
});
const onItemFocus = (tabbedId) => {
emit(CURRENT_TAB_ID_CHANGE_EVT, tabbedId);
};
const onItemShiftTab = () => {
isBackingOut.value = true;
};
const onMousedown = composeEventHandlers(
(e) => {
var _a2;
(_a2 = props2.onMousedown) == null ? void 0 : _a2.call(props2, e);
},
() => {
isClickFocus.value = true;
}
);
const onFocus = composeEventHandlers(
(e) => {
var _a2;
(_a2 = props2.onFocus) == null ? void 0 : _a2.call(props2, e);
},
(e) => {
const isKeyboardFocus = !unref(isClickFocus);
const { target: target2, currentTarget } = e;
if (target2 === currentTarget && isKeyboardFocus && !unref(isBackingOut)) {
const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS);
currentTarget == null ? void 0 : currentTarget.dispatchEvent(entryFocusEvt);
if (!entryFocusEvt.defaultPrevented) {
const items = getItems().filter((item) => item.focusable);
const activeItem = items.find((item) => item.active);
const currentItem = items.find(
(item) => item.id === unref(currentTabbedId)
);
const candidates = [activeItem, currentItem, ...items].filter(
Boolean
);
const candidateNodes = candidates.map((item) => item.ref);
focusFirst(candidateNodes);
}
}
isClickFocus.value = false;
}
);
const onBlur = composeEventHandlers(
(e) => {
var _a2;
(_a2 = props2.onBlur) == null ? void 0 : _a2.call(props2, e);
},
() => {
isBackingOut.value = false;
}
);
const handleEntryFocus = (...args) => {
emit("entryFocus", ...args);
};
const onKeydown = (e) => {
const focusIntent = getFocusIntent(e);
if (focusIntent) {
e.preventDefault();
const items = getItems().filter((item) => item.focusable);
let elements = items.map((item) => item.ref);
switch (focusIntent) {
case "last": {
elements.reverse();
break;
}
case "prev":
case "next": {
if (focusIntent === "prev") {
elements.reverse();
}
const currentIdx = elements.indexOf(e.currentTarget);
elements = props2.loop ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1);
break;
}
}
nextTick(() => {
focusFirst(elements);
});
}
};
provide(ROVING_FOCUS_GROUP_INJECTION_KEY, {
currentTabbedId: readonly(currentTabbedId),
loop: toRef(props2, "loop"),
tabIndex: computed(() => {
return unref(isBackingOut) ? -1 : 0;
}),
rovingFocusGroupRef,
rovingFocusGroupRootStyle,
orientation: toRef(props2, "orientation"),
dir: toRef(props2, "dir"),
onItemFocus,
onItemShiftTab,
onBlur,
onFocus,
onMousedown,
onKeydown
});
watch(
() => props2.currentTabId,
(val) => {
currentTabbedId.value = val != null ? val : null;
}
);
useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
}
});
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group-impl.vue.mjs
function _sfc_render8(_ctx, _cache, $props, $setup, $data, $options) {
return renderSlot(_ctx.$slots, "default");
}
var ElRovingFocusGroupImpl = _export_sfc(_sfc_main82, [["render", _sfc_render8]]);
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group.vue2.mjs
var _sfc_main83 = defineComponent({
name: "ElRovingFocusGroup",
components: {
ElFocusGroupCollection: ElCollection,
ElRovingFocusGroupImpl
}
});
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group.vue.mjs
function _sfc_render9(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_roving_focus_group_impl = resolveComponent("el-roving-focus-group-impl");
const _component_el_focus_group_collection = resolveComponent("el-focus-group-collection");
return openBlock(), createBlock(_component_el_focus_group_collection, null, {
default: withCtx(() => [
createVNode(
_component_el_roving_focus_group_impl,
normalizeProps(guardReactiveProps(_ctx.$attrs)),
{
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
},
16
/* FULL_PROPS */
)
]),
_: 3
/* FORWARDED */
});
}
var ElRovingFocusGroup = _export_sfc(_sfc_main83, [["render", _sfc_render9]]);
// node_modules/element-plus/es/components/dropdown/src/dropdown.mjs
var dropdownProps = buildProps({
/**
* @description how to trigger
*/
trigger: {
...useTooltipTriggerProps.trigger,
type: definePropType([
String,
Array
])
},
triggerKeys: {
type: definePropType(Array),
default: () => [
EVENT_CODE.enter,
EVENT_CODE.numpadEnter,
EVENT_CODE.space,
EVENT_CODE.down
]
},
/**
* @description Indicates whether virtual triggering is enabled
*/
virtualTriggering: useTooltipTriggerProps.virtualTriggering,
/**
* @description Indicates the reference element to which the dropdown is attached
*/
virtualRef: useTooltipTriggerProps.virtualRef,
/**
* @description Tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
...useTooltipContentProps.effect,
default: "light"
},
/**
* @description menu button type, refer to `Button` Component, only works when `split-button` is true
*/
type: {
type: definePropType(String)
},
/**
* @description placement of pop menu
*/
placement: {
type: definePropType(String),
default: "bottom"
},
/**
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
*/
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
id: String,
/**
* @description menu size, also works on the split button
*/
size: {
type: String,
default: ""
},
/**
* @description whether a button group is displayed
*/
splitButton: Boolean,
/**
* @description whether to hide menu after clicking menu-item
*/
hideOnClick: {
type: Boolean,
default: true
},
loop: {
type: Boolean,
default: true
},
/**
* @description whether the tooltip content has an arrow
*/
showArrow: {
type: Boolean,
default: true
},
/**
* @description delay time before show a dropdown (only works when trigger is `hover`)
*/
showTimeout: {
type: Number,
default: 150
},
/**
* @description delay time before hide a dropdown (only works when trigger is `hover`)
*/
hideTimeout: {
type: Number,
default: 150
},
/**
* @description [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of Dropdown
*/
tabindex: {
type: definePropType([Number, String]),
default: 0
},
/**
* @description the max height of menu
*/
maxHeight: {
type: definePropType([Number, String]),
default: ""
},
/**
* @description custom class name for Dropdown's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for Dropdown's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description whether to disable
*/
disabled: Boolean,
/**
* @description the ARIA role attribute for the dropdown menu. Depending on the use case, you may want to change this to 'navigation'
*/
role: {
type: String,
values: roleTypes,
default: "menu"
},
buttonProps: {
type: definePropType(Object)
},
/**
* @description whether the dropdown popup is teleported to the body
*/
teleported: useTooltipContentProps.teleported,
/**
* @description which element the dropdown CONTENT appends to
*/
appendTo: useTooltipContentProps.appendTo,
/**
* @description when dropdown inactive and `persistent` is `false` , dropdown menu will be destroyed
*/
persistent: {
type: Boolean,
default: true
}
});
var dropdownItemProps = buildProps({
/**
* @description a command to be dispatched to Dropdown's `command` callback
*/
command: {
type: [Object, String, Number],
default: () => ({})
},
/**
* @description whether the item is disabled
*/
disabled: Boolean,
/**
* @description whether a divider is displayed
*/
divided: Boolean,
textValue: String,
/**
* @description custom icon
*/
icon: {
type: iconPropType
}
});
var dropdownMenuProps = buildProps({
onKeydown: { type: definePropType(Function) }
});
var FIRST_KEYS = [
EVENT_CODE.down,
EVENT_CODE.pageDown,
EVENT_CODE.home
];
var LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
// node_modules/element-plus/es/components/dropdown/src/tokens.mjs
var DROPDOWN_INJECTION_KEY = /* @__PURE__ */ Symbol("elDropdown");
var DROPDOWN_INSTANCE_INJECTION_KEY = "elDropdown";
// node_modules/element-plus/es/components/dropdown/src/dropdown.vue2.mjs
var { ButtonGroup: ElButtonGroup2 } = ElButton;
var _sfc_main84 = defineComponent({
name: "ElDropdown",
components: {
ElButton,
ElButtonGroup: ElButtonGroup2,
ElScrollbar,
ElTooltip,
ElRovingFocusGroup,
ElOnlyChild: OnlyChild,
ElIcon,
ArrowDown: arrow_down_default
},
props: dropdownProps,
emits: ["visible-change", "click", "command"],
setup(props2, { emit }) {
const _instance = getCurrentInstance();
const ns = useNamespace("dropdown");
const { t } = useLocale();
const triggeringElementRef = ref();
const referenceElementRef = ref();
const popperRef = ref();
const contentRef = ref();
const scrollbar = ref(null);
const currentTabId = ref(null);
const isUsingKeyboard = ref(false);
const wrapStyle = computed(() => ({
maxHeight: addUnit(props2.maxHeight)
}));
const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)]);
const trigger = computed(() => castArray_default(props2.trigger));
const defaultTriggerId = useId().value;
const triggerId = computed(() => props2.id || defaultTriggerId);
function handleClick() {
var _a;
(_a = popperRef.value) == null ? void 0 : _a.onClose(void 0, 0);
}
function handleClose() {
var _a;
(_a = popperRef.value) == null ? void 0 : _a.onClose();
}
function handleOpen() {
var _a;
(_a = popperRef.value) == null ? void 0 : _a.onOpen();
}
const dropdownSize = useFormSize();
function commandHandler(...args) {
emit("command", ...args);
}
function onItemEnter() {
}
function onItemLeave() {
const contentEl = unref(contentRef);
trigger.value.includes("hover") && (contentEl == null ? void 0 : contentEl.focus({
preventScroll: true
}));
currentTabId.value = null;
}
function handleCurrentTabIdChange(id) {
currentTabId.value = id;
}
function handleBeforeShowTooltip() {
emit("visible-change", true);
}
function handleShowTooltip(event) {
var _a;
isUsingKeyboard.value = (event == null ? void 0 : event.type) === "keydown";
(_a = contentRef.value) == null ? void 0 : _a.focus();
}
function handleBeforeHideTooltip() {
emit("visible-change", false);
}
provide(DROPDOWN_INJECTION_KEY, {
contentRef,
role: computed(() => props2.role),
triggerId,
isUsingKeyboard,
onItemEnter,
onItemLeave,
handleClose
});
provide(DROPDOWN_INSTANCE_INJECTION_KEY, {
instance: _instance,
dropdownSize,
handleClick,
commandHandler,
trigger: toRef(props2, "trigger"),
hideOnClick: toRef(props2, "hideOnClick")
});
const handlerMainButtonClick = (event) => {
emit("click", event);
};
return {
t,
ns,
scrollbar,
wrapStyle,
dropdownTriggerKls,
dropdownSize,
triggerId,
currentTabId,
handleCurrentTabIdChange,
handlerMainButtonClick,
handleClose,
handleOpen,
handleBeforeShowTooltip,
handleShowTooltip,
handleBeforeHideTooltip,
popperRef,
contentRef,
triggeringElementRef,
referenceElementRef
};
}
});
// node_modules/element-plus/es/components/dropdown/src/dropdown.vue.mjs
function _sfc_render10(_ctx, _cache, $props, $setup, $data, $options) {
var _a;
const _component_el_roving_focus_group = resolveComponent("el-roving-focus-group");
const _component_el_scrollbar = resolveComponent("el-scrollbar");
const _component_el_only_child = resolveComponent("el-only-child");
const _component_el_tooltip = resolveComponent("el-tooltip");
const _component_el_button = resolveComponent("el-button");
const _component_arrow_down = resolveComponent("arrow-down");
const _component_el_icon = resolveComponent("el-icon");
const _component_el_button_group = resolveComponent("el-button-group");
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)])
},
[
createVNode(_component_el_tooltip, {
ref: "popperRef",
role: _ctx.role,
effect: _ctx.effect,
"fallback-placements": ["bottom", "top"],
"popper-options": _ctx.popperOptions,
"gpu-acceleration": false,
placement: _ctx.placement,
"popper-class": [_ctx.ns.e("popper"), _ctx.popperClass],
"popper-style": _ctx.popperStyle,
trigger: _ctx.trigger,
"trigger-keys": _ctx.triggerKeys,
"trigger-target-el": _ctx.contentRef,
"show-arrow": _ctx.showArrow,
"show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0,
"hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0,
"virtual-ref": (_a = _ctx.virtualRef) != null ? _a : _ctx.triggeringElementRef,
"virtual-triggering": _ctx.virtualTriggering || _ctx.splitButton,
disabled: _ctx.disabled,
transition: `${_ctx.ns.namespace.value}-zoom-in-top`,
teleported: _ctx.teleported,
"append-to": _ctx.appendTo,
pure: "",
"focus-on-target": "",
persistent: _ctx.persistent,
onBeforeShow: _ctx.handleBeforeShowTooltip,
onShow: _ctx.handleShowTooltip,
onBeforeHide: _ctx.handleBeforeHideTooltip
}, createSlots({
content: withCtx(() => [
createVNode(_component_el_scrollbar, {
ref: "scrollbar",
"wrap-style": _ctx.wrapStyle,
tag: "div",
"view-class": _ctx.ns.e("list")
}, {
default: withCtx(() => [
createVNode(_component_el_roving_focus_group, {
loop: _ctx.loop,
"current-tab-id": _ctx.currentTabId,
orientation: "horizontal",
onCurrentTabIdChange: _ctx.handleCurrentTabIdChange
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "dropdown")
]),
_: 3
/* FORWARDED */
}, 8, ["loop", "current-tab-id", "onCurrentTabIdChange"])
]),
_: 3
/* FORWARDED */
}, 8, ["wrap-style", "view-class"])
]),
_: 2
/* DYNAMIC */
}, [
!_ctx.splitButton ? {
name: "default",
fn: withCtx(() => [
createVNode(_component_el_only_child, {
id: _ctx.triggerId,
ref: "triggeringElementRef",
role: "button",
tabindex: _ctx.tabindex
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["id", "tabindex"])
]),
key: "0"
} : void 0
]), 1032, ["role", "effect", "popper-options", "placement", "popper-class", "popper-style", "trigger", "trigger-keys", "trigger-target-el", "show-arrow", "show-after", "hide-after", "virtual-ref", "virtual-triggering", "disabled", "transition", "teleported", "append-to", "persistent", "onBeforeShow", "onShow", "onBeforeHide"]),
_ctx.splitButton ? (openBlock(), createBlock(_component_el_button_group, { key: 0 }, {
default: withCtx(() => [
createVNode(_component_el_button, mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, {
size: _ctx.dropdownSize,
type: _ctx.type,
disabled: _ctx.disabled,
tabindex: _ctx.tabindex,
onClick: _ctx.handlerMainButtonClick
}), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 16, ["size", "type", "disabled", "tabindex", "onClick"]),
createVNode(_component_el_button, mergeProps({
id: _ctx.triggerId,
ref: "triggeringElementRef"
}, _ctx.buttonProps, {
role: "button",
size: _ctx.dropdownSize,
type: _ctx.type,
class: _ctx.ns.e("caret-button"),
disabled: _ctx.disabled,
tabindex: _ctx.tabindex,
"aria-label": _ctx.t("el.dropdown.toggleDropdown")
}), {
default: withCtx(() => [
createVNode(_component_el_icon, {
class: normalizeClass(_ctx.ns.e("icon"))
}, {
default: withCtx(() => [
createVNode(_component_arrow_down)
]),
_: 1
/* STABLE */
}, 8, ["class"])
]),
_: 1
/* STABLE */
}, 16, ["id", "size", "type", "class", "disabled", "tabindex", "aria-label"])
]),
_: 3
/* FORWARDED */
})) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
var Dropdown = _export_sfc(_sfc_main84, [["render", _sfc_render10]]);
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-item.vue2.mjs
var _sfc_main85 = defineComponent({
components: {
ElRovingFocusCollectionItem: ElCollectionItem
},
props: {
focusable: {
type: Boolean,
default: true
},
active: Boolean
},
emits: ["mousedown", "focus", "keydown"],
setup(props2, { emit }) {
const { currentTabbedId, onItemFocus, onItemShiftTab, onKeydown } = inject(
ROVING_FOCUS_GROUP_INJECTION_KEY,
void 0
);
const id = useId();
const rovingFocusGroupItemRef = ref();
const handleMousedown = composeEventHandlers(
(e) => {
emit("mousedown", e);
},
(e) => {
if (!props2.focusable) {
e.preventDefault();
} else {
onItemFocus(unref(id));
}
}
);
const handleFocus = composeEventHandlers(
(e) => {
emit("focus", e);
},
() => {
onItemFocus(unref(id));
}
);
const handleKeydown = composeEventHandlers(
(e) => {
emit("keydown", e);
},
(e) => {
const { shiftKey, target: target2, currentTarget } = e;
const code = getEventCode(e);
if (code === EVENT_CODE.tab && shiftKey) {
onItemShiftTab();
return;
}
if (target2 !== currentTarget) return;
onKeydown(e);
}
);
const isCurrentTab = computed(() => currentTabbedId.value === unref(id));
provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
rovingFocusGroupItemRef,
tabIndex: computed(() => unref(isCurrentTab) ? 0 : -1),
handleMousedown,
handleFocus,
handleKeydown
});
return {
id,
handleKeydown,
handleFocus,
handleMousedown
};
}
});
// node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-item.vue.mjs
function _sfc_render11(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_roving_focus_collection_item = resolveComponent("el-roving-focus-collection-item");
return openBlock(), createBlock(_component_el_roving_focus_collection_item, {
id: _ctx.id,
focusable: _ctx.focusable,
active: _ctx.active
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["id", "focusable", "active"]);
}
var ElRovingFocusItem = _export_sfc(_sfc_main85, [["render", _sfc_render11]]);
// node_modules/element-plus/es/components/dropdown/src/dropdown-item-impl.vue2.mjs
var _sfc_main86 = defineComponent({
name: "DropdownItemImpl",
components: {
ElIcon
},
props: dropdownItemProps,
emits: ["pointermove", "pointerleave", "click", "clickimpl"],
setup(_2, { emit }) {
const ns = useNamespace("dropdown");
const { role: menuRole } = inject(DROPDOWN_INJECTION_KEY, void 0);
const { collectionItemRef: rovingFocusCollectionItemRef } = inject(
COLLECTION_ITEM_INJECTION_KEY,
void 0
);
const {
rovingFocusGroupItemRef,
tabIndex,
handleFocus,
handleKeydown: handleItemKeydown,
handleMousedown
} = inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0);
const itemRef = composeRefs(
rovingFocusCollectionItemRef,
rovingFocusGroupItemRef
);
const role = computed(() => {
if (menuRole.value === "menu") {
return "menuitem";
} else if (menuRole.value === "navigation") {
return "link";
}
return "button";
});
const handleKeydown = composeEventHandlers((e) => {
const code = getEventCode(e);
if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(
code
)) {
e.preventDefault();
e.stopImmediatePropagation();
emit("clickimpl", e);
return true;
}
}, handleItemKeydown);
return {
ns,
itemRef,
dataset: {
[COLLECTION_ITEM_SIGN]: ""
},
role,
tabIndex,
handleFocus,
handleKeydown,
handleMousedown
};
}
});
// node_modules/element-plus/es/components/dropdown/src/dropdown-item-impl.vue.mjs
var _hoisted_140 = ["aria-disabled", "tabindex", "role"];
function _sfc_render12(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_icon = resolveComponent("el-icon");
return openBlock(), createElementBlock(
Fragment,
null,
[
_ctx.divided ? (openBlock(), createElementBlock(
"li",
{
key: 0,
role: "separator",
class: normalizeClass(_ctx.ns.bem("menu", "item", "divided"))
},
null,
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode("li", mergeProps({ ref: _ctx.itemRef }, { ..._ctx.dataset, ..._ctx.$attrs }, {
"aria-disabled": _ctx.disabled,
class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)],
tabindex: _ctx.tabIndex,
role: _ctx.role,
onClick: _cache[0] || (_cache[0] = (e) => _ctx.$emit("clickimpl", e)),
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)),
onPointermove: _cache[4] || (_cache[4] = (e) => _ctx.$emit("pointermove", e)),
onPointerleave: _cache[5] || (_cache[5] = (e) => _ctx.$emit("pointerleave", e))
}), [
_ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "icon", {}, () => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
])
]),
_: 3
/* FORWARDED */
})) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default")
], 16, _hoisted_140)
],
64
/* STABLE_FRAGMENT */
);
}
var ElDropdownItemImpl = _export_sfc(_sfc_main86, [["render", _sfc_render12]]);
// node_modules/element-plus/es/components/dropdown/src/useDropdown.mjs
var useDropdown = () => {
const elDropdown = inject(
DROPDOWN_INSTANCE_INJECTION_KEY,
{}
);
const _elDropdownSize = computed(() => elDropdown == null ? void 0 : elDropdown.dropdownSize);
return {
elDropdown,
_elDropdownSize
};
};
// node_modules/element-plus/es/components/dropdown/src/dropdown-item.vue2.mjs
var _sfc_main87 = defineComponent({
name: "ElDropdownItem",
components: {
ElRovingFocusItem,
ElDropdownItemImpl
},
inheritAttrs: false,
props: dropdownItemProps,
emits: ["pointermove", "pointerleave", "click"],
setup(props2, { emit, attrs }) {
const { elDropdown } = useDropdown();
const _instance = getCurrentInstance();
const { onItemEnter, onItemLeave } = inject(
DROPDOWN_INJECTION_KEY,
void 0
);
const handlePointerMove = composeEventHandlers(
(e) => {
emit("pointermove", e);
return e.defaultPrevented;
},
whenMouse((e) => {
if (props2.disabled) {
onItemLeave(e);
return;
}
const target2 = e.currentTarget;
if (target2 === document.activeElement || target2.contains(document.activeElement)) {
return;
}
onItemEnter(e);
if (!e.defaultPrevented) {
target2 == null ? void 0 : target2.focus({
preventScroll: true
});
}
})
);
const handlePointerLeave = composeEventHandlers((e) => {
emit("pointerleave", e);
return e.defaultPrevented;
}, whenMouse(onItemLeave));
const handleClick = composeEventHandlers(
(e) => {
if (props2.disabled) {
return;
}
emit("click", e);
return e.type !== "keydown" && e.defaultPrevented;
},
(e) => {
var _a, _b, _c;
if (props2.disabled) {
e.stopImmediatePropagation();
return;
}
if ((_a = elDropdown == null ? void 0 : elDropdown.hideOnClick) == null ? void 0 : _a.value) {
(_b = elDropdown.handleClick) == null ? void 0 : _b.call(elDropdown);
}
(_c = elDropdown.commandHandler) == null ? void 0 : _c.call(elDropdown, props2.command, _instance, e);
}
);
const propsAndAttrs = computed(() => ({ ...props2, ...attrs }));
return {
handleClick,
handlePointerMove,
handlePointerLeave,
propsAndAttrs
};
}
});
// node_modules/element-plus/es/components/dropdown/src/dropdown-item.vue.mjs
function _sfc_render13(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_dropdown_item_impl = resolveComponent("el-dropdown-item-impl");
const _component_el_roving_focus_item = resolveComponent("el-roving-focus-item");
return openBlock(), createBlock(_component_el_roving_focus_item, {
focusable: !_ctx.disabled
}, {
default: withCtx(() => [
createVNode(_component_el_dropdown_item_impl, mergeProps(_ctx.propsAndAttrs, {
onPointerleave: _ctx.handlePointerLeave,
onPointermove: _ctx.handlePointerMove,
onClickimpl: _ctx.handleClick
}), createSlots({
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.icon ? {
name: "icon",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "icon")
]),
key: "0"
} : void 0
]), 1040, ["onPointerleave", "onPointermove", "onClickimpl"])
]),
_: 3
/* FORWARDED */
}, 8, ["focusable"]);
}
var DropdownItem = _export_sfc(_sfc_main87, [["render", _sfc_render13]]);
// node_modules/element-plus/es/components/dropdown/src/dropdown-menu.vue2.mjs
var _sfc_main88 = defineComponent({
name: "ElDropdownMenu",
props: dropdownMenuProps,
setup(props2) {
const ns = useNamespace("dropdown");
const { _elDropdownSize } = useDropdown();
const size2 = _elDropdownSize.value;
const { contentRef, role, triggerId, isUsingKeyboard, handleClose } = inject(DROPDOWN_INJECTION_KEY, void 0);
const {
rovingFocusGroupRef,
rovingFocusGroupRootStyle,
onBlur,
onFocus,
onKeydown,
onMousedown
} = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
const { collectionRef: rovingFocusGroupCollectionRef } = inject(
COLLECTION_INJECTION_KEY,
void 0
);
const dropdownKls = computed(() => {
return [ns.b("menu"), ns.bm("menu", size2 == null ? void 0 : size2.value)];
});
const dropdownListWrapperRef = composeRefs(
contentRef,
rovingFocusGroupRef,
rovingFocusGroupCollectionRef
);
const handleKeydown = composeEventHandlers(
(e) => {
var _a;
(_a = props2.onKeydown) == null ? void 0 : _a.call(props2, e);
},
(e) => {
const { currentTarget, target: target2 } = e;
const code = getEventCode(e);
currentTarget.contains(
target2
);
if (EVENT_CODE.tab === code) {
return handleClose();
}
onKeydown(e);
}
);
function handleFocus(e) {
isUsingKeyboard.value && onFocus(e);
}
return {
size: size2,
rovingFocusGroupRootStyle,
dropdownKls,
role,
triggerId,
dropdownListWrapperRef,
handleKeydown,
onBlur,
handleFocus,
onMousedown
};
}
});
// node_modules/element-plus/es/components/dropdown/src/dropdown-menu.vue.mjs
var _hoisted_141 = ["role", "aria-labelledby"];
function _sfc_render14(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("ul", {
ref: _ctx.dropdownListWrapperRef,
class: normalizeClass(_ctx.dropdownKls),
style: normalizeStyle(_ctx.rovingFocusGroupRootStyle),
tabindex: -1,
role: _ctx.role,
"aria-labelledby": _ctx.triggerId,
onFocusin: _cache[0] || (_cache[0] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
onMousedown: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.onMousedown && _ctx.onMousedown(...args), ["self"]))
}, [
renderSlot(_ctx.$slots, "default")
], 46, _hoisted_141);
}
var DropdownMenu = _export_sfc(_sfc_main88, [["render", _sfc_render14]]);
// node_modules/element-plus/es/components/dropdown/index.mjs
var ElDropdown = withInstall(Dropdown, {
DropdownItem,
DropdownMenu
});
var ElDropdownItem = withNoopInstall(DropdownItem);
var ElDropdownMenu = withNoopInstall(DropdownMenu);
// node_modules/element-plus/es/components/empty/src/empty.mjs
var emptyProps = buildProps({
/**
* @description image URL of empty
*/
image: {
type: String,
default: ""
},
/**
* @description image size (width) of empty
*/
imageSize: Number,
/**
* @description description of empty
*/
description: {
type: String,
default: ""
}
});
// node_modules/element-plus/es/components/empty/src/img-empty.vue2.mjs
var _hoisted_142 = {
viewBox: "0 0 79 86",
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink"
};
var _hoisted_221 = ["id"];
var _hoisted_311 = ["stop-color"];
var _hoisted_47 = ["stop-color"];
var _hoisted_56 = ["id"];
var _hoisted_64 = ["stop-color"];
var _hoisted_73 = ["stop-color"];
var _hoisted_82 = ["id"];
var _hoisted_92 = {
stroke: "none",
"stroke-width": "1",
fill: "none",
"fill-rule": "evenodd"
};
var _hoisted_102 = { transform: "translate(-1268.000000, -535.000000)" };
var _hoisted_1110 = { transform: "translate(1268.000000, 535.000000)" };
var _hoisted_1211 = ["fill"];
var _hoisted_1310 = ["fill"];
var _hoisted_143 = { transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)" };
var _hoisted_152 = ["fill"];
var _hoisted_162 = ["fill"];
var _hoisted_172 = ["fill"];
var _hoisted_182 = ["fill"];
var _hoisted_192 = ["fill"];
var _hoisted_20 = { transform: "translate(53.000000, 45.000000)" };
var _hoisted_21 = ["fill", "xlink:href"];
var _hoisted_222 = ["fill", "mask"];
var _hoisted_232 = ["fill"];
var _sfc_main89 = defineComponent({
...{
name: "ImgEmpty"
},
__name: "img-empty",
setup(__props) {
const ns = useNamespace("empty");
const id = useId();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("svg", _hoisted_142, [
createBaseVNode("defs", null, [
createBaseVNode("linearGradient", {
id: `linearGradient-1-${unref(id)}`,
x1: "38.8503086%",
y1: "0%",
x2: "61.1496914%",
y2: "100%"
}, [
createBaseVNode("stop", {
"stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
offset: "0%"
}, null, 8, _hoisted_311),
createBaseVNode("stop", {
"stop-color": `var(${unref(ns).cssVarBlockName("fill-color-4")})`,
offset: "100%"
}, null, 8, _hoisted_47)
], 8, _hoisted_221),
createBaseVNode("linearGradient", {
id: `linearGradient-2-${unref(id)}`,
x1: "0%",
y1: "9.5%",
x2: "100%",
y2: "90.5%"
}, [
createBaseVNode("stop", {
"stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
offset: "0%"
}, null, 8, _hoisted_64),
createBaseVNode("stop", {
"stop-color": `var(${unref(ns).cssVarBlockName("fill-color-6")})`,
offset: "100%"
}, null, 8, _hoisted_73)
], 8, _hoisted_56),
createBaseVNode("rect", {
id: `path-3-${unref(id)}`,
x: "0",
y: "0",
width: "17",
height: "36"
}, null, 8, _hoisted_82)
]),
createBaseVNode("g", _hoisted_92, [
createBaseVNode("g", _hoisted_102, [
createBaseVNode("g", _hoisted_1110, [
createBaseVNode("path", {
d: "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",
fill: `var(${unref(ns).cssVarBlockName("fill-color-3")})`
}, null, 8, _hoisted_1211),
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
points: "13 58 53 58 42 45 2 45"
}, null, 8, _hoisted_1310),
createBaseVNode("g", _hoisted_143, [
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
points: "2.84078316e-14 3 18 3 23 7 5 7"
}, null, 8, _hoisted_152),
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-5")})`,
points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
}, null, 8, _hoisted_162),
createBaseVNode("rect", {
fill: `url(#linearGradient-1-${unref(id)})`,
transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
x: "38",
y: "7",
width: "17",
height: "36"
}, null, 8, _hoisted_172),
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
}, null, 8, _hoisted_182)
]),
createBaseVNode("rect", {
fill: `url(#linearGradient-2-${unref(id)})`,
x: "13",
y: "45",
width: "40",
height: "36"
}, null, 8, _hoisted_192),
createBaseVNode("g", _hoisted_20, [
createBaseVNode("use", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-8")})`,
transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
"xlink:href": `#path-3-${unref(id)}`
}, null, 8, _hoisted_21),
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-9")})`,
mask: `url(#mask-4-${unref(id)})`,
transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
points: "7 0 24 0 20 18 7 16.5"
}, null, 8, _hoisted_222)
]),
createBaseVNode("polygon", {
fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
points: "62 45 79 45 70 58 53 58"
}, null, 8, _hoisted_232)
])
])
])
]);
};
}
});
// node_modules/element-plus/es/components/empty/src/empty.vue2.mjs
var _hoisted_144 = ["src"];
var _hoisted_223 = { key: 1 };
var _sfc_main90 = defineComponent({
...{
name: "ElEmpty"
},
__name: "empty",
props: emptyProps,
setup(__props) {
const props2 = __props;
const { t } = useLocale();
const ns = useNamespace("empty");
const emptyDescription = computed(
() => props2.description || t("el.table.emptyText")
);
const imageStyle = computed(() => ({
width: addUnit(props2.imageSize)
}));
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("image")),
style: normalizeStyle(imageStyle.value)
},
[
__props.image ? (openBlock(), createElementBlock("img", {
key: 0,
src: __props.image,
ondragstart: "return false"
}, null, 8, _hoisted_144)) : renderSlot(_ctx.$slots, "image", { key: 1 }, () => [
createVNode(_sfc_main89)
])
],
6
/* CLASS, STYLE */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("description"))
},
[
_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock(
"p",
_hoisted_223,
toDisplayString(emptyDescription.value),
1
/* TEXT */
))
],
2
/* CLASS */
),
_ctx.$slots.default ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("bottom"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/empty/index.mjs
var ElEmpty = withInstall(_sfc_main90);
// node_modules/element-plus/es/components/form/src/form.mjs
var formMetaProps = buildProps({
/**
* @description Control the size of components in this form.
*/
size: {
type: String,
values: componentSizes
},
/**
* @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.
*/
disabled: Boolean
});
var formProps = buildProps({
...formMetaProps,
/**
* @description Data of form component.
*/
model: Object,
/**
* @description Validation rules of form.
*/
rules: {
type: definePropType(Object)
},
/**
* @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.
*/
labelPosition: {
type: String,
values: ["left", "right", "top"],
default: "right"
},
/**
* @description Position of asterisk.
*/
requireAsteriskPosition: {
type: String,
values: ["left", "right"],
default: "left"
},
/**
* @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.
*/
labelWidth: {
type: [String, Number],
default: ""
},
/**
* @description Suffix of the label.
*/
labelSuffix: {
type: String,
default: ""
},
/**
* @description Whether the form is inline.
*/
inline: Boolean,
/**
* @description Whether to display the error message inline with the form item.
*/
inlineMessage: Boolean,
/**
* @description Whether to display an icon indicating the validation result.
*/
statusIcon: Boolean,
/**
* @description Whether to show the error message.
*/
showMessage: {
type: Boolean,
default: true
},
/**
* @description Whether to trigger validation when the `rules` prop is changed.
*/
validateOnRuleChange: {
type: Boolean,
default: true
},
/**
* @description Whether to hide required fields should have a red asterisk (star) beside their labels.
*/
hideRequiredAsterisk: Boolean,
/**
* @description When validation fails, scroll to the first error form entry.
*/
scrollToError: Boolean,
/**
* @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.
*/
scrollIntoViewOptions: {
type: definePropType([Object, Boolean]),
default: true
}
});
var formEmits = {
validate: (prop, isValid, message2) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message2)
};
// node_modules/element-plus/es/components/form/src/utils.mjs
var SCOPE6 = "ElForm";
function useFormLabelWidth() {
const potentialLabelWidthArr = ref([]);
const autoLabelWidth = computed(() => {
if (!potentialLabelWidthArr.value.length) return "0";
const max3 = Math.max(...potentialLabelWidthArr.value);
return max3 ? `${max3}px` : "";
});
function getLabelWidthIndex(width) {
const index = potentialLabelWidthArr.value.indexOf(width);
if (index === -1 && autoLabelWidth.value === "0") {
debugWarn(SCOPE6, `unexpected width ${width}`);
}
return index;
}
function registerLabelWidth(val, oldVal) {
if (val && oldVal) {
const index = getLabelWidthIndex(oldVal);
potentialLabelWidthArr.value.splice(index, 1, val);
} else if (val) {
potentialLabelWidthArr.value.push(val);
}
}
function deregisterLabelWidth(val) {
const index = getLabelWidthIndex(val);
if (index > -1) {
potentialLabelWidthArr.value.splice(index, 1);
}
}
return {
autoLabelWidth,
registerLabelWidth,
deregisterLabelWidth
};
}
var filterFields = (fields, props2) => {
const normalized = castArray_default(props2).map(
(prop) => isArray(prop) ? prop.join(".") : prop
);
return normalized.length > 0 ? fields.filter(
(field) => field.propString && normalized.includes(field.propString)
) : fields;
};
// node_modules/element-plus/es/components/form/src/form.vue2.mjs
var COMPONENT_NAME13 = "ElForm";
var _sfc_main91 = defineComponent({
...{
name: COMPONENT_NAME13
},
__name: "form",
props: formProps,
emits: formEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const formRef = ref();
const fields = reactive([]);
const formSize = useFormSize();
const ns = useNamespace("form");
const formClasses = computed(() => {
const { labelPosition, inline: inline2 } = props2;
return [
ns.b(),
ns.m(formSize.value || "default"),
{
[ns.m(`label-${labelPosition}`)]: labelPosition,
[ns.m("inline")]: inline2
}
];
});
const getField = (prop) => {
return filterFields(fields, [prop])[0];
};
const addField = (field) => {
fields.push(field);
};
const removeField = (field) => {
if (field.prop) {
fields.splice(fields.indexOf(field), 1);
}
};
const setInitialValues = (initModel) => {
if (!props2.model) {
debugWarn(COMPONENT_NAME13, "model is required for setInitialValues to work.");
return;
}
if (!initModel) {
debugWarn(
COMPONENT_NAME13,
"initModel is required for setInitialValues to work."
);
return;
}
fields.forEach((field) => {
if (field.prop) {
if (has_default(initModel, field.prop)) {
const initValue = getProp(initModel, field.prop).value;
field.setInitialValue(initValue);
}
}
});
};
const resetFields = (properties = []) => {
if (!props2.model) {
debugWarn(COMPONENT_NAME13, "model is required for resetFields to work.");
return;
}
filterFields(fields, properties).forEach((field) => field.resetField());
};
const clearValidate = (props22 = []) => {
filterFields(fields, props22).forEach((field) => field.clearValidate());
};
const isValidatable = computed(() => {
const hasModel = !!props2.model;
if (!hasModel) {
debugWarn(COMPONENT_NAME13, "model is required for validate to work.");
}
return hasModel;
});
const obtainValidateFields = (props22) => {
if (fields.length === 0) return [];
const filteredFields = filterFields(fields, props22);
if (!filteredFields.length) {
debugWarn(COMPONENT_NAME13, "please pass correct props!");
return [];
}
return filteredFields;
};
const validate = async (callback) => validateField(void 0, callback);
const doValidateField = async (props22 = []) => {
if (!isValidatable.value) return false;
const fields2 = obtainValidateFields(props22);
if (fields2.length === 0) return true;
let validationErrors = {};
for (const field of fields2) {
try {
await field.validate("");
if (field.validateState === "error" && !field.error) field.resetField();
} catch (fields3) {
validationErrors = {
...validationErrors,
...fields3
};
}
}
if (Object.keys(validationErrors).length === 0) return true;
return Promise.reject(validationErrors);
};
const validateField = async (modelProps = [], callback) => {
let result = false;
const shouldThrow = !isFunction(callback);
try {
result = await doValidateField(modelProps);
if (result === true) {
await (callback == null ? void 0 : callback(result));
}
return result;
} catch (e) {
if (e instanceof Error) throw e;
const invalidFields = e;
if (props2.scrollToError) {
if (formRef.value) {
const formItem = formRef.value.querySelector(`.${ns.b()}-item.is-error`);
formItem == null ? void 0 : formItem.scrollIntoView(props2.scrollIntoViewOptions);
}
}
!result && await (callback == null ? void 0 : callback(false, invalidFields));
return shouldThrow && Promise.reject(invalidFields);
}
};
const scrollToField = (prop) => {
var _a;
const field = getField(prop);
if (field) {
(_a = field.$el) == null ? void 0 : _a.scrollIntoView(props2.scrollIntoViewOptions);
}
};
watch(
() => props2.rules,
() => {
if (props2.validateOnRuleChange) {
validate().catch((err) => debugWarn(err));
}
},
{ deep: true, flush: "post" }
);
provide(
formContextKey,
reactive({
...toRefs(props2),
emit,
resetFields,
clearValidate,
validateField,
getField,
addField,
removeField,
setInitialValues,
...useFormLabelWidth()
})
);
__expose({
/**
* @description Validate the whole form. Receives a callback or returns `Promise`.
*/
validate,
/**
* @description Validate specified fields.
*/
validateField,
/**
* @description Reset specified fields and remove validation result.
*/
resetFields,
/**
* @description Clear validation message for specified fields.
*/
clearValidate,
/**
* @description Scroll to the specified fields.
*/
scrollToField,
/**
* @description Get a field context.
*/
getField,
/**
* @description All fields context.
*/
fields,
/**
* @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values. Only fields present in `initModel` will be updated.
*/
setInitialValues
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"form",
{
ref_key: "formRef",
ref: formRef,
class: normalizeClass(formClasses.value)
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/form/src/form-item.mjs
var formItemValidateStates = [
"",
"error",
"validating",
"success"
];
var formItemProps = buildProps({
/**
* @description Label text.
*/
label: String,
/**
* @description Width of label, e.g. `'50px'`. `'auto'` is supported.
*/
labelWidth: {
type: [String, Number]
},
/**
* @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required. The default is extend from `form label-position`.
*/
labelPosition: {
type: String,
values: ["left", "right", "top", ""],
default: ""
},
/**
* @description A key of `model`. It could be an array of property paths (e.g `['a', 'b', '0']`). In the use of `validate` and `resetFields` method, the attribute is required.
*/
prop: {
type: definePropType([String, Array])
},
/**
* @description Whether the field is required or not, will be determined by validation rules if omitted.
*/
required: {
type: Boolean,
default: void 0
},
/**
* @description Validation rules of form, see the [following table](#formitemrule), more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
*/
rules: {
type: definePropType([Object, Array])
},
/**
* @description Field error message, set its value and the field will validate error and show this message immediately.
*/
error: String,
/**
* @description Validation state of formItem.
*/
validateStatus: {
type: String,
values: formItemValidateStates
},
/**
* @description Same as for in native label.
*/
for: String,
/**
* @description Inline style validate message.
*/
inlineMessage: {
type: Boolean,
default: void 0
},
/**
* @description Whether to show the error message.
*/
showMessage: {
type: Boolean,
default: true
},
/**
* @description Control the size of components in this form-item.
*/
size: {
type: String,
values: componentSizes
}
});
// node_modules/element-plus/es/components/form/src/form-label-wrap.mjs
var COMPONENT_NAME14 = "ElLabelWrap";
var FormLabelWrap = defineComponent({
name: COMPONENT_NAME14,
props: {
isAutoWidth: Boolean,
updateAll: Boolean
},
setup(props2, {
slots
}) {
const formContext = inject(formContextKey, void 0);
const formItemContext = inject(formItemContextKey);
if (!formItemContext) throwError(COMPONENT_NAME14, "usage: ");
const ns = useNamespace("form");
const el = ref();
const computedWidth = ref(0);
const getLabelWidth = () => {
var _a;
if ((_a = el.value) == null ? void 0 : _a.firstElementChild) {
const width = window.getComputedStyle(el.value.firstElementChild).width;
return Math.ceil(Number.parseFloat(width));
} else {
return 0;
}
};
const updateLabelWidth = (action = "update") => {
nextTick(() => {
if (slots.default && props2.isAutoWidth) {
if (action === "update") {
computedWidth.value = getLabelWidth();
} else if (action === "remove") {
formContext == null ? void 0 : formContext.deregisterLabelWidth(computedWidth.value);
}
}
});
};
const updateLabelWidthFn = () => updateLabelWidth("update");
onMounted(() => {
updateLabelWidthFn();
});
onBeforeUnmount(() => {
updateLabelWidth("remove");
});
onUpdated(() => updateLabelWidthFn());
watch(computedWidth, (val, oldVal) => {
if (props2.updateAll) {
formContext == null ? void 0 : formContext.registerLabelWidth(val, oldVal);
}
});
useResizeObserver(computed(() => {
var _a, _b;
return (_b = (_a = el.value) == null ? void 0 : _a.firstElementChild) != null ? _b : null;
}), updateLabelWidthFn);
return () => {
var _a, _b;
if (!slots) return null;
const {
isAutoWidth
} = props2;
if (isAutoWidth) {
const autoLabelWidth = formContext == null ? void 0 : formContext.autoLabelWidth;
const hasLabel = formItemContext == null ? void 0 : formItemContext.hasLabel;
const style = {};
if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") {
const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value);
const labelPosition = formItemContext.labelPosition || formContext.labelPosition;
const marginPosition = labelPosition === "left" ? "marginRight" : "marginLeft";
if (marginWidth) {
style[marginPosition] = `${marginWidth}px`;
}
}
return createVNode("div", {
"ref": el,
"class": [ns.be("item", "label-wrap")],
"style": style
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
} else {
return createVNode(Fragment, {
"ref": el
}, [(_b = slots.default) == null ? void 0 : _b.call(slots)]);
}
};
}
});
// node_modules/element-plus/es/components/form/src/form-item.vue2.mjs
var _hoisted_145 = ["role", "aria-labelledby"];
var _sfc_main92 = defineComponent({
...{
name: "ElFormItem"
},
__name: "form-item",
props: formItemProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const slots = useSlots();
const formContext = inject(formContextKey, void 0);
const parentFormItemContext = inject(formItemContextKey, void 0);
const _size = useFormSize(void 0, { formItem: false });
const ns = useNamespace("form-item");
const labelId = useId().value;
const inputIds = ref([]);
const validateState = ref("");
const validateStateDebounced = refDebounced(validateState, 100);
const validateMessage = ref("");
const formItemRef = ref();
let initialValue = void 0;
let isResettingField = false;
const labelPosition = computed(
() => props2.labelPosition || (formContext == null ? void 0 : formContext.labelPosition)
);
const labelStyle = computed(() => {
var _a;
if (labelPosition.value === "top") {
return {};
}
const labelWidth = addUnit((_a = props2.labelWidth) != null ? _a : formContext == null ? void 0 : formContext.labelWidth);
return { width: labelWidth };
});
const contentStyle = computed(() => {
var _a;
if (labelPosition.value === "top" || (formContext == null ? void 0 : formContext.inline)) {
return {};
}
if (!props2.label && !props2.labelWidth && isNested) {
return {};
}
const labelWidth = addUnit((_a = props2.labelWidth) != null ? _a : formContext == null ? void 0 : formContext.labelWidth);
if (!props2.label && !slots.label) {
return { marginLeft: labelWidth };
}
return {};
});
const formItemClasses = computed(() => [
ns.b(),
ns.m(_size.value),
ns.is("error", validateState.value === "error"),
ns.is("validating", validateState.value === "validating"),
ns.is("success", validateState.value === "success"),
ns.is("required", isRequired.value || props2.required),
ns.is("no-asterisk", formContext == null ? void 0 : formContext.hideRequiredAsterisk),
(formContext == null ? void 0 : formContext.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
{
[ns.m("feedback")]: formContext == null ? void 0 : formContext.statusIcon,
[ns.m(`label-${labelPosition.value}`)]: labelPosition.value
}
]);
const _inlineMessage = computed(
() => isBoolean(props2.inlineMessage) ? props2.inlineMessage : (formContext == null ? void 0 : formContext.inlineMessage) || false
);
const validateClasses = computed(() => [
ns.e("error"),
{ [ns.em("error", "inline")]: _inlineMessage.value }
]);
const propString = computed(() => {
if (!props2.prop) return "";
return isArray(props2.prop) ? props2.prop.join(".") : props2.prop;
});
const hasLabel = computed(() => {
return !!(props2.label || slots.label);
});
const labelFor = computed(() => {
var _a;
return (_a = props2.for) != null ? _a : inputIds.value.length === 1 ? inputIds.value[0] : void 0;
});
const isGroup = computed(() => {
return !labelFor.value && hasLabel.value;
});
const isNested = !!parentFormItemContext;
const fieldValue = computed(() => {
const model = formContext == null ? void 0 : formContext.model;
if (!model || !props2.prop) {
return;
}
return getProp(model, props2.prop).value;
});
const normalizedRules = computed(() => {
const { required } = props2;
const rules = [];
if (props2.rules) {
rules.push(...castArray_default(props2.rules));
}
const formRules = formContext == null ? void 0 : formContext.rules;
if (formRules && props2.prop) {
const _rules = getProp(
formRules,
props2.prop
).value;
if (_rules) {
rules.push(...castArray_default(_rules));
}
}
if (required !== void 0) {
const requiredRules = rules.map((rule, i) => [rule, i]).filter(([rule]) => "required" in rule);
if (requiredRules.length > 0) {
for (const [rule, i] of requiredRules) {
if (rule.required === required) continue;
rules[i] = { ...rule, required };
}
} else {
rules.push({ required });
}
}
return rules;
});
const validateEnabled = computed(() => normalizedRules.value.length > 0);
const getFilteredRule = (trigger) => {
const rules = normalizedRules.value;
return rules.filter((rule) => {
if (!rule.trigger || !trigger) return true;
if (isArray(rule.trigger)) {
return rule.trigger.includes(trigger);
} else {
return rule.trigger === trigger;
}
}).map(({ trigger: trigger2, ...rule }) => rule);
};
const isRequired = computed(
() => normalizedRules.value.some((rule) => rule.required)
);
const shouldShowError = computed(
() => {
var _a;
return validateStateDebounced.value === "error" && props2.showMessage && ((_a = formContext == null ? void 0 : formContext.showMessage) != null ? _a : true);
}
);
const currentLabel = computed(
() => `${props2.label || ""}${(formContext == null ? void 0 : formContext.labelSuffix) || ""}`
);
const setValidationState = (state) => {
validateState.value = state;
};
const onValidationFailed = (error) => {
var _a, _b;
const { errors, fields } = error;
if (!errors || !fields) {
console.error(error);
}
setValidationState("error");
validateMessage.value = errors ? (_b = (_a = errors == null ? void 0 : errors[0]) == null ? void 0 : _a.message) != null ? _b : `${props2.prop} is required` : "";
formContext == null ? void 0 : formContext.emit("validate", props2.prop, false, validateMessage.value);
};
const onValidationSucceeded = () => {
setValidationState("success");
formContext == null ? void 0 : formContext.emit("validate", props2.prop, true, "");
};
const doValidate = async (rules) => {
const modelName = propString.value;
const validator = new Schema({
[modelName]: rules
});
return validator.validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => {
onValidationSucceeded();
return true;
}).catch((err) => {
onValidationFailed(err);
return Promise.reject(err);
});
};
const validate = async (trigger, callback) => {
if (isResettingField || !props2.prop) {
return false;
}
const hasCallback = isFunction(callback);
if (!validateEnabled.value) {
callback == null ? void 0 : callback(false);
return false;
}
const rules = getFilteredRule(trigger);
if (rules.length === 0) {
callback == null ? void 0 : callback(true);
return true;
}
setValidationState("validating");
return doValidate(rules).then(() => {
callback == null ? void 0 : callback(true);
return true;
}).catch((err) => {
const { fields } = err;
callback == null ? void 0 : callback(false, fields);
return hasCallback ? false : Promise.reject(fields);
});
};
const clearValidate = () => {
setValidationState("");
validateMessage.value = "";
isResettingField = false;
};
const resetField = async () => {
const model = formContext == null ? void 0 : formContext.model;
if (!model || !props2.prop) return;
const computedValue = getProp(model, props2.prop);
isResettingField = true;
computedValue.value = clone_default(initialValue);
await nextTick();
clearValidate();
isResettingField = false;
};
const addInputId = (id) => {
if (!inputIds.value.includes(id)) {
inputIds.value.push(id);
}
};
const removeInputId = (id) => {
inputIds.value = inputIds.value.filter((listId) => listId !== id);
};
const setInitialValue = (value) => {
initialValue = clone_default(value);
};
watch(
() => props2.error,
(val) => {
validateMessage.value = val || "";
setValidationState(val ? "error" : "");
},
{ immediate: true }
);
watch(
() => props2.validateStatus,
(val) => setValidationState(val || "")
);
const context = reactive({
...toRefs(props2),
$el: formItemRef,
size: _size,
validateMessage,
validateState,
labelId,
inputIds,
isGroup,
hasLabel,
fieldValue,
addInputId,
removeInputId,
resetField,
clearValidate,
validate,
propString,
setInitialValue
});
provide(formItemContextKey, context);
onMounted(() => {
if (props2.prop) {
formContext == null ? void 0 : formContext.addField(context);
initialValue = clone_default(fieldValue.value);
}
});
onBeforeUnmount(() => {
formContext == null ? void 0 : formContext.removeField(context);
});
__expose({
/**
* @description Form item size.
*/
size: _size,
/**
* @description Validation message.
*/
validateMessage,
/**
* @description Validation state.
*/
validateState,
/**
* @description Validate form item.
*/
validate,
/**
* @description Remove validation status of the field.
*/
clearValidate,
/**
* @description Reset current field and remove validation result.
*/
resetField,
/**
* @description Set initial value for this field. When `resetField` is called, the field will reset to this value.
*/
setInitialValue
});
return (_ctx, _cache) => {
var _a;
return openBlock(), createElementBlock("div", {
ref_key: "formItemRef",
ref: formItemRef,
class: normalizeClass(formItemClasses.value),
role: isGroup.value ? "group" : void 0,
"aria-labelledby": isGroup.value ? unref(labelId) : void 0
}, [
createVNode(unref(FormLabelWrap), {
"is-auto-width": labelStyle.value.width === "auto",
"update-all": ((_a = unref(formContext)) == null ? void 0 : _a.labelWidth) === "auto"
}, {
default: withCtx(() => [
!!(__props.label || _ctx.$slots.label) ? (openBlock(), createBlock(resolveDynamicComponent(labelFor.value ? "label" : "div"), {
key: 0,
id: unref(labelId),
for: labelFor.value,
class: normalizeClass(unref(ns).e("label")),
style: normalizeStyle(labelStyle.value)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "label", { label: currentLabel.value }, () => [
createTextVNode(
toDisplayString(currentLabel.value),
1
/* TEXT */
)
])
]),
_: 3
/* FORWARDED */
}, 8, ["id", "for", "class", "style"])) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["is-auto-width", "update-all"]),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("content")),
style: normalizeStyle(contentStyle.value)
},
[
renderSlot(_ctx.$slots, "default"),
createVNode(TransitionGroup, {
name: `${unref(ns).namespace.value}-zoom-in-top`
}, {
default: withCtx(() => [
shouldShowError.value ? renderSlot(_ctx.$slots, "error", {
key: 0,
error: validateMessage.value
}, () => [
createBaseVNode(
"div",
{
class: normalizeClass(validateClasses.value)
},
toDisplayString(validateMessage.value),
3
/* TEXT, CLASS */
)
]) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["name"])
],
6
/* CLASS, STYLE */
)
], 10, _hoisted_145);
};
}
});
// node_modules/element-plus/es/components/form/index.mjs
var ElForm = withInstall(_sfc_main91, {
FormItem: _sfc_main92
});
var ElFormItem = withNoopInstall(_sfc_main92);
// node_modules/element-plus/es/components/image/src/image.mjs
var imageProps = buildProps({
/**
* @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode.
*/
hideOnClickModal: Boolean,
/**
* @description image source, same as native.
*/
src: {
type: String,
default: ""
},
/**
* @description indicate how the image should be resized to fit its container, same as [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).
*/
fit: {
type: String,
values: ["", "contain", "cover", "fill", "none", "scale-down"],
default: ""
},
/**
* @description Indicates how the browser should load the image, same as [native](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#loading)
*/
loading: {
type: String,
values: ["eager", "lazy"]
},
/**
* @description whether to use lazy load.
*/
lazy: Boolean,
/**
* @description the container to add scroll listener when using lazy load.
*/
scrollContainer: {
type: definePropType([String, Object])
},
/**
* @description allow big image preview.
*/
previewSrcList: {
type: definePropType(Array),
default: () => mutable([])
},
/**
* @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`.
*/
previewTeleported: Boolean,
/**
* @description set image preview z-index.
*/
zIndex: {
type: Number
},
/**
* @description initial preview image index, less than the length of `url-list`.
*/
initialIndex: {
type: Number,
default: 0
},
/**
* @description whether the viewer preview is infinite.
*/
infinite: {
type: Boolean,
default: true
},
/**
* @description whether the image-viewer can be closed by pressing ESC.
*/
closeOnPressEscape: {
type: Boolean,
default: true
},
/**
* @description the zoom rate of the image viewer zoom event
*/
zoomRate: {
type: Number,
default: 1.2
},
/**
* @description preview image scale.
*/
scale: {
type: Number,
default: 1
},
/**
* @description the min scale of the image viewer zoom event.
*/
minScale: {
type: Number,
default: 0.2
},
/**
* @description the max scale of the image viewer zoom event.
*/
maxScale: {
type: Number,
default: 7
},
/**
* @description show preview image progress content.
*/
showProgress: Boolean,
/**
* @description set HTML attribute: crossorigin.
*/
crossorigin: {
type: definePropType(String)
}
});
var imageEmits = {
load: (evt) => evt instanceof Event,
error: (evt) => evt instanceof Event,
switch: (val) => isNumber(val),
close: () => true,
show: () => true
};
// node_modules/element-plus/es/components/image-viewer/src/image-viewer.mjs
var imageViewerProps = buildProps({
/**
* @description preview link list.
*/
urlList: {
type: definePropType(Array),
default: () => mutable([])
},
/**
* @description preview backdrop z-index.
*/
zIndex: {
type: Number
},
/**
* @description the initial preview image index, less than or equal to the length of `url-list`.
*/
initialIndex: {
type: Number,
default: 0
},
/**
* @description whether preview is infinite.
*/
infinite: {
type: Boolean,
default: true
},
/**
* @description whether user can emit close event when clicking backdrop.
*/
hideOnClickModal: Boolean,
/**
* @description whether to append image itself to body. A nested parent element attribute transform should have this attribute set to `true`.
*/
teleported: Boolean,
/**
* @description whether the image-viewer can be closed by pressing ESC.
*/
closeOnPressEscape: {
type: Boolean,
default: true
},
/**
* @description the zoom rate of the image viewer zoom event.
*/
zoomRate: {
type: Number,
default: 1.2
},
/**
* @description preview image scale.
*/
scale: {
type: Number,
default: 1
},
/**
* @description the min scale of the image viewer zoom event.
*/
minScale: {
type: Number,
default: 0.2
},
/**
* @description the max scale of the image viewer zoom event.
*/
maxScale: {
type: Number,
default: 7
},
/**
* @description show preview image progress content.
*/
showProgress: Boolean,
/**
* @description set HTML attribute: crossorigin.
*/
crossorigin: {
type: definePropType(String)
}
});
var imageViewerEmits = {
close: () => true,
error: (evt) => evt instanceof Event,
switch: (index) => isNumber(index),
rotate: (deg) => isNumber(deg)
};
// node_modules/element-plus/es/components/image-viewer/src/image-viewer.vue2.mjs
var _hoisted_146 = ["src", "crossorigin"];
var _sfc_main93 = defineComponent({
...{
name: "ElImageViewer"
},
__name: "image-viewer",
props: imageViewerProps,
emits: imageViewerEmits,
setup(__props, { expose: __expose, emit: __emit }) {
var _a;
const modes = {
CONTAIN: {
name: "contain",
icon: markRaw(full_screen_default)
},
ORIGINAL: {
name: "original",
icon: markRaw(scale_to_original_default)
}
};
const props2 = __props;
const emit = __emit;
let stopWheelListener;
const { t } = useLocale();
const ns = useNamespace("image-viewer");
const { nextZIndex } = useZIndex();
const wrapper = ref();
const imgRef = ref();
const scopeEventListener = effectScope();
const scaleClamped = computed(() => {
const { scale, minScale, maxScale } = props2;
return clamp(scale, minScale, maxScale);
});
const loading = ref(true);
const loadError = ref(false);
const visible = ref(false);
const activeIndex = ref(props2.initialIndex);
const mode = shallowRef(modes.CONTAIN);
const transform = ref({
scale: scaleClamped.value,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
});
const zIndex2 = ref((_a = props2.zIndex) != null ? _a : nextZIndex());
useLockscreen(visible, { ns });
const isSingle = computed(() => {
const { urlList } = props2;
return urlList.length <= 1;
});
const isFirst = computed(() => activeIndex.value === 0);
const isLast = computed(() => activeIndex.value === props2.urlList.length - 1);
const currentImg = computed(() => props2.urlList[activeIndex.value]);
const arrowPrevKls = computed(() => [
ns.e("btn"),
ns.e("prev"),
ns.is("disabled", !props2.infinite && isFirst.value)
]);
const arrowNextKls = computed(() => [
ns.e("btn"),
ns.e("next"),
ns.is("disabled", !props2.infinite && isLast.value)
]);
const imgStyle = computed(() => {
const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
let translateX = offsetX / scale;
let translateY = offsetY / scale;
const radian = deg * Math.PI / 180;
const cosRadian = Math.cos(radian);
const sinRadian = Math.sin(radian);
translateX = translateX * cosRadian + translateY * sinRadian;
translateY = translateY * cosRadian - offsetX / scale * sinRadian;
const style = {
transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
transition: enableTransition ? "transform .3s" : ""
};
if (mode.value.name === modes.CONTAIN.name) {
style.maxWidth = style.maxHeight = "100%";
}
return style;
});
const progress = computed(
() => `${activeIndex.value + 1} / ${props2.urlList.length}`
);
function hide2() {
unregisterEventListener();
stopWheelListener == null ? void 0 : stopWheelListener();
visible.value = false;
emit("close");
}
function registerEventListener() {
const keydownHandler = throttle_default((e) => {
const code = getEventCode(e);
switch (code) {
// ESC
case EVENT_CODE.esc:
props2.closeOnPressEscape && hide2();
break;
// SPACE
case EVENT_CODE.space:
toggleMode();
break;
// LEFT_ARROW
case EVENT_CODE.left:
prev();
break;
// UP_ARROW
case EVENT_CODE.up:
handleActions("zoomIn");
break;
// RIGHT_ARROW
case EVENT_CODE.right:
next();
break;
// DOWN_ARROW
case EVENT_CODE.down:
handleActions("zoomOut");
break;
}
});
const mousewheelHandler = throttle_default((e) => {
const delta = e.deltaY || e.deltaX;
handleActions(delta < 0 ? "zoomIn" : "zoomOut", {
zoomRate: props2.zoomRate,
enableTransition: false
});
});
scopeEventListener.run(() => {
useEventListener(document, "keydown", keydownHandler);
useEventListener(wrapper, "wheel", mousewheelHandler);
});
}
function unregisterEventListener() {
scopeEventListener.stop();
}
function handleImgLoad() {
loading.value = false;
}
function handleImgError(e) {
loadError.value = true;
loading.value = false;
emit("error", e);
e.target.alt = t("el.image.error");
}
function handleMouseDown(e) {
if (loading.value || e.button !== 0 || !wrapper.value) return;
transform.value.enableTransition = false;
const { offsetX, offsetY } = transform.value;
const startX = e.pageX;
const startY = e.pageY;
const dragHandler = throttle_default((ev) => {
transform.value = {
...transform.value,
offsetX: offsetX + ev.pageX - startX,
offsetY: offsetY + ev.pageY - startY
};
});
const removeMousemove = useEventListener(document, "mousemove", dragHandler);
const removeMouseup = useEventListener(document, "mouseup", () => {
removeMousemove();
removeMouseup();
});
e.preventDefault();
}
function handleTouchStart(e) {
if (loading.value || !wrapper.value || e.touches.length !== 1) return;
transform.value.enableTransition = false;
const { offsetX, offsetY } = transform.value;
const { pageX: startX, pageY: startY } = e.touches[0];
const dragHandler = throttle_default((ev) => {
const targetTouch = ev.touches[0];
transform.value = {
...transform.value,
offsetX: offsetX + targetTouch.pageX - startX,
offsetY: offsetY + targetTouch.pageY - startY
};
});
const removeTouchmove = useEventListener(document, "touchmove", dragHandler);
const removeTouchend = useEventListener(document, "touchend", () => {
removeTouchmove();
removeTouchend();
});
e.preventDefault();
}
function reset() {
transform.value = {
scale: scaleClamped.value,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
};
}
function toggleMode() {
if (loading.value || loadError.value) return;
const modeNames = keysOf(modes);
const modeValues = Object.values(modes);
const currentMode = mode.value.name;
const index = modeValues.findIndex((i) => i.name === currentMode);
const nextIndex = (index + 1) % modeNames.length;
mode.value = modes[modeNames[nextIndex]];
reset();
}
function setActiveItem(index) {
loadError.value = false;
const len = props2.urlList.length;
activeIndex.value = (index + len) % len;
}
function prev() {
if (isFirst.value && !props2.infinite) return;
setActiveItem(activeIndex.value - 1);
}
function next() {
if (isLast.value && !props2.infinite) return;
setActiveItem(activeIndex.value + 1);
}
function handleActions(action, options = {}) {
if (loading.value || loadError.value) return;
const { minScale, maxScale } = props2;
const { zoomRate, rotateDeg, enableTransition } = {
zoomRate: props2.zoomRate,
rotateDeg: 90,
enableTransition: true,
...options
};
switch (action) {
case "zoomOut":
if (transform.value.scale > minScale) {
transform.value.scale = Number.parseFloat(
(transform.value.scale / zoomRate).toFixed(3)
);
}
break;
case "zoomIn":
if (transform.value.scale < maxScale) {
transform.value.scale = Number.parseFloat(
(transform.value.scale * zoomRate).toFixed(3)
);
}
break;
case "clockwise":
transform.value.deg += rotateDeg;
emit("rotate", transform.value.deg);
break;
case "anticlockwise":
transform.value.deg -= rotateDeg;
emit("rotate", transform.value.deg);
break;
}
transform.value.enableTransition = enableTransition;
}
function onFocusoutPrevented(event) {
var _a2;
if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
event.preventDefault();
}
}
function onCloseRequested() {
if (props2.closeOnPressEscape) {
hide2();
}
}
function wheelHandler(e) {
if (!e.ctrlKey) return;
if (e.deltaY < 0) {
e.preventDefault();
return false;
} else if (e.deltaY > 0) {
e.preventDefault();
return false;
}
}
watch(
() => scaleClamped.value,
(val) => {
transform.value.scale = val;
}
);
watch(currentImg, () => {
nextTick(() => {
const $img = imgRef.value;
if (!($img == null ? void 0 : $img.complete)) {
loading.value = true;
}
});
});
watch(activeIndex, (val) => {
reset();
emit("switch", val);
});
onMounted(() => {
visible.value = true;
registerEventListener();
stopWheelListener = useEventListener("wheel", wheelHandler, {
passive: false
});
});
__expose({
/**
* @description manually switch image
*/
setActiveItem
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTeleport), {
to: "body",
disabled: !__props.teleported
}, {
default: withCtx(() => [
createVNode(Transition, {
name: "viewer-fade",
appear: ""
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
ref_key: "wrapper",
ref: wrapper,
tabindex: -1,
class: normalizeClass(unref(ns).e("wrapper")),
style: normalizeStyle({ zIndex: zIndex2.value })
},
[
createVNode(unref(ElFocusTrap), {
loop: "",
trapped: "",
"focus-trap-el": wrapper.value,
"focus-start-el": "container",
onFocusoutPrevented,
onReleaseRequested: onCloseRequested
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("mask")),
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => __props.hideOnClickModal && hide2(), ["self"]))
},
null,
2
/* CLASS */
),
createCommentVNode(" CLOSE "),
createBaseVNode(
"span",
{
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("close")]),
onClick: hide2
},
[
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
})
],
2
/* CLASS */
),
createCommentVNode(" ARROW "),
!isSingle.value ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createBaseVNode(
"span",
{
class: normalizeClass(arrowPrevKls.value),
onClick: prev
},
[
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
})
],
2
/* CLASS */
),
createBaseVNode(
"span",
{
class: normalizeClass(arrowNextKls.value),
onClick: next
},
[
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
],
2
/* CLASS */
)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true),
_ctx.$slots.progress || __props.showProgress ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")])
},
[
renderSlot(_ctx.$slots, "progress", {
activeIndex: activeIndex.value,
total: __props.urlList.length
}, () => [
createTextVNode(
toDisplayString(progress.value),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createCommentVNode(" ACTIONS "),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")])
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("actions__inner"))
},
[
renderSlot(_ctx.$slots, "toolbar", {
actions: handleActions,
prev,
next,
reset: toggleMode,
activeIndex: activeIndex.value,
setActiveItem
}, () => [
createVNode(unref(ElIcon), {
onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut"))
}, {
default: withCtx(() => [
createVNode(unref(zoom_out_default))
]),
_: 1
/* STABLE */
}),
createVNode(unref(ElIcon), {
onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn"))
}, {
default: withCtx(() => [
createVNode(unref(zoom_in_default))
]),
_: 1
/* STABLE */
}),
createBaseVNode(
"i",
{
class: normalizeClass(unref(ns).e("actions__divider"))
},
null,
2
/* CLASS */
),
createVNode(unref(ElIcon), { onClick: toggleMode }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(mode.value.icon)))
]),
_: 1
/* STABLE */
}),
createBaseVNode(
"i",
{
class: normalizeClass(unref(ns).e("actions__divider"))
},
null,
2
/* CLASS */
),
createVNode(unref(ElIcon), {
onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise"))
}, {
default: withCtx(() => [
createVNode(unref(refresh_left_default))
]),
_: 1
/* STABLE */
}),
createVNode(unref(ElIcon), {
onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise"))
}, {
default: withCtx(() => [
createVNode(unref(refresh_right_default))
]),
_: 1
/* STABLE */
})
])
],
2
/* CLASS */
)
],
2
/* CLASS */
),
createCommentVNode(" CANVAS "),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("canvas"))
},
[
loadError.value && _ctx.$slots["viewer-error"] ? renderSlot(_ctx.$slots, "viewer-error", {
key: 0,
activeIndex: activeIndex.value,
src: currentImg.value
}) : (openBlock(), createElementBlock("img", {
ref_key: "imgRef",
ref: imgRef,
key: currentImg.value,
src: currentImg.value,
style: normalizeStyle(imgStyle.value),
class: normalizeClass(unref(ns).e("img")),
crossorigin: __props.crossorigin,
onLoad: handleImgLoad,
onError: handleImgError,
onMousedown: handleMouseDown,
onTouchstart: handleTouchStart
}, null, 46, _hoisted_146))
],
2
/* CLASS */
),
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["focus-trap-el"])
],
6
/* CLASS, STYLE */
)
]),
_: 3
/* FORWARDED */
})
]),
_: 3
/* FORWARDED */
}, 8, ["disabled"]);
};
}
});
// node_modules/element-plus/es/components/image-viewer/index.mjs
var ElImageViewer = withInstall(_sfc_main93);
// node_modules/element-plus/es/components/image/src/image.vue2.mjs
var _hoisted_147 = ["src", "loading", "crossorigin"];
var _hoisted_224 = { key: 0 };
var _sfc_main94 = defineComponent({
...{
name: "ElImage",
inheritAttrs: false
},
__name: "image",
props: imageProps,
emits: imageEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("image");
const rawAttrs = useAttrs();
const containerAttrs = computed(() => {
return fromPairs_default(
Object.entries(rawAttrs).filter(
([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)
)
);
});
const imgAttrs = useAttrs2({
excludeListeners: true,
excludeKeys: computed(() => {
return Object.keys(containerAttrs.value);
})
});
const imageSrc = ref();
const hasLoadError = ref(false);
const isLoading = ref(true);
const showViewer = ref(false);
const container = ref();
const _scrollContainer = ref();
const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
let stopScrollListener;
const imageKls = computed(() => [
ns.e("inner"),
preview.value && ns.e("preview"),
isLoading.value && ns.is("loading")
]);
const imageStyle = computed(() => {
const { fit } = props2;
if (isClient && fit) {
return { objectFit: fit };
}
return {};
});
const preview = computed(() => {
const { previewSrcList } = props2;
return isArray(previewSrcList) && previewSrcList.length > 0;
});
const imageIndex = computed(() => {
const { previewSrcList, initialIndex } = props2;
let previewIndex = initialIndex;
if (initialIndex > previewSrcList.length - 1) {
previewIndex = 0;
}
return previewIndex;
});
const isManual = computed(() => {
if (props2.loading === "eager") return false;
return !supportLoading && props2.loading === "lazy" || props2.lazy;
});
const loadImage = () => {
if (!isClient) return;
isLoading.value = true;
hasLoadError.value = false;
imageSrc.value = props2.src;
};
function handleLoad(event) {
isLoading.value = false;
hasLoadError.value = false;
emit("load", event);
}
function handleError(event) {
isLoading.value = false;
hasLoadError.value = true;
emit("error", event);
}
function handleLazyLoad(isIntersecting) {
if (isIntersecting) {
loadImage();
removeLazyLoadListener();
}
}
const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true);
async function addLazyLoadListener() {
var _a;
if (!isClient) return;
await nextTick();
const { scrollContainer } = props2;
if (isElement(scrollContainer)) {
_scrollContainer.value = scrollContainer;
} else if (isString(scrollContainer) && scrollContainer !== "") {
_scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
} else if (container.value) {
const scrollContainer2 = getScrollContainer(container.value);
_scrollContainer.value = isWindow(scrollContainer2) ? void 0 : scrollContainer2;
}
const { stop } = useIntersectionObserver(
container,
([entry]) => {
lazyLoadHandler(entry.isIntersecting);
},
{ root: _scrollContainer }
);
stopScrollListener = stop;
}
function removeLazyLoadListener() {
if (!isClient || !lazyLoadHandler) return;
stopScrollListener == null ? void 0 : stopScrollListener();
_scrollContainer.value = void 0;
stopScrollListener = void 0;
}
function clickHandler() {
if (!preview.value) return;
showViewer.value = true;
emit("show");
}
function closeViewer() {
showViewer.value = false;
emit("close");
}
function switchViewer(val) {
emit("switch", val);
}
watch(
() => props2.src,
() => {
if (isManual.value) {
isLoading.value = true;
hasLoadError.value = false;
removeLazyLoadListener();
addLazyLoadListener();
} else {
loadImage();
}
}
);
onMounted(() => {
if (isManual.value) {
addLazyLoadListener();
} else {
loadImage();
}
});
__expose({
/** @description manually open preview */
showPreview: clickHandler
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
mergeProps({
ref_key: "container",
ref: container
}, containerAttrs.value, {
class: [unref(ns).b(), _ctx.$attrs.class]
}),
[
hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("error"))
},
toDisplayString(unref(t)("el.image.error")),
3
/* TEXT, CLASS */
)
]) : (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(imgAttrs), {
src: imageSrc.value,
loading: __props.loading,
style: imageStyle.value,
class: imageKls.value,
crossorigin: __props.crossorigin,
onClick: clickHandler,
onLoad: handleLoad,
onError: handleError
}), null, 16, _hoisted_147)) : createCommentVNode("v-if", true),
isLoading.value ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("wrapper"))
},
[
renderSlot(_ctx.$slots, "placeholder", {}, () => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("placeholder"))
},
null,
2
/* CLASS */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)),
preview.value ? (openBlock(), createElementBlock(
Fragment,
{ key: 2 },
[
showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), {
key: 0,
"z-index": __props.zIndex,
"initial-index": imageIndex.value,
infinite: __props.infinite,
"zoom-rate": __props.zoomRate,
"min-scale": __props.minScale,
"max-scale": __props.maxScale,
"show-progress": __props.showProgress,
"url-list": __props.previewSrcList,
scale: __props.scale,
crossorigin: __props.crossorigin,
"hide-on-click-modal": __props.hideOnClickModal,
teleported: __props.previewTeleported,
"close-on-press-escape": __props.closeOnPressEscape,
onClose: closeViewer,
onSwitch: switchViewer
}, createSlots({
toolbar: withCtx((toolbar) => [
renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(toolbar)))
]),
default: withCtx(() => [
_ctx.$slots.viewer ? (openBlock(), createElementBlock("div", _hoisted_224, [
renderSlot(_ctx.$slots, "viewer")
])) : createCommentVNode("v-if", true)
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.progress ? {
name: "progress",
fn: withCtx((progress) => [
renderSlot(_ctx.$slots, "progress", normalizeProps(guardReactiveProps(progress)))
]),
key: "0"
} : void 0,
_ctx.$slots["viewer-error"] ? {
name: "viewer-error",
fn: withCtx((viewerError) => [
renderSlot(_ctx.$slots, "viewer-error", normalizeProps(guardReactiveProps(viewerError)))
]),
key: "1"
} : void 0
]), 1032, ["z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "show-progress", "url-list", "scale", "crossorigin", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
16
/* FULL_PROPS */
);
};
}
});
// node_modules/element-plus/es/components/image/index.mjs
var ElImage = withInstall(_sfc_main94);
// node_modules/element-plus/es/components/input-number/src/input-number.mjs
var inputNumberProps = buildProps({
/**
* @description same as `id` in native input
*/
id: {
type: String,
default: void 0
},
/**
* @description incremental step
*/
step: {
type: Number,
default: 1
},
/**
* @description whether input value can only be multiple of step
*/
stepStrictly: Boolean,
/**
* @description the maximum allowed value
*/
max: {
type: Number,
default: Number.MAX_SAFE_INTEGER
},
/**
* @description the minimum allowed value
*/
min: {
type: Number,
default: Number.MIN_SAFE_INTEGER
},
/**
* @description binding value
*/
modelValue: {
type: [Number, null]
},
/**
* @description same as `readonly` in native input
*/
readonly: Boolean,
/**
* @description whether the component is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description size of the component
*/
size: useSizeProp,
/**
* @description whether to enable the control buttons
*/
controls: {
type: Boolean,
default: true
},
/**
* @description position of the control buttons
*/
controlsPosition: {
type: String,
default: "",
values: ["", "right"]
},
/**
* @description value should be set when input box is cleared
*/
valueOnClear: {
type: definePropType([String, Number, null]),
validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
default: null
},
/**
* @description same as `name` in native input
*/
name: String,
/**
* @description same as `placeholder` in native input
*/
placeholder: String,
/**
* @description precision of input value
*/
precision: {
type: Number,
validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
...useAriaProps(["ariaLabel"]),
/**
* @description native input mode for virtual keyboards
*/
inputmode: {
type: definePropType(String),
default: void 0
},
/**
* @description alignment for the inner input text
*/
align: {
type: definePropType(String),
default: "center"
},
/**
* @description whether to disable scientific notation input (e.g. 'e', 'E')
*/
disabledScientific: Boolean
});
var inputNumberEmits = {
[CHANGE_EVENT]: (cur, prev) => prev !== cur,
blur: (e) => e instanceof FocusEvent,
focus: (e) => e instanceof FocusEvent,
[INPUT_EVENT]: (val) => isNumber(val) || isNil_default(val),
[UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil_default(val)
};
// node_modules/element-plus/es/components/input-number/src/input-number.vue2.mjs
var _hoisted_148 = ["aria-label"];
var _hoisted_225 = ["aria-label"];
var _sfc_main95 = defineComponent({
...{
name: "ElInputNumber"
},
__name: "input-number",
props: inputNumberProps,
emits: inputNumberEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("input-number");
const input = ref();
const data = reactive({
currentValue: props2.modelValue,
userInput: null
});
const { formItem } = useFormItem();
const minDisabled = computed(
() => isNumber(props2.modelValue) && props2.modelValue <= props2.min
);
const maxDisabled = computed(
() => isNumber(props2.modelValue) && props2.modelValue >= props2.max
);
const numPrecision = computed(() => {
const stepPrecision = getPrecision(props2.step);
if (!isUndefined(props2.precision)) {
if (stepPrecision > props2.precision) {
debugWarn(
"InputNumber",
"precision should not be less than the decimal places of step"
);
}
return props2.precision;
} else {
return Math.max(getPrecision(props2.modelValue), stepPrecision);
}
});
const controlsAtRight = computed(() => {
return props2.controls && props2.controlsPosition === "right";
});
const inputNumberSize = useFormSize();
const inputNumberDisabled = useFormDisabled();
const displayValue = computed(() => {
if (data.userInput !== null) {
return data.userInput;
}
let currentValue = data.currentValue;
if (isNil_default(currentValue)) return "";
if (isNumber(currentValue)) {
if (Number.isNaN(currentValue)) return "";
if (!isUndefined(props2.precision)) {
currentValue = currentValue.toFixed(props2.precision);
}
}
return currentValue;
});
const toPrecision = (num, pre) => {
if (isUndefined(pre)) pre = numPrecision.value;
if (pre === 0) return Math.round(num);
let snum = String(num);
const pointPos = snum.indexOf(".");
if (pointPos === -1) return num;
const nums = snum.replace(".", "").split("");
const datum = nums[pointPos + pre];
if (!datum) return num;
const length = snum.length;
if (snum.charAt(length - 1) === "5") {
snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
}
return Number.parseFloat(Number(snum).toFixed(pre));
};
const getPrecision = (value) => {
if (isNil_default(value)) return 0;
const valueString = value.toString();
const dotPosition = valueString.indexOf(".");
let precision = 0;
if (dotPosition !== -1) {
precision = valueString.length - dotPosition - 1;
}
return precision;
};
const ensurePrecision = (val, coefficient = 1) => {
if (!isNumber(val)) return data.currentValue;
if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {
debugWarn(
"InputNumber",
"The value has reached the maximum safe integer limit."
);
return val;
} else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {
debugWarn(
"InputNumber",
"The value has reached the minimum safe integer limit."
);
return val;
}
return toPrecision(val + props2.step * coefficient);
};
const handleKeydown = (event) => {
const code = getEventCode(event);
const key = getEventKey(event);
if (props2.disabledScientific && ["e", "E"].includes(key)) {
event.preventDefault();
return;
}
switch (code) {
case EVENT_CODE.up: {
event.preventDefault();
increase();
break;
}
case EVENT_CODE.down: {
event.preventDefault();
decrease();
break;
}
}
};
const increase = () => {
if (props2.readonly || inputNumberDisabled.value || maxDisabled.value) return;
const value = Number(displayValue.value) || 0;
const newVal = ensurePrecision(value);
setCurrentValue(newVal);
emit(INPUT_EVENT, data.currentValue);
setCurrentValueToModelValue();
};
const decrease = () => {
if (props2.readonly || inputNumberDisabled.value || minDisabled.value) return;
const value = Number(displayValue.value) || 0;
const newVal = ensurePrecision(value, -1);
setCurrentValue(newVal);
emit(INPUT_EVENT, data.currentValue);
setCurrentValueToModelValue();
};
const verifyValue = (value, update) => {
const { max: max3, min: min3, step: step2, precision, stepStrictly, valueOnClear } = props2;
if (max3 < min3) {
throwError("InputNumber", "min should not be greater than max.");
}
let newVal = Number(value);
if (isNil_default(value) || Number.isNaN(newVal)) {
return null;
}
if (value === "") {
if (valueOnClear === null) {
return null;
}
newVal = isString(valueOnClear) ? { min: min3, max: max3 }[valueOnClear] : valueOnClear;
}
if (stepStrictly) {
newVal = toPrecision(
Math.round(toPrecision(newVal / step2)) * step2,
precision
);
if (newVal !== value) {
update && emit(UPDATE_MODEL_EVENT, newVal);
}
}
if (!isUndefined(precision)) {
newVal = toPrecision(newVal, precision);
}
if (newVal > max3 || newVal < min3) {
newVal = newVal > max3 ? max3 : min3;
update && emit(UPDATE_MODEL_EVENT, newVal);
}
return newVal;
};
const setCurrentValue = (value, emitChange = true) => {
var _a;
const oldVal = data.currentValue;
const newVal = verifyValue(value);
if (!emitChange) {
emit(UPDATE_MODEL_EVENT, newVal);
return;
}
data.userInput = null;
if (oldVal === newVal && value) return;
emit(UPDATE_MODEL_EVENT, newVal);
if (oldVal !== newVal) {
emit(CHANGE_EVENT, newVal, oldVal);
}
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
}
data.currentValue = newVal;
};
const handleInput = (value) => {
data.userInput = value;
const newVal = value === "" ? null : Number(value);
emit(INPUT_EVENT, newVal);
setCurrentValue(newVal, false);
};
const handleInputChange = (value) => {
const newVal = value !== "" ? Number(value) : "";
if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
setCurrentValue(newVal);
}
setCurrentValueToModelValue();
data.userInput = null;
};
const focus = () => {
var _a, _b;
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
};
const blur = () => {
var _a, _b;
(_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
};
const handleFocus = (event) => {
emit("focus", event);
};
const handleBlur = (event) => {
var _a, _b;
data.userInput = null;
if (data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
input.value.input.value = "";
}
emit("blur", event);
if (props2.validateEvent) {
(_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur").catch((err) => debugWarn(err));
}
};
const setCurrentValueToModelValue = () => {
if (data.currentValue !== props2.modelValue) {
data.currentValue = props2.modelValue;
}
};
const handleWheel = (e) => {
if (document.activeElement === e.target) e.preventDefault();
};
watch(
() => props2.modelValue,
(value, oldValue) => {
const newValue = verifyValue(value, true);
if (data.userInput === null && newValue !== oldValue) {
data.currentValue = newValue;
}
},
{ immediate: true }
);
watch(
() => props2.precision,
() => {
data.currentValue = verifyValue(props2.modelValue);
}
);
onMounted(() => {
var _a;
const { min: min3, max: max3, modelValue } = props2;
const innerInput = (_a = input.value) == null ? void 0 : _a.input;
innerInput.setAttribute("role", "spinbutton");
if (Number.isFinite(max3)) {
innerInput.setAttribute("aria-valuemax", String(max3));
} else {
innerInput.removeAttribute("aria-valuemax");
}
if (Number.isFinite(min3)) {
innerInput.setAttribute("aria-valuemin", String(min3));
} else {
innerInput.removeAttribute("aria-valuemin");
}
innerInput.setAttribute(
"aria-valuenow",
data.currentValue || data.currentValue === 0 ? String(data.currentValue) : ""
);
innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
if (!isNumber(modelValue) && modelValue != null) {
let val = Number(modelValue);
if (Number.isNaN(val)) {
val = null;
}
emit(UPDATE_MODEL_EVENT, val);
}
innerInput.addEventListener("wheel", handleWheel, { passive: false });
});
onUpdated(() => {
var _a, _b;
const innerInput = (_a = input.value) == null ? void 0 : _a.input;
innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b = data.currentValue) != null ? _b : ""}`);
});
__expose({
/** @description get focus the input component */
focus,
/** @description remove focus the input component */
blur
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ns).b(),
unref(ns).m(unref(inputNumberSize)),
unref(ns).is("disabled", unref(inputNumberDisabled)),
unref(ns).is("without-controls", !__props.controls),
unref(ns).is("controls-right", controlsAtRight.value),
unref(ns).is(__props.align, !!__props.align)
]),
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["prevent"]))
},
[
__props.controls ? withDirectives((openBlock(), createElementBlock("span", {
key: 0,
role: "button",
"aria-label": unref(t)("el.inputNumber.decrease"),
class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", minDisabled.value)]),
onKeydown: withKeys(decrease, ["enter"])
}, [
renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))
]),
_: 1
/* STABLE */
})
])
], 42, _hoisted_148)), [
[unref(vRepeatClick), decrease]
]) : createCommentVNode("v-if", true),
__props.controls ? withDirectives((openBlock(), createElementBlock("span", {
key: 1,
role: "button",
"aria-label": unref(t)("el.inputNumber.increase"),
class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", maxDisabled.value)]),
onKeydown: withKeys(increase, ["enter"])
}, [
renderSlot(_ctx.$slots, "increase-icon", {}, () => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))
]),
_: 1
/* STABLE */
})
])
], 42, _hoisted_225)), [
[unref(vRepeatClick), increase]
]) : createCommentVNode("v-if", true),
createVNode(unref(ElInput), {
id: __props.id,
ref_key: "input",
ref: input,
type: "number",
step: __props.step,
"model-value": displayValue.value,
placeholder: __props.placeholder,
readonly: __props.readonly,
disabled: unref(inputNumberDisabled),
size: unref(inputNumberSize),
max: __props.max,
min: __props.min,
name: __props.name,
"aria-label": __props.ariaLabel,
"validate-event": false,
inputmode: __props.inputmode,
onKeydown: handleKeydown,
onBlur: handleBlur,
onFocus: handleFocus,
onInput: handleInput,
onChange: handleInputChange
}, createSlots({
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.prefix ? {
name: "prefix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "prefix")
]),
key: "0"
} : void 0,
_ctx.$slots.suffix ? {
name: "suffix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "suffix")
]),
key: "1"
} : void 0
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "inputmode"])
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/input-number/index.mjs
var ElInputNumber = withInstall(_sfc_main95);
// node_modules/element-plus/es/components/input-tag/src/input-tag.mjs
var inputTagProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: definePropType(Array)
},
/**
* @description max number tags that can be enter
*/
max: Number,
/**
* @description tag type
*/
tagType: { ...tagProps.type, default: "info" },
/**
* @description tag effect
*/
tagEffect: tagProps.effect,
/**
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description the key to trigger input tag
*/
trigger: {
type: definePropType(String),
default: EVENT_CODE.enter
},
/**
* @description whether tags can be dragged
*/
draggable: Boolean,
/**
* @description add a tag when a delimiter is matched
*/
delimiter: {
type: [String, RegExp],
default: ""
},
/**
* @description input box size
*/
size: useSizeProp,
/**
* @description whether to show clear button
*/
clearable: Boolean,
/**
* @description custom clear icon component
*/
clearIcon: {
type: iconPropType,
default: circle_close_default
},
/**
* @description whether to disable input-tag
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description native input readonly
*/
readonly: Boolean,
/**
* @description native input autofocus
*/
autofocus: Boolean,
/**
* @description same as `id` in native input
*/
id: {
type: String,
default: void 0
},
/**
* @description same as `tabindex` in native input
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description same as `maxlength` in native input
*/
maxlength: {
type: [String, Number]
},
/**
* @description same as `minlength` in native input
*/
minlength: {
type: [String, Number]
},
/**
* @description placeholder of input
*/
placeholder: String,
/**
* @description native input autocomplete
*/
autocomplete: {
type: definePropType(String),
default: "off"
},
/**
* @description whether to save the input value when the input loses focus
*/
saveOnBlur: {
type: Boolean,
default: true
},
/**
* @description whether to collapse tags to a text
*/
collapseTags: Boolean,
/**
* @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
*/
collapseTagsTooltip: Boolean,
/**
* @description the max tags number to be shown. To use this, `collapse-tags` must be true
*/
maxCollapseTags: {
type: Number,
default: 1
},
/**
* @description native `aria-label` attribute
*/
ariaLabel: String
});
var inputTagEmits = {
[UPDATE_MODEL_EVENT]: (value) => isArray(value) || isUndefined(value),
[CHANGE_EVENT]: (value) => isArray(value) || isUndefined(value),
[INPUT_EVENT]: (value) => isString(value),
"add-tag": (value) => isString(value) || isArray(value),
"remove-tag": (value, index) => isString(value) && isNumber(index),
"drag-tag": (oldIndex, newIndex, value) => isNumber(oldIndex) && isNumber(newIndex) && isString(value),
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true
};
// node_modules/element-plus/es/components/input-tag/src/composables/use-input-tag.mjs
function useInputTag({ props: props2, emit, formItem }) {
const disabled = useFormDisabled();
const size2 = useFormSize();
const inputRef = shallowRef();
const inputValue = ref();
const tagTooltipRef = ref();
const tagSize = computed(() => {
return ["small"].includes(size2.value) ? "small" : "default";
});
const placeholder = computed(() => {
var _a;
return ((_a = props2.modelValue) == null ? void 0 : _a.length) ? void 0 : props2.placeholder;
});
const closable = computed(() => !(props2.readonly || disabled.value));
const inputLimit = computed(() => {
var _a, _b;
return isUndefined(props2.max) ? false : ((_b = (_a = props2.modelValue) == null ? void 0 : _a.length) != null ? _b : 0) >= props2.max;
});
const showTagList = computed(() => {
var _a;
return props2.collapseTags ? (_a = props2.modelValue) == null ? void 0 : _a.slice(0, props2.maxCollapseTags) : props2.modelValue;
});
const collapseTagList = computed(() => {
var _a;
return props2.collapseTags ? (_a = props2.modelValue) == null ? void 0 : _a.slice(props2.maxCollapseTags) : [];
});
const addTagsEmit = (value) => {
var _a;
const list = [...(_a = props2.modelValue) != null ? _a : [], ...castArray_default(value)];
emit(UPDATE_MODEL_EVENT, list);
emit(CHANGE_EVENT, list);
emit("add-tag", value);
inputValue.value = void 0;
};
const getDelimitedTags = (input) => {
var _a, _b;
const tags = input.split(props2.delimiter).filter((val) => val && val !== input);
if (props2.max) {
const maxInsert = props2.max - ((_b = (_a = props2.modelValue) == null ? void 0 : _a.length) != null ? _b : 0);
tags.splice(maxInsert);
}
return tags.length === 1 ? tags[0] : tags;
};
const handleInput = (event) => {
if (inputLimit.value) {
inputValue.value = void 0;
return;
}
if (isComposing.value) return;
if (props2.delimiter && inputValue.value) {
const tags = getDelimitedTags(inputValue.value);
if (tags.length) {
addTagsEmit(tags);
}
}
emit(INPUT_EVENT, event.target.value);
};
const handleKeydown = (event) => {
var _a;
if (isComposing.value) return;
const code = getEventCode(event);
switch (code) {
case props2.trigger:
event.preventDefault();
event.stopPropagation();
handleAddTag();
break;
case EVENT_CODE.numpadEnter:
if (props2.trigger === EVENT_CODE.enter) {
event.preventDefault();
event.stopPropagation();
handleAddTag();
}
break;
case EVENT_CODE.backspace:
if (!inputValue.value && ((_a = props2.modelValue) == null ? void 0 : _a.length)) {
event.preventDefault();
event.stopPropagation();
handleRemoveTag(props2.modelValue.length - 1);
}
break;
}
};
const handleKeyup = (event) => {
if (isComposing.value || !isAndroid()) return;
const code = getEventCode(event);
switch (code) {
case EVENT_CODE.space:
if (props2.trigger === EVENT_CODE.space) {
event.preventDefault();
event.stopPropagation();
handleAddTag();
}
break;
}
};
const handleAddTag = () => {
var _a;
const value = (_a = inputValue.value) == null ? void 0 : _a.trim();
if (!value || inputLimit.value) return;
addTagsEmit(value);
};
const handleRemoveTag = (index) => {
var _a;
const value = ((_a = props2.modelValue) != null ? _a : []).slice();
const [item] = value.splice(index, 1);
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value);
emit("remove-tag", item, index);
};
const handleClear = () => {
inputValue.value = void 0;
emit(UPDATE_MODEL_EVENT, void 0);
emit(CHANGE_EVENT, void 0);
emit("clear");
};
const handleDragged = (draggingIndex, dropIndex, type) => {
var _a;
const value = ((_a = props2.modelValue) != null ? _a : []).slice();
const [draggedItem] = value.splice(draggingIndex, 1);
const step2 = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0;
value.splice(dropIndex + step2, 0, draggedItem);
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value);
emit("drag-tag", draggingIndex, dropIndex + step2, draggedItem);
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
const { wrapperRef, isFocused } = useFocusController(inputRef, {
disabled,
beforeBlur(event) {
var _a;
return (_a = tagTooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event);
},
afterBlur() {
var _a;
if (props2.saveOnBlur) {
handleAddTag();
} else {
inputValue.value = void 0;
}
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
}
}
});
const {
isComposing,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd
} = useComposition({ afterComposition: handleInput });
watch(
() => props2.modelValue,
() => {
var _a;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, CHANGE_EVENT).catch((err) => debugWarn(err));
}
}
);
return {
inputRef,
wrapperRef,
tagTooltipRef,
isFocused,
isComposing,
inputValue,
size: size2,
tagSize,
placeholder,
closable,
disabled,
inputLimit,
showTagList,
collapseTagList,
handleDragged,
handleInput,
handleKeydown,
handleKeyup,
handleAddTag,
handleRemoveTag,
handleClear,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd,
focus,
blur
};
}
// node_modules/element-plus/es/components/input-tag/src/composables/use-hovering.mjs
function useHovering() {
const hovering = ref(false);
const handleMouseEnter = () => {
hovering.value = true;
};
const handleMouseLeave = () => {
hovering.value = false;
};
return {
hovering,
handleMouseEnter,
handleMouseLeave
};
}
// node_modules/element-plus/es/components/input-tag/src/composables/use-drag-tag.mjs
function useDragTag({
wrapperRef,
handleDragged,
afterDragged
}) {
const ns = useNamespace("input-tag");
const dropIndicatorRef = shallowRef();
const showDropIndicator = ref(false);
let draggingIndex;
let draggingTag;
let dropIndex;
let dropType;
function getTagClassName(index) {
return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
}
function handleDragStart(event, index) {
draggingIndex = index;
draggingTag = wrapperRef.value.querySelector(
getTagClassName(index)
);
if (draggingTag) {
draggingTag.style.opacity = "0.5";
}
event.dataTransfer.effectAllowed = "move";
}
function handleDragOver(event, index) {
dropIndex = index;
event.preventDefault();
event.dataTransfer.dropEffect = "move";
if (isUndefined(draggingIndex) || draggingIndex === index) {
showDropIndicator.value = false;
return;
}
const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
const dropPrev = !(draggingIndex + 1 === index);
const dropNext = !(draggingIndex - 1 === index);
const distance = event.clientX - dropPosition.left;
const prevPercent = dropPrev ? dropNext ? 0.5 : 1 : -1;
const nextPercent = dropNext ? dropPrev ? 0.5 : 0 : 1;
if (distance <= dropPosition.width * prevPercent) {
dropType = "before";
} else if (distance > dropPosition.width * nextPercent) {
dropType = "after";
} else {
dropType = void 0;
}
const innerEl = wrapperRef.value.querySelector(
`.${ns.e("inner")}`
);
const innerPosition = innerEl.getBoundingClientRect();
const gap = Number.parseFloat(getStyle(innerEl, "gap")) / 2;
const indicatorTop = dropPosition.top - innerPosition.top;
let indicatorLeft = -9999;
if (dropType === "before") {
indicatorLeft = Math.max(
dropPosition.left - innerPosition.left - gap,
Math.floor(-gap / 2)
);
} else if (dropType === "after") {
const left = dropPosition.right - innerPosition.left;
indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
}
setStyle(dropIndicatorRef.value, {
top: `${indicatorTop}px`,
left: `${indicatorLeft}px`
});
showDropIndicator.value = !!dropType;
}
function handleDragEnd(event) {
event.preventDefault();
if (draggingTag) {
draggingTag.style.opacity = "";
}
if (dropType && !isUndefined(draggingIndex) && !isUndefined(dropIndex) && draggingIndex !== dropIndex) {
handleDragged(draggingIndex, dropIndex, dropType);
}
showDropIndicator.value = false;
draggingIndex = void 0;
draggingTag = null;
dropIndex = void 0;
dropType = void 0;
afterDragged == null ? void 0 : afterDragged();
}
return {
dropIndicatorRef,
showDropIndicator,
handleDragStart,
handleDragOver,
handleDragEnd
};
}
// node_modules/element-plus/es/components/input-tag/src/composables/use-input-tag-dom.mjs
function useInputTagDom({
props: props2,
isFocused,
hovering,
disabled,
inputValue,
size: size2,
validateState,
validateIcon,
needStatusIcon
}) {
const attrs = useAttrs();
const slots = useSlots();
const ns = useNamespace("input-tag");
const nsInput = useNamespace("input");
const collapseItemRef = ref();
const innerRef = ref();
const containerKls = computed(() => [
ns.b(),
ns.is("focused", isFocused.value),
ns.is("hovering", hovering.value),
ns.is("disabled", disabled.value),
ns.m(size2.value),
ns.e("wrapper"),
attrs.class
]);
const containerStyle = computed(() => [attrs.style]);
const innerKls = computed(() => {
var _a, _b;
return [
ns.e("inner"),
ns.is("draggable", props2.draggable),
ns.is("left-space", !((_a = props2.modelValue) == null ? void 0 : _a.length) && !slots.prefix),
ns.is("right-space", !((_b = props2.modelValue) == null ? void 0 : _b.length) && !showSuffix.value)
];
});
const showClear = computed(() => {
var _a;
return props2.clearable && !disabled.value && !props2.readonly && (((_a = props2.modelValue) == null ? void 0 : _a.length) || inputValue.value) && (isFocused.value || hovering.value);
});
const showSuffix = computed(() => {
return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
});
const states = reactive({
innerWidth: 0,
collapseItemWidth: 0
});
const getGapWidth = () => {
if (!innerRef.value) return 0;
const style = window.getComputedStyle(innerRef.value);
return Number.parseFloat(style.gap || "6px");
};
const resetInnerWidth = () => {
states.innerWidth = Number.parseFloat(
window.getComputedStyle(innerRef.value).width
);
};
const resetCollapseItemWidth = () => {
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
};
const tagStyle = computed(() => {
if (!props2.collapseTags) return {};
const gapWidth = getGapWidth();
const inputSlotWidth = gapWidth + MINIMUM_INPUT_WIDTH;
const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.innerWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.innerWidth - inputSlotWidth;
return { maxWidth: `${Math.max(maxWidth, 0)}px` };
});
useResizeObserver(innerRef, resetInnerWidth);
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
return {
ns,
nsInput,
containerKls,
containerStyle,
innerKls,
showClear,
showSuffix,
tagStyle,
collapseItemRef,
innerRef
};
}
// node_modules/element-plus/es/components/input-tag/src/input-tag.vue2.mjs
var _hoisted_149 = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplete", "tabindex", "placeholder", "autofocus", "ariaLabel"];
var _hoisted_226 = ["textContent"];
var _sfc_main96 = defineComponent({
...{
name: "ElInputTag",
inheritAttrs: false
},
__name: "input-tag",
props: inputTagProps,
emits: inputTagEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const attrs = useAttrs2();
const slots = useSlots();
const { form, formItem } = useFormItem();
const { inputId } = useFormItemInputId(props2, { formItemContext: formItem });
const needStatusIcon = computed(() => {
var _a;
return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
});
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
const validateIcon = computed(() => {
return validateState.value && ValidateComponentsMap[validateState.value];
});
const {
inputRef,
wrapperRef,
tagTooltipRef,
isFocused,
inputValue,
size: size2,
tagSize,
placeholder,
closable,
disabled,
showTagList,
collapseTagList,
handleDragged,
handleInput,
handleKeydown,
handleKeyup,
handleRemoveTag,
handleClear,
handleCompositionStart,
handleCompositionUpdate,
handleCompositionEnd,
focus,
blur
} = useInputTag({ props: props2, emit, formItem });
const { hovering, handleMouseEnter, handleMouseLeave } = useHovering();
const { calculatorRef, inputStyle } = useCalcInputWidth();
const {
dropIndicatorRef,
showDropIndicator,
handleDragStart,
handleDragOver,
handleDragEnd
} = useDragTag({ wrapperRef, handleDragged, afterDragged: focus });
const {
ns,
nsInput,
containerKls,
containerStyle,
innerKls,
showClear,
showSuffix,
tagStyle,
collapseItemRef,
innerRef
} = useInputTagDom({
props: props2,
hovering,
isFocused,
inputValue,
disabled,
size: size2,
validateState,
validateIcon,
needStatusIcon
});
__expose({
focus,
blur
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "wrapperRef",
ref: wrapperRef,
class: normalizeClass(unref(containerKls)),
style: normalizeStyle(unref(containerStyle)),
onMouseenter: _cache[8] || (_cache[8] = //@ts-ignore
(...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
onMouseleave: _cache[9] || (_cache[9] = //@ts-ignore
(...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args))
},
[
unref(slots).prefix ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("prefix"))
},
[
renderSlot(_ctx.$slots, "prefix")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
ref_key: "innerRef",
ref: innerRef,
class: normalizeClass(unref(innerKls))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(showTagList), (item, index) => {
return openBlock(), createBlock(unref(ElTag), {
key: index,
size: unref(tagSize),
closable: unref(closable),
type: __props.tagType,
effect: __props.tagEffect,
draggable: unref(closable) && __props.draggable,
style: normalizeStyle(unref(tagStyle)),
"disable-transitions": "",
onClose: ($event) => unref(handleRemoveTag)(index),
onDragstart: (event) => unref(handleDragStart)(event, index),
onDragover: (event) => unref(handleDragOver)(event, index),
onDragend: unref(handleDragEnd),
onDrop: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "tag", {
value: item,
index
}, () => [
createTextVNode(
toDisplayString(item),
1
/* TEXT */
)
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["size", "closable", "type", "effect", "draggable", "style", "onClose", "onDragstart", "onDragover", "onDragend"]);
}),
128
/* KEYED_FRAGMENT */
)),
__props.collapseTags && __props.modelValue && __props.modelValue.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), {
key: 0,
ref_key: "tagTooltipRef",
ref: tagTooltipRef,
disabled: !__props.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: __props.effect,
placement: "bottom"
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
ref_key: "collapseItemRef",
ref: collapseItemRef,
class: normalizeClass(unref(ns).e("collapse-tag"))
},
[
createVNode(unref(ElTag), {
closable: false,
size: unref(tagSize),
type: __props.tagType,
effect: __props.tagEffect,
"disable-transitions": ""
}, {
default: withCtx(() => [
createTextVNode(
" + " + toDisplayString(__props.modelValue.length - __props.maxCollapseTags),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["size", "type", "effect"])
],
2
/* CLASS */
)
]),
content: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("input-tag-list"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(collapseTagList), (item, index) => {
return openBlock(), createBlock(unref(ElTag), {
key: index,
size: unref(tagSize),
closable: unref(closable),
type: __props.tagType,
effect: __props.tagEffect,
"disable-transitions": "",
onClose: ($event) => unref(handleRemoveTag)(index + __props.maxCollapseTags)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "tag", {
value: item,
index: index + __props.maxCollapseTags
}, () => [
createTextVNode(
toDisplayString(item),
1
/* TEXT */
)
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["size", "closable", "type", "effect", "onClose"]);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "effect"])) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("input-wrapper"))
},
[
withDirectives(createBaseVNode("input", mergeProps({
id: unref(inputId),
ref_key: "inputRef",
ref: inputRef,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null)
}, unref(attrs), {
type: "text",
minlength: __props.minlength,
maxlength: __props.maxlength,
disabled: unref(disabled),
readonly: __props.readonly,
autocomplete: __props.autocomplete,
tabindex: __props.tabindex,
placeholder: unref(placeholder),
autofocus: __props.autofocus,
ariaLabel: __props.ariaLabel,
class: unref(ns).e("input"),
style: unref(inputStyle),
onCompositionstart: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
onCompositionupdate: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
onCompositionend: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
onInput: _cache[5] || (_cache[5] = //@ts-ignore
(...args) => unref(handleInput) && unref(handleInput)(...args)),
onKeydown: _cache[6] || (_cache[6] = //@ts-ignore
(...args) => unref(handleKeydown) && unref(handleKeydown)(...args)),
onKeyup: _cache[7] || (_cache[7] = //@ts-ignore
(...args) => unref(handleKeyup) && unref(handleKeyup)(...args))
}), null, 16, _hoisted_149), [
[vModelText, unref(inputValue)]
]),
createBaseVNode("span", {
ref_key: "calculatorRef",
ref: calculatorRef,
"aria-hidden": "true",
class: normalizeClass(unref(ns).e("input-calculator")),
textContent: toDisplayString(unref(inputValue))
}, null, 10, _hoisted_226)
],
2
/* CLASS */
),
withDirectives(createBaseVNode(
"div",
{
ref_key: "dropIndicatorRef",
ref: dropIndicatorRef,
class: normalizeClass(unref(ns).e("drop-indicator"))
},
null,
2
/* CLASS */
), [
[vShow, unref(showDropIndicator)]
])
],
2
/* CLASS */
),
unref(showSuffix) ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("suffix"))
},
[
renderSlot(_ctx.$slots, "suffix"),
unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([unref(ns).e("icon"), unref(ns).e("clear")]),
onMousedown: withModifiers(unref(NOOP), ["prevent"]),
onClick: unref(handleClear)
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onMousedown", "onClick"])) : createCommentVNode("v-if", true),
validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass([
unref(nsInput).e("icon"),
unref(nsInput).e("validateIcon"),
unref(nsInput).is("loading", validateState.value === "validating")
])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
38
/* CLASS, STYLE, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/input-tag/index.mjs
var ElInputTag = withInstall(_sfc_main96);
// node_modules/element-plus/es/components/link/src/link.mjs
var linkProps = buildProps({
/**
* @description type
*/
type: {
type: String,
values: ["primary", "success", "warning", "info", "danger", "default"],
default: void 0
},
/**
* @description when underlines should appear
*/
underline: {
type: [Boolean, String],
values: [true, false, "always", "never", "hover"],
default: void 0
},
/**
* @description whether the component is disabled
*/
disabled: Boolean,
/**
* @description same as native hyperlink's `href`
*/
href: { type: String, default: "" },
/**
* @description same as native hyperlink's `target`
*/
target: {
type: String,
default: "_self"
},
/**
* @description icon component
*/
icon: {
type: iconPropType
}
});
var linkEmits = {
click: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/link/src/link.vue2.mjs
var _hoisted_150 = ["href", "target"];
var _sfc_main97 = defineComponent({
...{
name: "ElLink"
},
__name: "link",
props: linkProps,
emits: linkEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const globalConfig2 = useGlobalConfig("link");
useDeprecated(
{
scope: "el-link",
from: "The underline option (boolean)",
replacement: "'always' | 'hover' | 'never'",
version: "3.0.0",
ref: "https://element-plus.org/en-US/component/link.html#underline"
},
computed(() => isBoolean(props2.underline))
);
const ns = useNamespace("link");
const linkKls = computed(() => {
var _a, _b, _c;
return [
ns.b(),
ns.m((_c = (_b = props2.type) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.type) != null ? _c : "default"),
ns.is("disabled", props2.disabled),
ns.is("underline", underline.value === "always"),
ns.is("hover-underline", underline.value === "hover" && !props2.disabled)
];
});
const underline = computed(() => {
var _a, _b, _c;
if (isBoolean(props2.underline)) {
return props2.underline ? "hover" : "never";
} else return (_c = (_b = props2.underline) != null ? _b : (_a = globalConfig2.value) == null ? void 0 : _a.underline) != null ? _c : "hover";
});
function handleClick(event) {
if (!props2.disabled) emit("click", event);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("a", {
class: normalizeClass(linkKls.value),
href: __props.disabled || !__props.href ? void 0 : __props.href,
target: __props.disabled || !__props.href ? void 0 : __props.target,
onClick: handleClick
}, [
__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
_ctx.$slots.default ? (openBlock(), createElementBlock(
"span",
{
key: 1,
class: normalizeClass(unref(ns).e("inner"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
_ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true)
], 10, _hoisted_150);
};
}
});
// node_modules/element-plus/es/components/link/index.mjs
var ElLink = withInstall(_sfc_main97);
// node_modules/element-plus/es/components/menu/src/utils/submenu.mjs
var __defProp4 = Object.defineProperty;
var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField4 = (obj, key, value) => __defNormalProp4(obj, typeof key !== "symbol" ? key + "" : key, value);
var SubMenu = class {
constructor(parent, domNode) {
this.parent = parent;
this.domNode = domNode;
__publicField4(this, "subMenuItems");
__publicField4(this, "subIndex", 0);
this.subIndex = 0;
this.init();
}
init() {
this.subMenuItems = this.domNode.querySelectorAll("li");
this.addListeners();
}
gotoSubIndex(idx) {
if (idx === this.subMenuItems.length) {
idx = 0;
} else if (idx < 0) {
idx = this.subMenuItems.length - 1;
}
this.subMenuItems[idx].focus();
this.subIndex = idx;
}
addListeners() {
const parentNode = this.parent.domNode;
Array.prototype.forEach.call(this.subMenuItems, (el) => {
el.addEventListener("keydown", (event) => {
const code = getEventCode(event);
let prevDef = false;
switch (code) {
case EVENT_CODE.down: {
this.gotoSubIndex(this.subIndex + 1);
prevDef = true;
break;
}
case EVENT_CODE.up: {
this.gotoSubIndex(this.subIndex - 1);
prevDef = true;
break;
}
case EVENT_CODE.tab: {
triggerEvent(parentNode, "mouseleave");
break;
}
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
case EVENT_CODE.space: {
prevDef = true;
event.currentTarget.click();
break;
}
}
if (prevDef) {
event.preventDefault();
event.stopPropagation();
}
return false;
});
});
}
};
// node_modules/element-plus/es/components/menu/src/utils/menu-item.mjs
var __defProp5 = Object.defineProperty;
var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField5 = (obj, key, value) => __defNormalProp5(obj, key + "", value);
var MenuItem = class {
constructor(domNode, namespace) {
this.domNode = domNode;
__publicField5(this, "submenu", null);
this.submenu = null;
this.init(namespace);
}
init(namespace) {
this.domNode.setAttribute("tabindex", "0");
const menuChild = this.domNode.querySelector(`.${namespace}-menu`);
if (menuChild) {
this.submenu = new SubMenu(this, menuChild);
}
this.addListeners();
}
addListeners() {
this.domNode.addEventListener("keydown", (event) => {
const code = getEventCode(event);
let prevDef = false;
switch (code) {
case EVENT_CODE.down: {
triggerEvent(event.currentTarget, "mouseenter");
this.submenu && this.submenu.gotoSubIndex(0);
prevDef = true;
break;
}
case EVENT_CODE.up: {
triggerEvent(event.currentTarget, "mouseenter");
this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
prevDef = true;
break;
}
case EVENT_CODE.tab: {
triggerEvent(event.currentTarget, "mouseleave");
break;
}
case EVENT_CODE.enter:
case EVENT_CODE.numpadEnter:
case EVENT_CODE.space: {
prevDef = true;
event.currentTarget.click();
break;
}
}
if (prevDef) {
event.preventDefault();
}
});
}
};
// node_modules/element-plus/es/components/menu/src/utils/menu-bar.mjs
var Menu = class {
constructor(domNode, namespace) {
this.domNode = domNode;
this.init(namespace);
}
init(namespace) {
const menuChildren = this.domNode.childNodes;
Array.from(menuChildren).forEach((child) => {
if (child.nodeType === 1) {
new MenuItem(child, namespace);
}
});
}
};
// node_modules/element-plus/es/components/menu/src/menu-collapse-transition.vue2.mjs
var _sfc_main98 = defineComponent({
...{
name: "ElMenuCollapseTransition"
},
__name: "menu-collapse-transition",
setup(__props) {
const ns = useNamespace("menu");
const listeners = {
onBeforeEnter: (el) => el.style.opacity = "0.2",
onEnter(el, done) {
addClass(el, `${ns.namespace.value}-opacity-transition`);
el.style.opacity = "1";
done();
},
onAfterEnter(el) {
removeClass(el, `${ns.namespace.value}-opacity-transition`);
el.style.opacity = "";
},
onBeforeLeave(el) {
if (!el.dataset) el.dataset = {};
if (hasClass(el, ns.m("collapse"))) {
removeClass(el, ns.m("collapse"));
el.dataset.oldOverflow = el.style.overflow;
el.dataset.scrollWidth = el.clientWidth.toString();
addClass(el, ns.m("collapse"));
} else {
addClass(el, ns.m("collapse"));
el.dataset.oldOverflow = el.style.overflow;
el.dataset.scrollWidth = el.clientWidth.toString();
removeClass(el, ns.m("collapse"));
}
el.style.width = `${el.scrollWidth}px`;
el.style.overflow = "hidden";
},
onLeave(el) {
addClass(el, "horizontal-collapse-transition");
el.style.width = `${el.dataset.scrollWidth}px`;
}
};
return (_ctx, _cache) => {
return openBlock(), createBlock(
Transition,
mergeProps({ mode: "out-in" }, listeners),
{
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
},
16
/* FULL_PROPS */
);
};
}
});
// node_modules/element-plus/es/components/menu/src/use-menu.mjs
function useMenu(instance, currentIndex) {
const indexPath = computed(() => {
let parent = instance.parent;
const path = [currentIndex.value];
while (parent.type.name !== "ElMenu") {
if (parent.props.index) {
path.unshift(parent.props.index);
}
parent = parent.parent;
}
return path;
});
const parentMenu = computed(() => {
let parent = instance.parent;
while (parent && !["ElMenu", "ElSubMenu"].includes(parent.type.name)) {
parent = parent.parent;
}
return parent;
});
return {
parentMenu,
indexPath
};
}
// node_modules/element-plus/es/components/menu/src/use-menu-color.mjs
function useMenuColor(props2) {
const menuBarColor = computed(() => {
const color = props2.backgroundColor;
return color ? new TinyColor(color).shade(20).toString() : "";
});
return menuBarColor;
}
// node_modules/element-plus/es/components/menu/src/use-menu-css-var.mjs
var useMenuCssVar = (props2, level) => {
const ns = useNamespace("menu");
return computed(
() => ns.cssVarBlock({
"text-color": props2.textColor || "",
"hover-text-color": props2.textColor || "",
"bg-color": props2.backgroundColor || "",
"hover-bg-color": useMenuColor(props2).value || "",
"active-color": props2.activeTextColor || "",
level: `${level}`
})
);
};
// node_modules/element-plus/es/components/menu/src/tokens.mjs
var MENU_INJECTION_KEY = "rootMenu";
var SUB_MENU_INJECTION_KEY = "subMenu:";
// node_modules/element-plus/es/components/menu/src/sub-menu.mjs
var subMenuProps = buildProps({
/**
* @description unique identification
*/
index: {
type: String,
required: true
},
/**
* @description timeout before showing a sub-menu(inherit `show-timeout` of the menu by default.)
*/
showTimeout: Number,
/**
* @description timeout before hiding a sub-menu(inherit `hide-timeout` of the menu by default.)
*/
hideTimeout: Number,
/**
* @description custom class name for the popup menu
*/
popperClass: String,
/**
* @description custom style for the popup menu
*/
popperStyle: {
type: definePropType([String, Object])
},
/**
* @description whether the sub-menu is disabled
*/
disabled: Boolean,
/**
* @description whether popup menu is teleported to the body
*/
teleported: {
type: Boolean,
default: void 0
},
/**
* @description offset of the popper (overrides the `popper` of menu)
*/
popperOffset: Number,
/**
* @description Icon when menu are expanded and submenu are closed, `expand-close-icon` and `expand-open-icon` need to be passed together to take effect
*/
expandCloseIcon: {
type: iconPropType
},
/**
* @description Icon when menu are expanded and submenu are opened, `expand-open-icon` and `expand-close-icon` need to be passed together to take effect
*/
expandOpenIcon: {
type: iconPropType
},
/**
* @description Icon when menu are collapsed and submenu are closed, `collapse-close-icon` and `collapse-open-icon` need to be passed together to take effect
*/
collapseCloseIcon: {
type: iconPropType
},
/**
* @description Icon when menu are collapsed and submenu are opened, `collapse-open-icon` and `collapse-close-icon` need to be passed together to take effect
*/
collapseOpenIcon: {
type: iconPropType
}
});
var COMPONENT_NAME15 = "ElSubMenu";
var SubMenu2 = defineComponent({
name: COMPONENT_NAME15,
props: subMenuProps,
setup(props2, { slots, expose }) {
const instance = getCurrentInstance();
const { indexPath, parentMenu } = useMenu(
instance,
computed(() => props2.index)
);
const nsMenu = useNamespace("menu");
const nsSubMenu = useNamespace("sub-menu");
const rootMenu = inject(MENU_INJECTION_KEY);
if (!rootMenu) throwError(COMPONENT_NAME15, "can not inject root menu");
const subMenu = inject(
`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`
);
if (!subMenu) throwError(COMPONENT_NAME15, "can not inject sub menu");
const items = ref({});
const subMenus = ref({});
let timeout;
const mouseInChild = ref(false);
const verticalTitleRef = ref();
const vPopper = ref();
const isFirstLevel = computed(() => subMenu.level === 0);
const currentPlacement = computed(
() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start"
);
const subMenuTitleIcon = computed(() => {
const isExpandedMode = mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse;
if (isExpandedMode) {
if (props2.expandCloseIcon && props2.expandOpenIcon) {
return opened.value ? props2.expandOpenIcon : props2.expandCloseIcon;
}
return arrow_down_default;
} else {
if (props2.collapseCloseIcon && props2.collapseOpenIcon) {
return opened.value ? props2.collapseOpenIcon : props2.collapseCloseIcon;
}
return arrow_right_default;
}
});
const appendToBody = computed(() => {
const value = props2.teleported;
return isUndefined(value) ? isFirstLevel.value : value;
});
const menuTransitionName = computed(
() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`
);
const fallbackPlacements = computed(
() => mode.value === "horizontal" && isFirstLevel.value ? [
"bottom-start",
"bottom-end",
"top-start",
"top-end",
"right-start",
"left-start"
] : [
"right-start",
"right",
"right-end",
"left-start",
"bottom-start",
"bottom-end",
"top-start",
"top-end"
]
);
const opened = computed(() => rootMenu.openedMenus.includes(props2.index));
const active = computed(
() => [...Object.values(items.value), ...Object.values(subMenus.value)].some(
({ active: active2 }) => active2
)
);
const mode = computed(() => rootMenu.props.mode);
const persistent = computed(() => rootMenu.props.persistent);
const item = reactive({
index: props2.index,
indexPath,
active
});
const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1);
const subMenuPopperOffset = computed(
() => {
var _a;
return (_a = props2.popperOffset) != null ? _a : rootMenu.props.popperOffset;
}
);
const subMenuPopperClass = computed(
() => {
var _a;
return (_a = props2.popperClass) != null ? _a : rootMenu.props.popperClass;
}
);
const subMenuPopperStyle = computed(
() => {
var _a;
return (_a = props2.popperStyle) != null ? _a : rootMenu.props.popperStyle;
}
);
const subMenuShowTimeout = computed(
() => {
var _a;
return (_a = props2.showTimeout) != null ? _a : rootMenu.props.showTimeout;
}
);
const subMenuHideTimeout = computed(
() => {
var _a;
return (_a = props2.hideTimeout) != null ? _a : rootMenu.props.hideTimeout;
}
);
const doDestroy = () => {
var _a, _b, _c;
return (_c = (_b = (_a = vPopper.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.popperInstanceRef) == null ? void 0 : _c.destroy();
};
const handleCollapseToggle = (value) => {
if (!value) {
doDestroy();
}
};
const handleClick = () => {
if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled)
return;
rootMenu.handleSubMenuClick({
index: props2.index,
indexPath: indexPath.value,
active: active.value
});
};
const handleMouseenter = (event, showTimeout = subMenuShowTimeout.value) => {
var _a;
if (event.type === "focus") return;
if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled) {
subMenu.mouseInChild.value = true;
return;
}
subMenu.mouseInChild.value = true;
timeout == null ? void 0 : timeout();
({ stop: timeout } = useTimeoutFn(() => {
rootMenu.openMenu(props2.index, indexPath.value);
}, showTimeout));
if (appendToBody.value) {
(_a = parentMenu.value.vnode.el) == null ? void 0 : _a.dispatchEvent(new MouseEvent("mouseenter"));
}
if (event.type === "mouseenter" && event.target) {
nextTick(() => {
focusElement(event.target, { preventScroll: true });
});
}
};
const handleMouseleave = (deepDispatch = false) => {
var _a;
if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") {
subMenu.mouseInChild.value = false;
return;
}
timeout == null ? void 0 : timeout();
subMenu.mouseInChild.value = false;
({ stop: timeout } = useTimeoutFn(
() => !mouseInChild.value && rootMenu.closeMenu(props2.index, indexPath.value),
subMenuHideTimeout.value
));
if (appendToBody.value && deepDispatch) {
(_a = subMenu.handleMouseleave) == null ? void 0 : _a.call(subMenu, true);
}
};
watch(
() => rootMenu.props.collapse,
(value) => handleCollapseToggle(Boolean(value))
);
{
const addSubMenu = (item2) => {
subMenus.value[item2.index] = item2;
};
const removeSubMenu = (item2) => {
delete subMenus.value[item2.index];
};
provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
addSubMenu,
removeSubMenu,
handleMouseleave,
mouseInChild,
level: subMenu.level + 1
});
}
expose({
opened
});
onMounted(() => {
rootMenu.addSubMenu(item);
subMenu.addSubMenu(item);
});
onBeforeUnmount(() => {
subMenu.removeSubMenu(item);
rootMenu.removeSubMenu(item);
});
return () => {
var _a;
const titleTag = [
(_a = slots.title) == null ? void 0 : _a.call(slots),
h(
ElIcon,
{
class: nsSubMenu.e("icon-arrow"),
style: {
transform: opened.value ? props2.expandCloseIcon && props2.expandOpenIcon || props2.collapseCloseIcon && props2.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none"
}
},
{
default: () => isString(subMenuTitleIcon.value) ? h(instance.appContext.components[subMenuTitleIcon.value]) : h(subMenuTitleIcon.value)
}
)
];
const child = rootMenu.isMenuPopup ? h(
ElTooltip,
{
ref: vPopper,
visible: opened.value,
effect: "light",
pure: true,
offset: subMenuPopperOffset.value,
showArrow: false,
persistent: persistent.value,
popperClass: subMenuPopperClass.value,
popperStyle: subMenuPopperStyle.value,
placement: currentPlacement.value,
teleported: appendToBody.value,
fallbackPlacements: fallbackPlacements.value,
transition: menuTransitionName.value,
gpuAcceleration: false
},
{
content: () => {
var _a2;
return h(
"div",
{
class: [
nsMenu.m(mode.value),
nsMenu.m("popup-container"),
subMenuPopperClass.value
],
onMouseenter: (evt) => handleMouseenter(evt, 100),
onMouseleave: () => handleMouseleave(true),
onFocus: (evt) => handleMouseenter(evt, 100)
},
[
h(
"ul",
{
class: [
nsMenu.b(),
nsMenu.m("popup"),
nsMenu.m(`popup-${currentPlacement.value}`)
],
style: ulStyle.value
},
[(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]
)
]
);
},
default: () => h(
"div",
{
class: nsSubMenu.e("title"),
onClick: handleClick
},
titleTag
)
}
) : h(Fragment, {}, [
h(
"div",
{
class: nsSubMenu.e("title"),
ref: verticalTitleRef,
onClick: handleClick
},
titleTag
),
h(
ElCollapseTransition,
{},
{
default: () => {
var _a2;
return withDirectives(
h(
"ul",
{
role: "menu",
class: [nsMenu.b(), nsMenu.m("inline")],
style: ulStyle.value
},
[(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]
),
[[vShow, opened.value]]
);
}
}
)
]);
return h(
"li",
{
class: [
nsSubMenu.b(),
nsSubMenu.is("active", active.value),
nsSubMenu.is("opened", opened.value),
nsSubMenu.is("disabled", props2.disabled)
],
role: "menuitem",
ariaHaspopup: true,
ariaExpanded: opened.value,
onMouseenter: handleMouseenter,
onMouseleave: () => handleMouseleave(),
onFocus: handleMouseenter
},
[child]
);
};
}
});
// node_modules/element-plus/es/components/menu/src/menu.mjs
var menuProps = buildProps({
/**
* @description menu display mode
*/
mode: {
type: String,
values: ["horizontal", "vertical"],
default: "vertical"
},
/**
* @description index of active menu on page load
*/
defaultActive: {
type: String,
default: ""
},
/**
* @description array that contains indexes of currently active sub-menus
*/
defaultOpeneds: {
type: definePropType(Array),
default: () => mutable([])
},
/**
* @description whether only one sub-menu can be active
*/
uniqueOpened: Boolean,
/**
* @description whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load.
*/
router: Boolean,
/**
* @description how sub-menus are triggered, only works when `mode` is 'horizontal'
*/
menuTrigger: {
type: String,
values: ["hover", "click"],
default: "hover"
},
/**
* @description whether the menu is collapsed (available only in vertical mode)
*/
collapse: Boolean,
/**
* @description background color of Menu (hex format) (deprecated, use `--bg-color` instead)
* @deprecated use `--bg-color` instead
*/
backgroundColor: String,
/**
* @description text color of Menu (hex format) (deprecated, use `--text-color` instead)
* @deprecated use `--text-color` instead
*/
textColor: String,
/**
* @description text color of currently active menu item (hex format) (deprecated, use `--active-color` instead)
* @deprecated use `--active-color` instead
*/
activeTextColor: String,
/**
* @description optional, whether menu is collapsed when clicking outside
*/
closeOnClickOutside: Boolean,
/**
* @description whether to enable the collapse transition
*/
collapseTransition: {
type: Boolean,
default: true
},
/**
* @description whether the menu is ellipsis (available only in horizontal mode)
*/
ellipsis: {
type: Boolean,
default: true
},
/**
* @description offset of the popper (effective for all submenus)
*/
popperOffset: {
type: Number,
default: 6
},
/**
* @description custom ellipsis icon (available only in horizontal mode and ellipsis is true)
*/
ellipsisIcon: {
type: iconPropType,
default: () => more_default
},
/**
* @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed
*/
popperEffect: {
type: definePropType(String),
default: "dark"
},
/**
* @description custom class name for all popup menus
*/
popperClass: String,
/**
* @description custom style for all popup menus
*/
popperStyle: {
type: definePropType([String, Object])
},
/**
* @description control timeout for all menus before showing
*/
showTimeout: {
type: Number,
default: 300
},
/**
* @description control timeout for all menus before hiding
*/
hideTimeout: {
type: Number,
default: 300
},
/**
* @description when menu inactive and `persistent` is `false` , dropdown menu will be destroyed
*/
persistent: {
type: Boolean,
default: true
}
});
var checkIndexPath = (indexPath) => isArray(indexPath) && indexPath.every((path) => isString(path));
var menuEmits = {
close: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
open: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
select: (index, indexPath, item, routerResult) => isString(index) && checkIndexPath(indexPath) && isObject(item) && (isUndefined(routerResult) || routerResult instanceof Promise)
};
var DEFAULT_MORE_ITEM_WIDTH = 64;
var Menu2 = defineComponent({
name: "ElMenu",
props: menuProps,
emits: menuEmits,
setup(props2, { emit, slots, expose }) {
const instance = getCurrentInstance();
const router = instance.appContext.config.globalProperties.$router;
const menu = ref();
const subMenu = ref();
const nsMenu = useNamespace("menu");
const nsSubMenu = useNamespace("sub-menu");
let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH;
const sliceIndex = ref(-1);
const openedMenus = ref(
props2.defaultOpeneds && !props2.collapse ? props2.defaultOpeneds.slice(0) : []
);
const activeIndex = ref(props2.defaultActive);
const items = ref({});
const subMenus = ref({});
const isMenuPopup = computed(
() => props2.mode === "horizontal" || props2.mode === "vertical" && props2.collapse
);
const initMenu = () => {
const activeItem = activeIndex.value && items.value[activeIndex.value];
if (!activeItem || props2.mode === "horizontal" || props2.collapse) return;
const indexPath = activeItem.indexPath;
indexPath.forEach((index) => {
const subMenu2 = subMenus.value[index];
subMenu2 && openMenu(index, subMenu2.indexPath);
});
};
const openMenu = (index, indexPath) => {
if (openedMenus.value.includes(index)) return;
if (props2.uniqueOpened) {
openedMenus.value = openedMenus.value.filter(
(index2) => indexPath.includes(index2)
);
}
openedMenus.value.push(index);
emit("open", index, indexPath);
};
const close2 = (index) => {
const i = openedMenus.value.indexOf(index);
if (i !== -1) {
openedMenus.value.splice(i, 1);
}
};
const closeMenu = (index, indexPath) => {
close2(index);
emit("close", index, indexPath);
};
const handleSubMenuClick = ({
index,
indexPath
}) => {
const isOpened = openedMenus.value.includes(index);
isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath);
};
const handleMenuItemClick = (menuItem) => {
if (props2.mode === "horizontal" || props2.collapse) {
openedMenus.value = [];
}
const { index, indexPath } = menuItem;
if (isNil_default(index) || isNil_default(indexPath)) return;
if (props2.router && router) {
const route = menuItem.route || index;
const routerResult = router.push(route).then((res) => {
if (!res) activeIndex.value = index;
return res;
});
emit(
"select",
index,
indexPath,
{ index, indexPath, route },
routerResult
);
} else {
activeIndex.value = index;
emit("select", index, indexPath, { index, indexPath });
}
};
const updateActiveIndex = (val) => {
var _a;
const itemsInData = items.value;
const item = itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props2.defaultActive];
activeIndex.value = (_a = item == null ? void 0 : item.index) != null ? _a : val;
};
const calcMenuItemWidth = (menuItem) => {
const computedStyle = getComputedStyle(menuItem);
const marginLeft = Number.parseInt(computedStyle.marginLeft, 10);
const marginRight = Number.parseInt(computedStyle.marginRight, 10);
return menuItem.offsetWidth + marginLeft + marginRight || 0;
};
const calcSliceIndex = () => {
if (!menu.value) return -1;
const items2 = Array.from(menu.value.childNodes).filter(
(item) => item.nodeName !== "#comment" && (item.nodeName !== "#text" || item.nodeValue)
);
const computedMenuStyle = getComputedStyle(menu.value);
const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10);
const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10);
const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight;
let calcWidth = 0;
let sliceIndex2 = 0;
items2.forEach((item, index) => {
calcWidth += calcMenuItemWidth(item);
if (calcWidth <= menuWidth - moreItemWidth) {
sliceIndex2 = index + 1;
}
});
return sliceIndex2 === items2.length ? -1 : sliceIndex2;
};
const getIndexPath = (index) => subMenus.value[index].indexPath;
const debounce = (fn2, wait = 33.34) => {
let timer;
return () => {
timer && clearTimeout(timer);
timer = setTimeout(() => {
fn2();
}, wait);
};
};
let isFirstTimeRender = true;
const handleResize = () => {
const el = unrefElement(subMenu);
if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH;
if (sliceIndex.value === calcSliceIndex()) return;
const callback = () => {
sliceIndex.value = -1;
nextTick(() => {
sliceIndex.value = calcSliceIndex();
});
};
isFirstTimeRender ? callback() : debounce(callback)();
isFirstTimeRender = false;
};
watch(
() => props2.defaultActive,
(currentActive) => {
if (!items.value[currentActive]) {
activeIndex.value = "";
}
updateActiveIndex(currentActive);
}
);
watch(
() => props2.collapse,
(value) => {
if (value) openedMenus.value = [];
}
);
watch(items.value, initMenu);
let resizeStopper;
watchEffect(() => {
if (props2.mode === "horizontal" && props2.ellipsis)
resizeStopper = useResizeObserver(menu, handleResize).stop;
else resizeStopper == null ? void 0 : resizeStopper();
});
const mouseInChild = ref(false);
{
const addSubMenu = (item) => {
subMenus.value[item.index] = item;
};
const removeSubMenu = (item) => {
delete subMenus.value[item.index];
};
const addMenuItem = (item) => {
items.value[item.index] = item;
};
const removeMenuItem = (item) => {
delete items.value[item.index];
};
provide(
MENU_INJECTION_KEY,
reactive({
props: props2,
openedMenus,
items,
subMenus,
activeIndex,
isMenuPopup,
addMenuItem,
removeMenuItem,
addSubMenu,
removeSubMenu,
openMenu,
closeMenu,
handleMenuItemClick,
handleSubMenuClick
})
);
provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
addSubMenu,
removeSubMenu,
mouseInChild,
level: 0
});
}
onMounted(() => {
if (props2.mode === "horizontal") {
new Menu(instance.vnode.el, nsMenu.namespace.value);
}
});
{
const open = (index) => {
const { indexPath } = subMenus.value[index];
indexPath.forEach((i) => openMenu(i, indexPath));
};
expose({
open,
close: close2,
updateActiveIndex,
handleResize
});
}
const ulStyle = useMenuCssVar(props2, 0);
return () => {
var _a, _b;
let slot = (_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : [];
const vShowMore = [];
if (props2.mode === "horizontal" && menu.value) {
const originalSlot = flattedChildren(slot).filter((vnode) => {
return (vnode == null ? void 0 : vnode.shapeFlag) !== 8;
});
const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value);
const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value);
if ((slotMore == null ? void 0 : slotMore.length) && props2.ellipsis) {
slot = slotDefault;
vShowMore.push(
h(
SubMenu2,
{
ref: subMenu,
index: "sub-menu-more",
class: nsSubMenu.e("hide-arrow"),
popperOffset: props2.popperOffset
},
{
title: () => h(
ElIcon,
{
class: nsSubMenu.e("icon-more")
},
{
default: () => h(props2.ellipsisIcon)
}
),
default: () => slotMore
}
)
);
}
}
const directives = props2.closeOnClickOutside ? [
[
ClickOutside,
() => {
if (!openedMenus.value.length) return;
if (!mouseInChild.value) {
openedMenus.value.forEach(
(openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu))
);
openedMenus.value = [];
}
}
]
] : [];
const vMenu = withDirectives(
h(
"ul",
{
key: String(props2.collapse),
role: "menubar",
ref: menu,
style: ulStyle.value,
class: {
[nsMenu.b()]: true,
[nsMenu.m(props2.mode)]: true,
[nsMenu.m("collapse")]: props2.collapse
}
},
[...slot, ...vShowMore]
),
directives
);
if (props2.collapseTransition && props2.mode === "vertical") {
return h(_sfc_main98, () => vMenu);
}
return vMenu;
};
}
});
// node_modules/element-plus/es/components/menu/src/menu-item.mjs
var menuItemProps = buildProps({
/**
* @description unique identification
*/
index: {
type: definePropType([String, null]),
// will be required in the next major version
// required: true,
default: null
},
/**
* @description Vue Router object
*/
route: {
type: definePropType([String, Object])
},
/**
* @description whether disabled
*/
disabled: Boolean
});
var menuItemEmits = {
click: (item) => isString(item.index) && isArray(item.indexPath)
};
// node_modules/element-plus/es/components/menu/src/menu-item.vue2.mjs
var COMPONENT_NAME16 = "ElMenuItem";
var _sfc_main99 = defineComponent({
...{
name: COMPONENT_NAME16
},
__name: "menu-item",
props: menuItemProps,
emits: menuItemEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
isPropAbsent(props2.index) && debugWarn(COMPONENT_NAME16, 'Missing required prop: "index"');
const instance = getCurrentInstance();
const rootMenu = inject(MENU_INJECTION_KEY);
const nsMenu = useNamespace("menu");
const nsMenuItem = useNamespace("menu-item");
if (!rootMenu) throwError(COMPONENT_NAME16, "can not inject root menu");
const { parentMenu, indexPath } = useMenu(instance, toRef(props2, "index"));
const subMenu = inject(
`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`
);
if (!subMenu) throwError(COMPONENT_NAME16, "can not inject sub menu");
const active = computed(() => props2.index === rootMenu.activeIndex);
const item = reactive({
index: props2.index,
indexPath,
active
});
const handleClick = () => {
if (!props2.disabled) {
rootMenu.handleMenuItemClick({
index: props2.index,
indexPath: indexPath.value,
route: props2.route
});
emit("click", item);
}
};
onMounted(() => {
subMenu.addSubMenu(item);
rootMenu.addMenuItem(item);
});
onBeforeUnmount(() => {
subMenu.removeSubMenu(item);
rootMenu.removeMenuItem(item);
});
__expose({
parentMenu,
rootMenu,
active,
nsMenu,
nsMenuItem,
handleClick
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass([
unref(nsMenuItem).b(),
unref(nsMenuItem).is("active", active.value),
unref(nsMenuItem).is("disabled", __props.disabled)
]),
role: "menuitem",
tabindex: "-1",
onClick: handleClick
},
[
unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), {
key: 0,
effect: unref(rootMenu).props.popperEffect,
placement: "right",
"fallback-placements": ["left"],
"popper-class": unref(rootMenu).props.popperClass,
"popper-style": unref(rootMenu).props.popperStyle,
persistent: unref(rootMenu).props.persistent,
"focus-on-target": ""
}, {
content: withCtx(() => [
renderSlot(_ctx.$slots, "title")
]),
default: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(unref(nsMenu).be("tooltip", "trigger"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["effect", "popper-class", "popper-style", "persistent"])) : (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
renderSlot(_ctx.$slots, "default"),
renderSlot(_ctx.$slots, "title")
],
64
/* STABLE_FRAGMENT */
))
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/menu/src/menu-item-group.mjs
var menuItemGroupProps = {
/**
* @description group title
*/
title: String
};
// node_modules/element-plus/es/components/menu/src/menu-item-group.vue2.mjs
var _sfc_main100 = defineComponent({
...{
name: "ElMenuItemGroup"
},
__name: "menu-item-group",
props: menuItemGroupProps,
setup(__props) {
const ns = useNamespace("menu-item-group");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("title"))
},
[
!_ctx.$slots.title ? (openBlock(), createElementBlock(
Fragment,
{ key: 0 },
[
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : renderSlot(_ctx.$slots, "title", { key: 1 })
],
2
/* CLASS */
),
createBaseVNode("ul", null, [
renderSlot(_ctx.$slots, "default")
])
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/menu/index.mjs
var ElMenu = withInstall(Menu2, {
MenuItem: _sfc_main99,
MenuItemGroup: _sfc_main100,
SubMenu: SubMenu2
});
var ElMenuItem = withNoopInstall(_sfc_main99);
var ElMenuItemGroup = withNoopInstall(_sfc_main100);
var ElSubMenu = withNoopInstall(SubMenu2);
// node_modules/element-plus/es/components/page-header/src/page-header.mjs
var pageHeaderProps = buildProps({
/**
* @description icon component of page header
*/
icon: {
type: iconPropType,
default: () => back_default
},
/**
* @description main title of page header
*/
title: String,
/**
* @description content of page header
*/
content: {
type: String,
default: ""
}
});
var pageHeaderEmits = {
back: () => true
};
// node_modules/element-plus/es/components/page-header/src/page-header.vue2.mjs
var _hoisted_151 = ["aria-label"];
var _sfc_main101 = defineComponent({
...{
name: "ElPageHeader"
},
__name: "page-header",
props: pageHeaderProps,
emits: pageHeaderEmits,
setup(__props, { emit: __emit }) {
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("page-header");
function handleClick() {
emit("back");
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([
unref(ns).b(),
unref(ns).is("contentful", !!_ctx.$slots.default),
{
[unref(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb,
[unref(ns).m("has-extra")]: !!_ctx.$slots.extra
}
])
},
[
_ctx.$slots.breadcrumb ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("breadcrumb"))
},
[
renderSlot(_ctx.$slots, "breadcrumb")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("header"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("left"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("back")),
role: "button",
tabindex: "0",
onClick: handleClick
},
[
__props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
key: 0,
"aria-label": __props.title || unref(t)("el.pageHeader.title"),
class: normalizeClass(unref(ns).e("icon"))
}, [
renderSlot(_ctx.$slots, "icon", {}, () => [
__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true)
])
], 10, _hoisted_151)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("title"))
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(
toDisplayString(__props.title || unref(t)("el.pageHeader.title")),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
],
2
/* CLASS */
),
createVNode(unref(ElDivider), { direction: "vertical" }),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("content"))
},
[
renderSlot(_ctx.$slots, "content", {}, () => [
createTextVNode(
toDisplayString(__props.content),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
],
2
/* CLASS */
),
_ctx.$slots.extra ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("extra"))
},
[
renderSlot(_ctx.$slots, "extra")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
_ctx.$slots.default ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("main"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/page-header/index.mjs
var ElPageHeader = withInstall(_sfc_main101);
// node_modules/element-plus/es/components/pagination/src/constants.mjs
var elPaginationKey = /* @__PURE__ */ Symbol("elPaginationKey");
// node_modules/element-plus/es/components/pagination/src/components/prev.mjs
var paginationPrevProps = buildProps({
disabled: Boolean,
currentPage: {
type: Number,
default: 1
},
prevText: {
type: String
},
prevIcon: {
type: iconPropType
}
});
var paginationPrevEmits = {
click: (evt) => evt instanceof MouseEvent
};
// node_modules/element-plus/es/components/pagination/src/components/prev.vue2.mjs
var _hoisted_153 = ["disabled", "aria-label", "aria-disabled"];
var _hoisted_227 = { key: 0 };
var _sfc_main102 = defineComponent({
...{
name: "ElPaginationPrev"
},
__name: "prev",
props: paginationPrevProps,
emits: paginationPrevEmits,
setup(__props) {
const props2 = __props;
const { t } = useLocale();
const internalDisabled = computed(
() => props2.disabled || props2.currentPage <= 1
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("button", {
type: "button",
class: "btn-prev",
disabled: internalDisabled.value,
"aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
"aria-disabled": internalDisabled.value,
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
}, [
_ctx.prevText ? (openBlock(), createElementBlock(
"span",
_hoisted_227,
toDisplayString(_ctx.prevText),
1
/* TEXT */
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))
]),
_: 1
/* STABLE */
}))
], 8, _hoisted_153);
};
}
});
// node_modules/element-plus/es/components/pagination/src/components/next.mjs
var paginationNextProps = buildProps({
disabled: Boolean,
currentPage: {
type: Number,
default: 1
},
pageCount: {
type: Number,
default: 50
},
nextText: {
type: String
},
nextIcon: {
type: iconPropType
}
});
// node_modules/element-plus/es/components/pagination/src/components/next.vue2.mjs
var _hoisted_154 = ["disabled", "aria-label", "aria-disabled"];
var _hoisted_228 = { key: 0 };
var _sfc_main103 = defineComponent({
...{
name: "ElPaginationNext"
},
__name: "next",
props: paginationNextProps,
emits: ["click"],
setup(__props) {
const props2 = __props;
const { t } = useLocale();
const internalDisabled = computed(
() => props2.disabled || props2.currentPage === props2.pageCount || props2.pageCount === 0
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("button", {
type: "button",
class: "btn-next",
disabled: internalDisabled.value,
"aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
"aria-disabled": internalDisabled.value,
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
}, [
_ctx.nextText ? (openBlock(), createElementBlock(
"span",
_hoisted_228,
toDisplayString(_ctx.nextText),
1
/* TEXT */
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))
]),
_: 1
/* STABLE */
}))
], 8, _hoisted_154);
};
}
});
// node_modules/element-plus/es/components/pagination/src/usePagination.mjs
var usePagination = () => inject(elPaginationKey, {});
// node_modules/element-plus/es/components/pagination/src/components/sizes.mjs
var paginationSizesProps = buildProps({
pageSize: {
type: Number,
required: true
},
pageSizes: {
type: definePropType(Array),
default: () => mutable([10, 20, 30, 40, 50, 100])
},
popperClass: {
type: String
},
popperStyle: {
type: definePropType([String, Object])
},
disabled: Boolean,
teleported: Boolean,
size: {
type: String,
values: componentSizes
},
appendSizeTo: String
});
// node_modules/element-plus/es/components/pagination/src/components/sizes.vue2.mjs
var _sfc_main104 = defineComponent({
...{
name: "ElPaginationSizes"
},
__name: "sizes",
props: paginationSizesProps,
emits: ["page-size-change"],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("pagination");
const pagination = usePagination();
const innerPageSize = ref(props2.pageSize);
watch(
() => props2.pageSizes,
(newVal, oldVal) => {
if (isEqual_default(newVal, oldVal)) return;
if (isArray(newVal)) {
const pageSize = newVal.includes(props2.pageSize) ? props2.pageSize : props2.pageSizes[0];
emit("page-size-change", pageSize);
}
}
);
watch(
() => props2.pageSize,
(newVal) => {
innerPageSize.value = newVal;
}
);
const innerPageSizes = computed(() => props2.pageSizes);
function handleChange(val) {
var _a;
if (val !== innerPageSize.value) {
innerPageSize.value = val;
(_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));
}
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"span",
{
class: normalizeClass(unref(ns).e("sizes"))
},
[
createVNode(unref(ElSelect), {
"model-value": innerPageSize.value,
disabled: _ctx.disabled,
"popper-class": _ctx.popperClass,
"popper-style": _ctx.popperStyle,
size: _ctx.size,
teleported: _ctx.teleported,
"validate-event": false,
"append-to": _ctx.appendSizeTo,
onChange: handleChange
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(innerPageSizes.value, (item) => {
return openBlock(), createBlock(unref(ElOption), {
key: item,
value: item,
label: item + unref(t)("el.pagination.pagesize")
}, null, 8, ["value", "label"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["model-value", "disabled", "popper-class", "popper-style", "size", "teleported", "append-to"])
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/pagination/src/components/jumper.mjs
var paginationJumperProps = buildProps({
size: {
type: String,
values: componentSizes
}
});
// node_modules/element-plus/es/components/pagination/src/components/jumper.vue2.mjs
var _hoisted_155 = ["disabled"];
var _sfc_main105 = defineComponent({
...{
name: "ElPaginationJumper"
},
__name: "jumper",
props: paginationJumperProps,
setup(__props) {
const { t } = useLocale();
const ns = useNamespace("pagination");
const { pageCount, disabled, currentPage, changeEvent } = usePagination();
const userInput = ref();
const innerValue = computed(() => {
var _a;
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
});
function handleInput(val) {
userInput.value = val ? +val : "";
}
function handleChange(val) {
val = Math.trunc(+val);
changeEvent == null ? void 0 : changeEvent(val);
userInput.value = void 0;
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: normalizeClass(unref(ns).e("jump")),
disabled: unref(disabled)
}, [
createBaseVNode(
"span",
{
class: normalizeClass([unref(ns).e("goto")])
},
toDisplayString(unref(t)("el.pagination.goto")),
3
/* TEXT, CLASS */
),
createVNode(unref(ElInput), {
size: _ctx.size,
class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
min: 1,
max: unref(pageCount),
disabled: unref(disabled),
"model-value": innerValue.value,
"validate-event": false,
"aria-label": unref(t)("el.pagination.page"),
type: "number",
"onUpdate:modelValue": handleInput,
onChange: handleChange
}, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
createBaseVNode(
"span",
{
class: normalizeClass([unref(ns).e("classifier")])
},
toDisplayString(unref(t)("el.pagination.pageClassifier")),
3
/* TEXT, CLASS */
)
], 10, _hoisted_155);
};
}
});
// node_modules/element-plus/es/components/pagination/src/components/total.mjs
var paginationTotalProps = buildProps({
total: {
type: Number,
default: 1e3
}
});
// node_modules/element-plus/es/components/pagination/src/components/total.vue2.mjs
var _hoisted_156 = ["disabled"];
var _sfc_main106 = defineComponent({
...{
name: "ElPaginationTotal"
},
__name: "total",
props: paginationTotalProps,
setup(__props) {
const { t } = useLocale();
const ns = useNamespace("pagination");
const { disabled } = usePagination();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: normalizeClass(unref(ns).e("total")),
disabled: unref(disabled)
}, toDisplayString(unref(t)("el.pagination.total", {
total: _ctx.total
})), 11, _hoisted_156);
};
}
});
// node_modules/element-plus/es/components/pagination/src/components/pager.mjs
var paginationPagerProps = buildProps({
currentPage: {
type: Number,
default: 1
},
pageCount: {
type: Number,
required: true
},
pagerCount: {
type: Number,
default: 7
},
disabled: Boolean
});
// node_modules/element-plus/es/components/pagination/src/components/pager.vue2.mjs
var _hoisted_157 = ["aria-current", "aria-label", "tabindex"];
var _hoisted_229 = ["tabindex", "aria-label"];
var _hoisted_312 = ["aria-current", "aria-label", "tabindex"];
var _hoisted_48 = ["tabindex", "aria-label"];
var _hoisted_57 = ["aria-current", "aria-label", "tabindex"];
var _sfc_main107 = defineComponent({
...{
name: "ElPaginationPager"
},
__name: "pager",
props: paginationPagerProps,
emits: [CHANGE_EVENT],
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const nsPager = useNamespace("pager");
const nsIcon = useNamespace("icon");
const { t } = useLocale();
const showPrevMore = ref(false);
const showNextMore = ref(false);
const quickPrevHover = ref(false);
const quickNextHover = ref(false);
const quickPrevFocus = ref(false);
const quickNextFocus = ref(false);
const pagers = computed(() => {
const pagerCount = props2.pagerCount;
const halfPagerCount = (pagerCount - 1) / 2;
const currentPage = Number(props2.currentPage);
const pageCount = Number(props2.pageCount);
let showPrevMore2 = false;
let showNextMore2 = false;
if (pageCount > pagerCount) {
if (currentPage > pagerCount - halfPagerCount) {
showPrevMore2 = true;
}
if (currentPage < pageCount - halfPagerCount) {
showNextMore2 = true;
}
}
const array = [];
if (showPrevMore2 && !showNextMore2) {
const startPage = pageCount - (pagerCount - 2);
for (let i = startPage; i < pageCount; i++) {
array.push(i);
}
} else if (!showPrevMore2 && showNextMore2) {
for (let i = 2; i < pagerCount; i++) {
array.push(i);
}
} else if (showPrevMore2 && showNextMore2) {
const offset3 = Math.floor(pagerCount / 2) - 1;
for (let i = currentPage - offset3; i <= currentPage + offset3; i++) {
array.push(i);
}
} else {
for (let i = 2; i < pageCount; i++) {
array.push(i);
}
}
return array;
});
const prevMoreKls = computed(() => [
"more",
"btn-quickprev",
nsIcon.b(),
nsPager.is("disabled", props2.disabled)
]);
const nextMoreKls = computed(() => [
"more",
"btn-quicknext",
nsIcon.b(),
nsPager.is("disabled", props2.disabled)
]);
const tabindex = computed(() => props2.disabled ? -1 : 0);
watch(
() => [props2.pageCount, props2.pagerCount, props2.currentPage],
([pageCount, pagerCount, currentPage]) => {
const halfPagerCount = (pagerCount - 1) / 2;
let showPrev = false;
let showNext = false;
if (pageCount > pagerCount) {
showPrev = currentPage > pagerCount - halfPagerCount;
showNext = currentPage < pageCount - halfPagerCount;
}
quickPrevHover.value && (quickPrevHover.value = showPrev);
quickNextHover.value && (quickNextHover.value = showNext);
showPrevMore.value = showPrev;
showNextMore.value = showNext;
},
{ immediate: true }
);
function onMouseEnter(forward = false) {
if (props2.disabled) return;
if (forward) {
quickPrevHover.value = true;
} else {
quickNextHover.value = true;
}
}
function onFocus(forward = false) {
if (forward) {
quickPrevFocus.value = true;
} else {
quickNextFocus.value = true;
}
}
function onEnter(e) {
const target2 = e.target;
if (target2.tagName.toLowerCase() === "li" && Array.from(target2.classList).includes("number")) {
const newPage = Number(target2.textContent);
if (newPage !== props2.currentPage) {
emit(CHANGE_EVENT, newPage);
}
} else if (target2.tagName.toLowerCase() === "li" && Array.from(target2.classList).includes("more")) {
onPagerClick(e);
}
}
function onPagerClick(event) {
const target2 = event.target;
if (target2.tagName.toLowerCase() === "ul" || props2.disabled) {
return;
}
let newPage = Number(target2.textContent);
const pageCount = props2.pageCount;
const currentPage = props2.currentPage;
const pagerCountOffset = props2.pagerCount - 2;
if (target2.className.includes("more")) {
if (target2.className.includes("quickprev")) {
newPage = currentPage - pagerCountOffset;
} else if (target2.className.includes("quicknext")) {
newPage = currentPage + pagerCountOffset;
}
}
if (!Number.isNaN(+newPage)) {
if (newPage < 1) {
newPage = 1;
}
if (newPage > pageCount) {
newPage = pageCount;
}
}
if (newPage !== currentPage) {
emit(CHANGE_EVENT, newPage);
}
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"ul",
{
class: normalizeClass(unref(nsPager).b()),
onClick: onPagerClick,
onKeyup: withKeys(onEnter, ["enter"])
},
[
_ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", {
key: 0,
class: normalizeClass([[
unref(nsPager).is("active", _ctx.currentPage === 1),
unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === 1,
"aria-label": unref(t)("el.pagination.currentPage", { pager: 1 }),
tabindex: tabindex.value
}, " 1 ", 10, _hoisted_157)) : createCommentVNode("v-if", true),
showPrevMore.value ? (openBlock(), createElementBlock("li", {
key: 1,
class: normalizeClass(prevMoreKls.value),
tabindex: tabindex.value,
"aria-label": unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
}, [
(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_left_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))
], 42, _hoisted_229)) : createCommentVNode("v-if", true),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(pagers.value, (pager) => {
return openBlock(), createElementBlock("li", {
key: pager,
class: normalizeClass([[
unref(nsPager).is("active", _ctx.currentPage === pager),
unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === pager,
"aria-label": unref(t)("el.pagination.currentPage", { pager }),
tabindex: tabindex.value
}, toDisplayString(pager), 11, _hoisted_312);
}),
128
/* KEYED_FRAGMENT */
)),
showNextMore.value ? (openBlock(), createElementBlock("li", {
key: 2,
class: normalizeClass(nextMoreKls.value),
tabindex: tabindex.value,
"aria-label": unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
}, [
(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_right_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))
], 42, _hoisted_48)) : createCommentVNode("v-if", true),
_ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", {
key: 3,
class: normalizeClass([[
unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === _ctx.pageCount,
"aria-label": unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
tabindex: tabindex.value
}, toDisplayString(_ctx.pageCount), 11, _hoisted_57)) : createCommentVNode("v-if", true)
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/pagination/src/pagination.mjs
var isAbsent = (v2) => typeof v2 !== "number";
var paginationProps = buildProps({
/**
* @description options of item count per page
*/
pageSize: Number,
/**
* @description default initial value of page size, not setting is the same as setting 10
*/
defaultPageSize: Number,
/**
* @description total item count
*/
total: Number,
/**
* @description total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required
*/
pageCount: Number,
/**
* @description number of pagers. Pagination collapses when the total page count exceeds this value
*/
pagerCount: {
type: Number,
validator: (value) => {
return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
},
default: 7
},
/**
* @description current page number
*/
currentPage: Number,
/**
* @description default initial value of current-page, not setting is the same as setting 1
*/
defaultCurrentPage: Number,
/**
* @description layout of Pagination, elements separated with a comma
*/
layout: {
type: String,
default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
},
/**
* @description item count of each page
*/
pageSizes: {
type: definePropType(Array),
default: () => mutable([10, 20, 30, 40, 50, 100])
},
/**
* @description custom class name for the page size Select's dropdown
*/
popperClass: {
type: String,
default: ""
},
/**
* @description custom style for the page size Select's dropdown
*/
popperStyle: {
type: definePropType([String, Object])
},
/**
* @description text for the prev button
*/
prevText: {
type: String,
default: ""
},
/**
* @description icon for the prev button, higher priority of `prev-text`
*/
prevIcon: {
type: iconPropType,
default: () => arrow_left_default
},
/**
* @description text for the next button
*/
nextText: {
type: String,
default: ""
},
/**
* @description icon for the next button, higher priority of `next-text`
*/
nextIcon: {
type: iconPropType,
default: () => arrow_right_default
},
/**
* @description whether Pagination size is teleported to body
*/
teleported: {
type: Boolean,
default: true
},
/**
* @description whether to use small pagination
*/
small: Boolean,
/**
* @description set page size
*/
size: useSizeProp,
/**
* @description whether the buttons have a background color
*/
background: Boolean,
/**
* @description whether Pagination is disabled
*/
disabled: Boolean,
/**
* @description whether to hide when there's only one page
*/
hideOnSinglePage: Boolean,
/**
* @description which element the size dropdown appends to.
*/
appendSizeTo: String
});
var paginationEmits = {
"update:current-page": (val) => isNumber(val),
"update:page-size": (val) => isNumber(val),
"size-change": (val) => isNumber(val),
change: (currentPage, pageSize) => isNumber(currentPage) && isNumber(pageSize),
"current-change": (val) => isNumber(val),
"prev-click": (val) => isNumber(val),
"next-click": (val) => isNumber(val)
};
var componentName = "ElPagination";
var Pagination = defineComponent({
name: componentName,
props: paginationProps,
emits: paginationEmits,
setup(props2, { emit, slots }) {
const { t } = useLocale();
const ns = useNamespace("pagination");
const vnodeProps = getCurrentInstance().vnode.props || {};
const _globalSize = useGlobalSize();
const _size = computed(
() => {
var _a;
return props2.small ? "small" : (_a = props2.size) != null ? _a : _globalSize.value;
}
);
useDeprecated(
{
from: "small",
replacement: "size",
version: "3.0.0",
scope: "el-pagination",
ref: "https://element-plus.org/zh-CN/component/pagination.html"
},
computed(() => !!props2.small)
);
const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
const assertValidUsage = computed(() => {
if (isAbsent(props2.total) && isAbsent(props2.pageCount)) return false;
if (!isAbsent(props2.currentPage) && !hasCurrentPageListener) return false;
if (props2.layout.includes("sizes")) {
if (!isAbsent(props2.pageCount)) {
if (!hasPageSizeListener) return false;
} else if (!isAbsent(props2.total)) {
if (!isAbsent(props2.pageSize)) {
if (!hasPageSizeListener) {
return false;
}
}
}
}
return true;
});
const innerPageSize = ref(
isAbsent(props2.defaultPageSize) ? 10 : props2.defaultPageSize
);
const innerCurrentPage = ref(
isAbsent(props2.defaultCurrentPage) ? 1 : props2.defaultCurrentPage
);
const pageSizeBridge = computed({
get() {
return isAbsent(props2.pageSize) ? innerPageSize.value : props2.pageSize;
},
set(v2) {
if (isAbsent(props2.pageSize)) {
innerPageSize.value = v2;
}
if (hasPageSizeListener) {
emit("update:page-size", v2);
emit("size-change", v2);
}
}
});
const pageCountBridge = computed(() => {
let pageCount = 0;
if (!isAbsent(props2.pageCount)) {
pageCount = props2.pageCount;
} else if (!isAbsent(props2.total)) {
pageCount = Math.max(1, Math.ceil(props2.total / pageSizeBridge.value));
}
return pageCount;
});
const currentPageBridge = computed({
get() {
return isAbsent(props2.currentPage) ? innerCurrentPage.value : props2.currentPage;
},
set(v2) {
let newCurrentPage = v2;
if (v2 < 1) {
newCurrentPage = 1;
} else if (v2 > pageCountBridge.value) {
newCurrentPage = pageCountBridge.value;
}
if (isAbsent(props2.currentPage)) {
innerCurrentPage.value = newCurrentPage;
}
if (hasCurrentPageListener) {
emit("update:current-page", newCurrentPage);
emit("current-change", newCurrentPage);
}
}
});
watch(pageCountBridge, (val) => {
if (currentPageBridge.value > val) currentPageBridge.value = val;
});
watch(
[currentPageBridge, pageSizeBridge],
(value) => {
emit(CHANGE_EVENT, ...value);
},
{ flush: "post" }
);
function handleCurrentChange2(val) {
currentPageBridge.value = val;
}
function handleSizeChange(val) {
pageSizeBridge.value = val;
const newPageCount = pageCountBridge.value;
if (currentPageBridge.value > newPageCount) {
currentPageBridge.value = newPageCount;
}
}
function prev() {
if (props2.disabled) return;
currentPageBridge.value -= 1;
emit("prev-click", currentPageBridge.value);
}
function next() {
if (props2.disabled) return;
currentPageBridge.value += 1;
emit("next-click", currentPageBridge.value);
}
function addClass2(element, cls) {
if (element) {
if (!element.props) {
element.props = {};
}
element.props.class = [element.props.class, cls].join(" ");
}
}
provide(elPaginationKey, {
pageCount: pageCountBridge,
disabled: computed(() => props2.disabled),
currentPage: currentPageBridge,
changeEvent: handleCurrentChange2,
handleSizeChange
});
return () => {
var _a, _b;
if (!assertValidUsage.value) {
debugWarn(componentName, t("el.pagination.deprecationWarning"));
return null;
}
if (!props2.layout) return null;
if (props2.hideOnSinglePage && pageCountBridge.value <= 1) return null;
const rootChildren = [];
const rightWrapperChildren = [];
const rightWrapperRoot = h(
"div",
{ class: ns.e("rightwrapper") },
rightWrapperChildren
);
const TEMPLATE_MAP = {
prev: h(_sfc_main102, {
disabled: props2.disabled,
currentPage: currentPageBridge.value,
prevText: props2.prevText,
prevIcon: props2.prevIcon,
onClick: prev
}),
jumper: h(_sfc_main105, {
size: _size.value
}),
pager: h(_sfc_main107, {
currentPage: currentPageBridge.value,
pageCount: pageCountBridge.value,
pagerCount: props2.pagerCount,
onChange: handleCurrentChange2,
disabled: props2.disabled
}),
next: h(_sfc_main103, {
disabled: props2.disabled,
currentPage: currentPageBridge.value,
pageCount: pageCountBridge.value,
nextText: props2.nextText,
nextIcon: props2.nextIcon,
onClick: next
}),
sizes: h(_sfc_main104, {
pageSize: pageSizeBridge.value,
pageSizes: props2.pageSizes,
popperClass: props2.popperClass,
popperStyle: props2.popperStyle,
disabled: props2.disabled,
teleported: props2.teleported,
size: _size.value,
appendSizeTo: props2.appendSizeTo
}),
slot: (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : null,
total: h(_sfc_main106, { total: isAbsent(props2.total) ? 0 : props2.total })
};
const components = props2.layout.split(",").map((item) => item.trim());
let haveRightWrapper = false;
components.forEach((c2) => {
if (c2 === "->") {
haveRightWrapper = true;
return;
}
if (!haveRightWrapper) {
rootChildren.push(TEMPLATE_MAP[c2]);
} else {
rightWrapperChildren.push(TEMPLATE_MAP[c2]);
}
});
addClass2(rootChildren[0], ns.is("first"));
addClass2(rootChildren[rootChildren.length - 1], ns.is("last"));
if (haveRightWrapper && rightWrapperChildren.length > 0) {
addClass2(rightWrapperChildren[0], ns.is("first"));
addClass2(
rightWrapperChildren[rightWrapperChildren.length - 1],
ns.is("last")
);
rootChildren.push(rightWrapperRoot);
}
return h(
"div",
{
class: [
ns.b(),
ns.is("background", props2.background),
ns.m(_size.value)
]
},
rootChildren
);
};
}
});
// node_modules/element-plus/es/components/pagination/index.mjs
var ElPagination = withInstall(Pagination);
// node_modules/element-plus/es/components/popconfirm/src/popconfirm.mjs
var popconfirmProps = buildProps({
/**
* @description Title
*/
title: String,
/**
* @description Confirm button text
*/
confirmButtonText: String,
/**
* @description Cancel button text
*/
cancelButtonText: String,
/**
* @description Confirm button type
*/
confirmButtonType: {
type: String,
values: buttonTypes,
default: "primary"
},
/**
* @description Cancel button type
*/
cancelButtonType: {
type: String,
values: buttonTypes,
default: "text"
},
/**
* @description Icon Component
*/
icon: {
type: iconPropType,
default: () => question_filled_default
},
/**
* @description Icon color
*/
iconColor: {
type: String,
default: "#f90"
},
/**
* @description is hide Icon
*/
hideIcon: Boolean,
/**
* @description delay of disappear, in millisecond
*/
hideAfter: {
type: Number,
default: 200
},
/**
* @description Tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
...useTooltipContentProps.effect,
default: "light"
},
/**
* @description whether popconfirm is teleported to the body
*/
teleported: useTooltipContentProps.teleported,
/**
* @description when popconfirm inactive and `persistent` is `false` , popconfirm will be destroyed
*/
persistent: useTooltipContentProps.persistent,
/**
* @description popconfirm width, min width 150px
*/
width: {
type: [String, Number],
default: 150
},
virtualTriggering: useTooltipTriggerProps.virtualTriggering,
virtualRef: useTooltipTriggerProps.virtualRef
});
var popconfirmEmits = {
/**
* @description triggers when click confirm button
*/
confirm: (e) => e instanceof MouseEvent,
/**
* @description triggers when click cancel button
*/
cancel: (e) => e instanceof MouseEvent
};
// node_modules/element-plus/es/components/popconfirm/src/popconfirm.vue2.mjs
var _sfc_main108 = defineComponent({
...{
name: "ElPopconfirm"
},
__name: "popconfirm",
props: popconfirmProps,
emits: popconfirmEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const ns = useNamespace("popconfirm");
const tooltipRef = ref();
const rootRef = ref();
const popperRef = computed(() => {
var _a;
return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef;
});
const showPopper = () => {
var _a, _b;
(_b = (_a = rootRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
};
const hidePopper = () => {
var _a, _b;
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
};
const style = computed(() => {
return {
width: addUnit(props2.width)
};
});
const confirm = (e) => {
emit("confirm", e);
hidePopper();
};
const cancel = (e) => {
emit("cancel", e);
hidePopper();
};
const finalConfirmButtonText = computed(
() => props2.confirmButtonText || t("el.popconfirm.confirmButtonText")
);
const finalCancelButtonText = computed(
() => props2.cancelButtonText || t("el.popconfirm.cancelButtonText")
);
__expose({
popperRef,
hide: hidePopper
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
ref_key: "tooltipRef",
ref: tooltipRef,
trigger: "click",
effect: __props.effect
}, _ctx.$attrs, {
"virtual-triggering": __props.virtualTriggering,
"virtual-ref": __props.virtualRef,
"popper-class": `${unref(ns).namespace.value}-popover`,
"popper-style": style.value,
teleported: __props.teleported,
"fallback-placements": ["bottom", "top", "right", "left"],
"hide-after": __props.hideAfter,
persistent: __props.persistent,
loop: "",
onShow: showPopper
}), {
content: withCtx(() => [
createBaseVNode(
"div",
{
ref_key: "rootRef",
ref: rootRef,
tabindex: "-1",
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("main"))
},
[
!__props.hideIcon && __props.icon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("icon")),
style: normalizeStyle({ color: __props.iconColor })
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "style"])) : createCommentVNode("v-if", true),
createTextVNode(
" " + toDisplayString(__props.title),
1
/* TEXT */
)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("action"))
},
[
renderSlot(_ctx.$slots, "actions", {
confirm,
cancel
}, () => [
createVNode(unref(ElButton), {
size: "small",
type: __props.cancelButtonType === "text" ? "" : __props.cancelButtonType,
text: __props.cancelButtonType === "text",
onClick: cancel
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(finalCancelButtonText.value),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["type", "text"]),
createVNode(unref(ElButton), {
size: "small",
type: __props.confirmButtonType === "text" ? "" : __props.confirmButtonType,
text: __props.confirmButtonType === "text",
onClick: confirm
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(finalConfirmButtonText.value),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["type", "text"])
])
],
2
/* CLASS */
)
],
2
/* CLASS */
)
]),
default: withCtx(() => [
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 16, ["effect", "virtual-triggering", "virtual-ref", "popper-class", "popper-style", "teleported", "hide-after", "persistent"]);
};
}
});
// node_modules/element-plus/es/components/popconfirm/index.mjs
var ElPopconfirm = withInstall(_sfc_main108);
// node_modules/element-plus/es/components/popover/src/popover.mjs
var popoverProps = buildProps({
/**
* @description how the popover is triggered, not valid in controlled mode
*/
trigger: useTooltipTriggerProps.trigger,
/**
* @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of popover through the keyboard, not valid in controlled mode
*/
triggerKeys: useTooltipTriggerProps.triggerKeys,
/**
* @description popover placement
*/
placement: dropdownProps.placement,
/**
* @description whether Popover is disabled
*/
disabled: useTooltipTriggerProps.disabled,
/**
* @description whether popover is visible
*/
visible: useTooltipContentProps.visible,
/**
* @description popover transition animation
*/
transition: useTooltipContentProps.transition,
/**
* @description parameters for [popper.js](https://popper.js.org/docs/v2/)
*/
popperOptions: dropdownProps.popperOptions,
/**
* @description [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of Popover
*/
tabindex: dropdownProps.tabindex,
/**
* @description popover content, can be replaced with a default `slot`
*/
content: useTooltipContentProps.content,
/**
* @description custom style for popover
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description custom class name for popover
*/
popperClass: useTooltipContentProps.popperClass,
enterable: {
...useTooltipContentProps.enterable,
default: true
},
/**
* @description Tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
...useTooltipContentProps.effect,
default: "light"
},
/**
* @description whether popover dropdown is teleported to the body
*/
teleported: useTooltipContentProps.teleported,
/**
* @description which select dropdown appends to
*/
appendTo: useTooltipContentProps.appendTo,
/**
* @description popover title
*/
title: String,
/**
* @description popover width
*/
width: {
type: [String, Number],
default: 150
},
/**
* @description popover offset
*/
offset: {
type: Number,
default: void 0
},
/**
* @description delay of appearance, in millisecond, not valid in controlled mode
*/
showAfter: {
type: Number,
default: 0
},
/**
* @description delay of disappear, in millisecond, not valid in controlled mode
*/
hideAfter: {
type: Number,
default: 200
},
/**
* @description timeout in milliseconds to hide tooltip, not valid in controlled mode
*/
autoClose: {
type: Number,
default: 0
},
/**
* @description whether a tooltip arrow is displayed or not. For more info, please refer to [ElPopper](https://github.com/element-plus/element-plus/tree/dev/packages/components/popper)
*/
showArrow: {
type: Boolean,
default: true
},
/**
* @description when popover inactive and `persistent` is `false` , popover will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
"onUpdate:visible": {
type: Function
}
});
var popoverEmits = {
"update:visible": (value) => isBoolean(value),
"before-enter": () => true,
"before-leave": () => true,
"after-enter": () => true,
"after-leave": () => true
};
var popoverPropsDefaults = {
trigger: "hover",
triggerKeys: () => [
EVENT_CODE.enter,
EVENT_CODE.numpadEnter,
EVENT_CODE.space
],
placement: "bottom",
visible: null,
popperOptions: () => ({}),
tabindex: 0,
content: "",
popperStyle: void 0,
enterable: true,
effect: "light",
teleported: true,
width: 150,
offset: void 0,
showAfter: 0,
hideAfter: 200,
autoClose: 0,
showArrow: true,
persistent: true
};
// node_modules/element-plus/es/components/popover/src/popover.vue2.mjs
var updateEventKeyRaw = `onUpdate:visible`;
var _sfc_main109 = defineComponent({
...{
name: "ElPopover"
},
__name: "popover",
props: popoverProps,
emits: popoverEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const onUpdateVisible = computed(() => {
return props2[updateEventKeyRaw];
});
const ns = useNamespace("popover");
const tooltipRef = ref();
const popperRef = computed(() => {
var _a;
return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef;
});
const style = computed(() => {
return [
{
width: addUnit(props2.width)
},
props2.popperStyle
];
});
const kls = computed(() => {
return [ns.b(), props2.popperClass, { [ns.m("plain")]: !!props2.content }];
});
const gpuAcceleration = computed(() => {
return props2.transition === `${ns.namespace.value}-fade-in-linear`;
});
const hide2 = () => {
var _a;
(_a = tooltipRef.value) == null ? void 0 : _a.hide();
};
const beforeEnter = () => {
emit("before-enter");
};
const beforeLeave = () => {
emit("before-leave");
};
const afterEnter = () => {
emit("after-enter");
};
const afterLeave = () => {
emit("update:visible", false);
emit("after-leave");
};
__expose({
/** @description popper ref */
popperRef,
/** @description hide popover */
hide: hide2
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
ref_key: "tooltipRef",
ref: tooltipRef
}, _ctx.$attrs, {
trigger: __props.trigger,
"trigger-keys": __props.triggerKeys,
placement: __props.placement,
disabled: __props.disabled,
visible: __props.visible,
transition: __props.transition,
"popper-options": __props.popperOptions,
tabindex: __props.tabindex,
content: __props.content,
offset: __props.offset,
"show-after": __props.showAfter,
"hide-after": __props.hideAfter,
"auto-close": __props.autoClose,
"show-arrow": __props.showArrow,
"aria-label": __props.title,
effect: __props.effect,
enterable: __props.enterable,
"popper-class": kls.value,
"popper-style": style.value,
teleported: __props.teleported,
"append-to": __props.appendTo,
persistent: __props.persistent,
"gpu-acceleration": gpuAcceleration.value,
"onUpdate:visible": onUpdateVisible.value,
onBeforeShow: beforeEnter,
onBeforeHide: beforeLeave,
onShow: afterEnter,
onHide: afterLeave
}), {
content: withCtx(() => [
__props.title ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("title")),
role: "title"
},
toDisplayString(__props.title),
3
/* TEXT, CLASS */
)) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.content),
1
/* TEXT */
)
])
]),
default: withCtx(() => [
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 16, ["trigger", "trigger-keys", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "append-to", "persistent", "gpu-acceleration", "onUpdate:visible"]);
};
}
});
// node_modules/element-plus/es/components/popover/src/directive.mjs
var attachEvents = (el, binding) => {
const popperComponent = binding.arg || binding.value;
const popover = popperComponent == null ? void 0 : popperComponent.popperRef;
if (popover) {
popover.triggerRef = el;
}
};
var PopoverDirective = {
mounted(el, binding) {
attachEvents(el, binding);
},
updated(el, binding) {
attachEvents(el, binding);
}
};
var VPopover = "popover";
// node_modules/element-plus/es/components/popover/index.mjs
var ElPopoverDirective = withInstallDirective(PopoverDirective, VPopover);
var ElPopover = withInstall(_sfc_main109, {
directive: ElPopoverDirective
});
// node_modules/element-plus/es/components/progress/src/progress.mjs
var progressProps = buildProps({
/**
* @description type of progress bar
*/
type: {
type: String,
default: "line",
values: ["line", "circle", "dashboard"]
},
/**
* @description percentage, required
*/
percentage: {
type: Number,
default: 0,
validator: (val) => val >= 0 && val <= 100
},
/**
* @description the current status of progress bar
*/
status: {
type: String,
default: "",
values: ["", "success", "exception", "warning"]
},
/**
* @description set indeterminate progress
*/
indeterminate: Boolean,
/**
* @description control the animation duration of indeterminate progress or striped flow progress
*/
duration: {
type: Number,
default: 3
},
/**
* @description the width of progress bar
*/
strokeWidth: {
type: Number,
default: 6
},
/**
* @description butt/circle/dashboard type shape at the end path
*/
strokeLinecap: {
type: definePropType(String),
default: "round"
},
/**
* @description whether to place the percentage inside progress bar, only works when `type` is 'line'
*/
textInside: Boolean,
/**
* @description the canvas width of circle progress bar
*/
width: {
type: Number,
default: 126
},
/**
* @description whether to show percentage
*/
showText: {
type: Boolean,
default: true
},
/**
* @description background color of progress bar. Overrides `status` prop
*/
color: {
type: definePropType([
String,
Array,
Function
]),
default: ""
},
/**
* @description stripe over the progress bar's color
*/
striped: Boolean,
/**
* @description get the stripes to flow
*/
stripedFlow: Boolean,
/**
* @description custom text format
*/
format: {
type: definePropType(Function),
default: (percentage) => `${percentage}%`
}
});
// node_modules/element-plus/es/components/progress/src/progress.vue2.mjs
var _hoisted_158 = ["aria-valuenow"];
var _hoisted_230 = { viewBox: "0 0 100 100" };
var _hoisted_313 = ["d", "stroke", "stroke-linecap", "stroke-width"];
var _hoisted_49 = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"];
var _hoisted_58 = { key: 0 };
var _sfc_main110 = defineComponent({
...{
name: "ElProgress"
},
__name: "progress",
props: progressProps,
setup(__props) {
const STATUS_COLOR_MAP = {
success: "#13ce66",
exception: "#ff4949",
warning: "#e6a23c",
default: "#20a0ff"
};
const props2 = __props;
const ns = useNamespace("progress");
const barStyle = computed(() => {
const barStyle2 = {
width: `${props2.percentage}%`,
animationDuration: `${props2.duration}s`
};
const color = getCurrentColor(props2.percentage);
if (color.includes("gradient")) {
barStyle2.background = color;
} else {
barStyle2.backgroundColor = color;
}
return barStyle2;
});
const relativeStrokeWidth = computed(
() => (props2.strokeWidth / props2.width * 100).toFixed(1)
);
const radius = computed(() => {
if (["circle", "dashboard"].includes(props2.type)) {
return Number.parseInt(
`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`,
10
);
}
return 0;
});
const trackPath = computed(() => {
const r = radius.value;
const isDashboard = props2.type === "dashboard";
return `
M 50 50
m 0 ${isDashboard ? "" : "-"}${r}
a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
`;
});
const perimeter = computed(() => 2 * Math.PI * radius.value);
const rate = computed(() => props2.type === "dashboard" ? 0.75 : 1);
const strokeDashoffset = computed(() => {
const offset3 = -1 * perimeter.value * (1 - rate.value) / 2;
return `${offset3}px`;
});
const trailPathStyle = computed(() => ({
strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
strokeDashoffset: strokeDashoffset.value
}));
const circlePathStyle = computed(() => ({
strokeDasharray: `${perimeter.value * rate.value * (props2.percentage / 100)}px, ${perimeter.value}px`,
strokeDashoffset: strokeDashoffset.value,
transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
}));
const stroke = computed(() => {
let ret;
if (props2.color) {
ret = getCurrentColor(props2.percentage);
} else {
ret = STATUS_COLOR_MAP[props2.status] || STATUS_COLOR_MAP.default;
}
return ret;
});
const statusIcon = computed(() => {
if (props2.status === "warning") {
return warning_filled_default;
}
if (props2.type === "line") {
return props2.status === "success" ? circle_check_default : circle_close_default;
} else {
return props2.status === "success" ? check_default : close_default;
}
});
const progressTextSize = computed(() => {
return props2.type === "line" ? 12 + props2.strokeWidth * 0.4 : props2.width * 0.111111 + 2;
});
const content = computed(() => props2.format(props2.percentage));
function getColors(color) {
const span = 100 / color.length;
const seriesColors = color.map((seriesColor, index) => {
if (isString(seriesColor)) {
return {
color: seriesColor,
percentage: (index + 1) * span
};
}
return seriesColor;
});
return seriesColors.sort((a2, b2) => a2.percentage - b2.percentage);
}
const getCurrentColor = (percentage) => {
var _a;
const { color } = props2;
if (isFunction(color)) {
return color(percentage);
} else if (isString(color)) {
return color;
} else {
const colors = getColors(color);
for (const color2 of colors) {
if (color2.percentage > percentage) return color2.color;
}
return (_a = colors[colors.length - 1]) == null ? void 0 : _a.color;
}
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([
unref(ns).b(),
unref(ns).m(__props.type),
unref(ns).is(__props.status),
{
[unref(ns).m("without-text")]: !__props.showText,
[unref(ns).m("text-inside")]: __props.textInside
}
]),
role: "progressbar",
"aria-valuenow": __props.percentage,
"aria-valuemin": "0",
"aria-valuemax": "100"
}, [
__props.type === "line" ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).b("bar"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).be("bar", "outer")),
style: normalizeStyle({ height: `${__props.strokeWidth}px` })
},
[
createBaseVNode(
"div",
{
class: normalizeClass([
unref(ns).be("bar", "inner"),
{ [unref(ns).bem("bar", "inner", "indeterminate")]: __props.indeterminate },
{ [unref(ns).bem("bar", "inner", "striped")]: __props.striped },
{ [unref(ns).bem("bar", "inner", "striped-flow")]: __props.stripedFlow }
]),
style: normalizeStyle(barStyle.value)
},
[
(__props.showText || _ctx.$slots.default) && __props.textInside ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).be("bar", "innerText"))
},
[
renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [
createBaseVNode(
"span",
null,
toDisplayString(content.value),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)
],
6
/* CLASS, STYLE */
)
],
2
/* CLASS */
)) : (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).b("circle")),
style: normalizeStyle({ height: `${__props.width}px`, width: `${__props.width}px` })
},
[
(openBlock(), createElementBlock("svg", _hoisted_230, [
createBaseVNode("path", {
class: normalizeClass(unref(ns).be("circle", "track")),
d: trackPath.value,
stroke: `var(${unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
"stroke-linecap": __props.strokeLinecap,
"stroke-width": relativeStrokeWidth.value,
fill: "none",
style: normalizeStyle(trailPathStyle.value)
}, null, 14, _hoisted_313),
createBaseVNode("path", {
class: normalizeClass(unref(ns).be("circle", "path")),
d: trackPath.value,
stroke: stroke.value,
fill: "none",
opacity: __props.percentage ? 1 : 0,
"stroke-linecap": __props.strokeLinecap,
"stroke-width": relativeStrokeWidth.value,
style: normalizeStyle(circlePathStyle.value)
}, null, 14, _hoisted_49)
]))
],
6
/* CLASS, STYLE */
)),
(__props.showText || _ctx.$slots.default) && !__props.textInside ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass(unref(ns).e("text")),
style: normalizeStyle({ fontSize: `${progressTextSize.value}px` })
},
[
renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [
!__props.status ? (openBlock(), createElementBlock(
"span",
_hoisted_58,
toDisplayString(content.value),
1
/* TEXT */
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(statusIcon.value)))
]),
_: 1
/* STABLE */
}))
])
],
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true)
], 10, _hoisted_158);
};
}
});
// node_modules/element-plus/es/components/progress/index.mjs
var ElProgress = withInstall(_sfc_main110);
// node_modules/element-plus/es/components/rate/src/rate.mjs
var rateProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: Number,
default: 0
},
/**
* @description native `id` attribute
*/
id: {
type: String,
default: void 0
},
/**
* @description threshold value between low and medium level. The value itself will be included in low level
*/
lowThreshold: {
type: Number,
default: 2
},
/**
* @description threshold value between medium and high level. The value itself will be included in high level
*/
highThreshold: {
type: Number,
default: 4
},
/**
* @description max rating score
*/
max: {
type: Number,
default: 5
},
/**
* @description colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color
*/
colors: {
type: definePropType([Array, Object]),
default: () => mutable(["", "", ""])
},
/**
* @description color of unselected icons
*/
voidColor: {
type: String,
default: ""
},
/**
* @description color of unselected read-only icons
*/
disabledVoidColor: {
type: String,
default: ""
},
/**
* @description icon components. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon component
*/
icons: {
type: definePropType([Array, Object]),
default: () => [star_filled_default, star_filled_default, star_filled_default]
},
/**
* @description component of unselected icons
*/
voidIcon: {
type: iconPropType,
default: () => star_default
},
/**
* @description component of unselected read-only icons
*/
disabledVoidIcon: {
type: iconPropType,
default: () => star_filled_default
},
/**
* @description whether Rate is read-only
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether picking half start is allowed
*/
allowHalf: Boolean,
/**
* @description whether to display texts
*/
showText: Boolean,
/**
* @description whether to display current score. show-score and show-text cannot be true at the same time
*/
showScore: Boolean,
/**
* @description color of texts
*/
textColor: {
type: String,
default: ""
},
/**
* @description text array
*/
texts: {
type: definePropType(Array),
default: () => mutable([
"Extremely bad",
"Disappointed",
"Fair",
"Satisfied",
"Surprise"
])
},
/**
* @description score template
*/
scoreTemplate: {
type: String,
default: "{value}"
},
/**
* @description size of Rate
*/
size: useSizeProp,
/**
* @description whether value can be reset to `0`
*/
clearable: Boolean,
...useAriaProps(["ariaLabel"])
});
var rateEmits = {
[CHANGE_EVENT]: (value) => isNumber(value),
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
};
// node_modules/element-plus/es/components/rate/src/rate.vue2.mjs
var _hoisted_159 = ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax"];
var _hoisted_231 = ["onMousemove", "onClick"];
var _sfc_main111 = defineComponent({
...{
name: "ElRate"
},
__name: "rate",
props: rateProps,
emits: rateEmits,
setup(__props, { expose: __expose, emit: __emit }) {
function getValueFromMap(value, map) {
const isExcludedObject = (val) => isObject(val);
const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
const val = map[key];
const excluded = isExcludedObject(val) ? val.excluded : false;
return excluded ? value < key : value <= key;
}).sort((a2, b2) => a2 - b2);
const matchedValue = map[matchedKeys[0]];
return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
}
const props2 = __props;
const emit = __emit;
const formItemContext = inject(formItemContextKey, void 0);
const rateSize = useFormSize();
const ns = useNamespace("rate");
const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext
});
const currentValue = ref(clamp_default(props2.modelValue, 0, props2.max));
const hoverIndex = ref(-1);
const pointerAtLeftHalf = ref(true);
const iconRefs = ref([]);
const iconClientWidths = computed(
() => iconRefs.value.map((icon) => icon.$el.clientWidth)
);
const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]);
const rateDisabled = useFormDisabled();
const rateStyles = computed(() => {
return ns.cssVarBlock({
"void-color": props2.voidColor,
"disabled-void-color": props2.disabledVoidColor,
"fill-color": activeColor.value
});
});
const text = computed(() => {
let result = "";
if (props2.showScore) {
result = props2.scoreTemplate.replace(
/\{\s*value\s*\}/,
rateDisabled.value ? `${props2.modelValue}` : `${currentValue.value}`
);
} else if (props2.showText) {
result = props2.texts[Math.ceil(currentValue.value) - 1];
}
return result;
});
const valueDecimal = computed(
() => props2.modelValue * 100 - Math.floor(props2.modelValue) * 100
);
const colorMap = computed(
() => isArray(props2.colors) ? {
[props2.lowThreshold]: props2.colors[0],
[props2.highThreshold]: { value: props2.colors[1], excluded: true },
[props2.max]: props2.colors[2]
} : props2.colors
);
const activeColor = computed(() => {
const color = getValueFromMap(currentValue.value, colorMap.value);
return isObject(color) ? "" : color;
});
const decimalStyle = computed(() => {
let width = "";
if (rateDisabled.value) {
width = `${valueDecimal.value}%`;
} else if (props2.allowHalf) {
width = "50%";
}
return {
color: activeColor.value,
width
};
});
const componentMap = computed(() => {
let icons = isArray(props2.icons) ? [...props2.icons] : { ...props2.icons };
icons = markRaw(icons);
return isArray(icons) ? {
[props2.lowThreshold]: icons[0],
[props2.highThreshold]: {
value: icons[1],
excluded: true
},
[props2.max]: icons[2]
} : icons;
});
const decimalIconComponent = computed(
() => getValueFromMap(props2.modelValue, componentMap.value)
);
const voidComponent = computed(
() => rateDisabled.value ? isString(props2.disabledVoidIcon) ? props2.disabledVoidIcon : markRaw(props2.disabledVoidIcon) : isString(props2.voidIcon) ? props2.voidIcon : markRaw(props2.voidIcon)
);
const activeComponent = computed(
() => getValueFromMap(currentValue.value, componentMap.value)
);
function showDecimalIcon(item) {
const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props2.modelValue && item > props2.modelValue;
const showWhenAllowHalf = props2.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
return showWhenDisabled || showWhenAllowHalf;
}
function emitValue(value) {
if (props2.clearable && value === props2.modelValue) {
value = 0;
}
emit(UPDATE_MODEL_EVENT, value);
if (props2.modelValue !== value) {
emit(CHANGE_EVENT, value);
}
}
function selectValue(value) {
if (rateDisabled.value) {
return;
}
if (props2.allowHalf && pointerAtLeftHalf.value) {
emitValue(currentValue.value);
} else {
emitValue(value);
}
}
function handleKey(e) {
if (rateDisabled.value) {
return;
}
const code = getEventCode(e);
const step2 = props2.allowHalf ? 0.5 : 1;
let _currentValue = currentValue.value;
switch (code) {
case EVENT_CODE.up:
case EVENT_CODE.right:
_currentValue += step2;
break;
case EVENT_CODE.left:
case EVENT_CODE.down:
_currentValue -= step2;
break;
}
_currentValue = clamp_default(_currentValue, 0, props2.max);
if (_currentValue === currentValue.value) {
return;
}
e.stopPropagation();
e.preventDefault();
emit(UPDATE_MODEL_EVENT, _currentValue);
emit(CHANGE_EVENT, _currentValue);
return _currentValue;
}
function setCurrentValue(value, event) {
if (rateDisabled.value) {
return;
}
if (props2.allowHalf && event) {
pointerAtLeftHalf.value = event.offsetX * 2 <= iconClientWidths.value[value - 1];
currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
} else {
currentValue.value = value;
}
hoverIndex.value = value;
}
function resetCurrentValue() {
if (rateDisabled.value) {
return;
}
if (props2.allowHalf) {
pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue);
}
currentValue.value = clamp_default(props2.modelValue, 0, props2.max);
hoverIndex.value = -1;
}
watch(
() => props2.modelValue,
(val) => {
currentValue.value = clamp_default(val, 0, props2.max);
pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue);
}
);
if (!props2.modelValue) {
emit(UPDATE_MODEL_EVENT, 0);
}
__expose({
/** @description set current value */
setCurrentValue,
/** @description reset current value */
resetCurrentValue
});
return (_ctx, _cache) => {
var _a;
return openBlock(), createElementBlock("div", {
id: unref(inputId),
class: normalizeClass([rateClasses.value, unref(ns).is("disabled", unref(rateDisabled))]),
role: "slider",
"aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "rating" : void 0,
"aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItemContext)) == null ? void 0 : _a.labelId : void 0,
"aria-valuenow": currentValue.value,
"aria-valuetext": text.value || void 0,
"aria-valuemin": "0",
"aria-valuemax": __props.max,
tabindex: "0",
style: normalizeStyle(rateStyles.value),
onKeydown: handleKey
}, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.max, (item, key) => {
return openBlock(), createElementBlock("span", {
key,
class: normalizeClass(unref(ns).e("item")),
onMousemove: ($event) => setCurrentValue(item, $event),
onMouseleave: resetCurrentValue,
onClick: ($event) => selectValue(item)
}, [
createVNode(unref(ElIcon), {
ref_for: true,
ref_key: "iconRefs",
ref: iconRefs,
class: normalizeClass([
unref(ns).e("icon"),
{ hover: hoverIndex.value === item },
unref(ns).is("active", item <= currentValue.value),
unref(ns).is("focus-visible", item === Math.ceil(currentValue.value || 1))
])
}, {
default: withCtx(() => [
withDirectives((openBlock(), createBlock(
resolveDynamicComponent(activeComponent.value),
null,
null,
512
/* NEED_PATCH */
)), [
[vShow, !showDecimalIcon(item) && item <= currentValue.value]
]),
withDirectives((openBlock(), createBlock(
resolveDynamicComponent(voidComponent.value),
null,
null,
512
/* NEED_PATCH */
)), [
[vShow, !showDecimalIcon(item) && item > currentValue.value]
]),
withDirectives((openBlock(), createBlock(resolveDynamicComponent(voidComponent.value), {
class: normalizeClass([unref(ns).em("decimal", "box")])
}, null, 8, ["class"])), [
[vShow, showDecimalIcon(item)]
]),
withDirectives(createVNode(unref(ElIcon), {
style: normalizeStyle(decimalStyle.value),
class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(decimalIconComponent.value)))
]),
_: 1
/* STABLE */
}, 8, ["style", "class"]), [
[vShow, showDecimalIcon(item)]
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["class"])
], 42, _hoisted_231);
}),
128
/* KEYED_FRAGMENT */
)),
__props.showText || __props.showScore ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(unref(ns).e("text")),
style: normalizeStyle({ color: __props.textColor })
},
toDisplayString(text.value),
7
/* TEXT, CLASS, STYLE */
)) : createCommentVNode("v-if", true)
], 46, _hoisted_159);
};
}
});
// node_modules/element-plus/es/components/rate/index.mjs
var ElRate = withInstall(_sfc_main111);
// node_modules/element-plus/es/components/result/src/result.mjs
var IconMap = {
primary: "icon-primary",
success: "icon-success",
warning: "icon-warning",
error: "icon-error",
info: "icon-info"
};
var IconComponentMap = {
[IconMap.primary]: info_filled_default,
[IconMap.success]: circle_check_filled_default,
[IconMap.warning]: warning_filled_default,
[IconMap.error]: circle_close_filled_default,
[IconMap.info]: info_filled_default
};
var resultProps = buildProps({
/**
* @description title of result
*/
title: {
type: String,
default: ""
},
/**
* @description sub title of result
*/
subTitle: {
type: String,
default: ""
},
/**
* @description icon type of result
*/
icon: {
type: String,
values: ["primary", "success", "warning", "info", "error"],
default: "info"
}
});
// node_modules/element-plus/es/components/result/src/result.vue2.mjs
var _sfc_main112 = defineComponent({
...{
name: "ElResult"
},
__name: "result",
props: resultProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("result");
const resultIcon = computed(() => {
const icon = props2.icon;
const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
return {
class: iconClass,
component: iconComponent
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("icon"))
},
[
renderSlot(_ctx.$slots, "icon", {}, () => [
resultIcon.value.component ? (openBlock(), createBlock(resolveDynamicComponent(resultIcon.value.component), {
key: 0,
class: normalizeClass(resultIcon.value.class)
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
),
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("title"))
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createBaseVNode(
"p",
null,
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
__props.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("subtitle"))
},
[
renderSlot(_ctx.$slots, "sub-title", {}, () => [
createBaseVNode(
"p",
null,
toDisplayString(__props.subTitle),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
_ctx.$slots.extra ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass(unref(ns).e("extra"))
},
[
renderSlot(_ctx.$slots, "extra")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/result/index.mjs
var ElResult = withInstall(_sfc_main112);
// node_modules/element-plus/es/components/row/src/row.mjs
var RowJustify = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
];
var RowAlign = ["top", "middle", "bottom"];
var rowProps = buildProps({
/**
* @description custom element tag
*/
tag: {
type: String,
default: "div"
},
/**
* @description grid spacing
*/
gutter: {
type: Number,
default: 0
},
/**
* @description horizontal alignment of flex layout
*/
justify: {
type: String,
values: RowJustify,
default: "start"
},
/**
* @description vertical alignment of flex layout
*/
align: {
type: String,
values: RowAlign
}
});
// node_modules/element-plus/es/components/row/src/row.vue2.mjs
var _sfc_main113 = defineComponent({
...{
name: "ElRow"
},
__name: "row",
props: rowProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("row");
const gutter = computed(() => props2.gutter);
provide(rowContextKey, {
gutter
});
const style = computed(() => {
const styles = {};
if (!props2.gutter) {
return styles;
}
styles.marginRight = styles.marginLeft = `-${props2.gutter / 2}px`;
return styles;
});
const rowKls = computed(() => [
ns.b(),
ns.is(`justify-${props2.justify}`, props2.justify !== "start"),
ns.is(`align-${props2.align}`, !!props2.align)
]);
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
class: normalizeClass(rowKls.value),
style: normalizeStyle(style.value)
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "style"]);
};
}
});
// node_modules/element-plus/es/components/row/index.mjs
var ElRow = withInstall(_sfc_main113);
// node_modules/element-plus/es/components/select-v2/src/group-item.vue2.mjs
var _sfc_main114 = defineComponent({
props: {
item: {
type: Object,
required: true
},
style: {
type: Object
},
height: Number
},
setup() {
const ns = useNamespace("select");
return {
ns
};
}
});
// node_modules/element-plus/es/components/select-v2/src/group-item.vue.mjs
function _sfc_render15(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(_ctx.ns.be("group", "title")),
style: normalizeStyle({ ..._ctx.style, lineHeight: `${_ctx.height}px` })
},
toDisplayString(_ctx.item.label),
7
/* TEXT, CLASS, STYLE */
);
}
var GroupItem = _export_sfc(_sfc_main114, [["render", _sfc_render15]]);
// node_modules/element-plus/es/components/select-v2/src/useOption.mjs
function useOption2(props2, { emit }) {
return {
hoverItem: () => {
if (!props2.disabled) {
emit("hover", props2.index);
}
},
selectOptionClick: () => {
if (!props2.disabled) {
emit("select", props2.item, props2.index);
}
}
};
}
// node_modules/element-plus/es/components/select-v2/src/defaults.mjs
var selectV2Props = buildProps({
/**
* @description whether creating new items is allowed. To use this, `filterable` must be true
*/
allowCreate: Boolean,
/**
* @description autocomplete of select input
*/
autocomplete: {
type: definePropType(String),
default: "none"
},
/**
* @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused
*/
automaticDropdown: Boolean,
/**
* @description whether select can be cleared
*/
clearable: Boolean,
/**
* @description custom clear icon
*/
clearIcon: {
type: iconPropType,
default: circle_close_default
},
/**
* @description tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description whether to collapse tags to a text when multiple selecting
*/
collapseTags: Boolean,
/**
* @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
*/
collapseTagsTooltip: Boolean,
/**
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
*/
maxCollapseTags: {
type: Number,
default: 1
},
/**
* @description
*/
defaultFirstOption: Boolean,
/**
* @description is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description
*/
estimatedOptionHeight: {
type: Number,
default: void 0
},
/**
* @description whether Select is filterable
*/
filterable: Boolean,
/**
* @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true
*/
filterMethod: {
type: definePropType(Function)
},
/**
* @description The height of the dropdown panel, 34px for each item
*/
height: {
type: Number,
default: 274
// same as select dropdown menu
},
/**
* @description The height of the dropdown item
*/
itemHeight: {
type: Number,
default: 34
},
/**
* @description native input id
*/
id: String,
/**
* @description whether Select is loading data from server
*/
loading: Boolean,
/**
* @description displayed text while loading data from server, default is 'Loading'
*/
loadingText: String,
/**
* @description biding value
*/
modelValue: {
type: definePropType([Array, String, Number, Boolean, Object]),
default: void 0
},
/**
* @description is multiple
*/
multiple: Boolean,
/**
* @description maximum number of options user can select when multiple is true. No limit when set to 0
*/
multipleLimit: {
type: Number,
default: 0
},
/**
* @description the name attribute of select input
*/
name: String,
/**
* @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'
*/
noDataText: String,
/**
* @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'
*/
noMatchText: String,
/**
* @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true
*/
remoteMethod: {
type: definePropType(Function)
},
/**
* @description whether reserve the keyword after select filtered option.
*/
reserveKeyword: {
type: Boolean,
default: true
},
/**
* @description data of the options, the key of `value` and `label` can be customize by `props`
*/
options: {
type: definePropType(Array),
required: true
},
/**
* @description placeholder, the default is 'Please select'
*/
placeholder: {
type: String
},
/**
* @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets
*/
teleported: useTooltipContentProps.teleported,
/**
* @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed
*/
persistent: {
type: Boolean,
default: true
},
/**
* @description custom class name for Select's dropdown
*/
popperClass: useTooltipContentProps.popperClass,
/**
* @description custom style for Select's dropdown
*/
popperStyle: useTooltipContentProps.popperStyle,
/**
* @description [popper.js](https://popper.js.org/docs/v2/) parameters
*/
popperOptions: {
type: definePropType(Object),
default: () => ({})
},
/**
* @description whether search data from server
*/
remote: Boolean,
/**
* @description debounce delay during remote search, in milliseconds
*/
debounce: {
type: Number,
default: 300
},
/**
* @description size of component
*/
size: useSizeProp,
/**
* @description configuration options, see the following table
*/
props: {
type: definePropType(Object),
default: () => defaultProps
},
/**
* @description unique identity key name for value, required when value is an object
*/
valueKey: {
type: String,
default: "value"
},
/**
* @description Controls whether the scrollbar is always displayed
*/
scrollbarAlwaysOn: Boolean,
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description offset of the dropdown
*/
offset: {
type: Number,
default: 12
},
/**
* @description in remote search method show suffix icon
*/
remoteShowSuffix: Boolean,
/**
* @description Determines whether the arrow is displayed
*/
showArrow: {
type: Boolean,
default: true
},
/**
* @description position of dropdown
*/
placement: {
type: definePropType(String),
values: Ee,
default: "bottom-start"
},
/**
* @description list of possible positions for dropdown
*/
fallbackPlacements: {
type: definePropType(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
/**
* @description tag type
*/
tagType: { ...tagProps.type, default: "info" },
/**
* @description tag effect
*/
tagEffect: { ...tagProps.effect, default: "light" },
/**
* @description tabindex for input
*/
tabindex: {
type: [String, Number],
default: 0
},
/**
* @description which element the select dropdown appends to
*/
appendTo: useTooltipContentProps.appendTo,
/**
* @description if it is `true`, the width of the dropdown panel is the same as the input box.
* if it is `false`, the width is automatically calculated based on the value of `label`,
* or it can be set to a number to make it a fixed width
*/
fitInputWidth: {
type: [Boolean, Number],
default: true,
validator(val) {
return isBoolean(val) || isNumber(val);
}
},
suffixIcon: {
type: iconPropType,
default: arrow_down_default
},
...useEmptyValuesProps,
...useAriaProps(["ariaLabel"])
});
var optionV2Props = buildProps({
data: Array,
disabled: Boolean,
hovering: Boolean,
item: {
type: definePropType(Object),
required: true
},
index: Number,
style: Object,
selected: Boolean,
created: Boolean
});
var selectV2Emits = {
[UPDATE_MODEL_EVENT]: (val) => true,
[CHANGE_EVENT]: (val) => true,
"remove-tag": (val) => true,
"visible-change": (visible) => true,
focus: (evt) => evt instanceof FocusEvent,
blur: (evt) => evt instanceof FocusEvent,
clear: () => true
};
var optionV2Emits = {
hover: (index) => isNumber(index),
select: (val, index) => true
};
// node_modules/element-plus/es/components/select-v2/src/token.mjs
var selectV2InjectionKey = /* @__PURE__ */ Symbol(
"ElSelectV2Injection"
);
// node_modules/element-plus/es/components/select-v2/src/option-item.vue2.mjs
var _sfc_main115 = defineComponent({
props: optionV2Props,
emits: optionV2Emits,
setup(props2, { emit }) {
const select = inject(selectV2InjectionKey);
const ns = useNamespace("select");
const { hoverItem, selectOptionClick } = useOption2(props2, { emit });
const { getLabel } = useProps(select.props);
const contentId = select.contentId;
return {
ns,
contentId,
hoverItem,
selectOptionClick,
getLabel
};
}
});
// node_modules/element-plus/es/components/select-v2/src/option-item.vue.mjs
var _hoisted_160 = ["id", "aria-selected", "aria-disabled"];
function _sfc_render16(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("li", {
id: `${_ctx.contentId}-${_ctx.index}`,
role: "option",
"aria-selected": _ctx.selected,
"aria-disabled": _ctx.disabled || void 0,
style: normalizeStyle(_ctx.style),
class: normalizeClass([
_ctx.ns.be("dropdown", "item"),
_ctx.ns.is("selected", _ctx.selected),
_ctx.ns.is("disabled", _ctx.disabled),
_ctx.ns.is("created", _ctx.created),
_ctx.ns.is("hovering", _ctx.hovering)
]),
onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
}, [
renderSlot(_ctx.$slots, "default", {
item: _ctx.item,
index: _ctx.index,
disabled: _ctx.disabled
}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.getLabel(_ctx.item)),
1
/* TEXT */
)
])
], 46, _hoisted_160);
}
var OptionItem = _export_sfc(_sfc_main115, [["render", _sfc_render16]]);
// node_modules/memoize-one/dist/memoize-one.esm.js
var safeIsNaN = Number.isNaN || function ponyfill(value) {
return typeof value === "number" && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual2) {
if (isEqual2 === void 0) {
isEqual2 = areInputsEqual;
}
var cache2 = null;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (cache2 && cache2.lastThis === this && isEqual2(newArgs, cache2.lastArgs)) {
return cache2.lastResult;
}
var lastResult = resultFn.apply(this, newArgs);
cache2 = {
lastResult,
lastArgs: newArgs,
lastThis: this
};
return lastResult;
}
memoized.clear = function clear() {
cache2 = null;
};
return memoized;
}
// node_modules/element-plus/es/components/virtual-list/src/hooks/use-cache.mjs
var useCache = () => {
const vm = getCurrentInstance();
const props2 = vm.proxy.$props;
return computed(() => {
const _getItemStyleCache = (_2, __, ___) => ({});
return props2.perfMode ? memoize_default(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
});
};
// node_modules/element-plus/es/components/virtual-list/src/defaults.mjs
var DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
var ITEM_RENDER_EVT = "itemRendered";
var SCROLL_EVT = "scroll";
var FORWARD = "forward";
var BACKWARD = "backward";
var AUTO_ALIGNMENT = "auto";
var SMART_ALIGNMENT = "smart";
var START_ALIGNMENT = "start";
var CENTERED_ALIGNMENT = "center";
var END_ALIGNMENT = "end";
var HORIZONTAL = "horizontal";
var VERTICAL = "vertical";
var LTR = "ltr";
var RTL = "rtl";
var RTL_OFFSET_NAG = "negative";
var RTL_OFFSET_POS_ASC = "positive-ascending";
var RTL_OFFSET_POS_DESC = "positive-descending";
var ScrollbarSizeKey = {
[HORIZONTAL]: "height",
[VERTICAL]: "width"
};
var ScrollbarDirKey = {
[HORIZONTAL]: "left",
[VERTICAL]: "top"
};
var SCROLLBAR_MIN_SIZE = 20;
// node_modules/element-plus/es/components/virtual-list/src/hooks/use-wheel.mjs
var useWheel = ({ atEndEdge, atStartEdge, layout: layout2 }, onWheelDelta) => {
let frameHandle;
let offset3 = 0;
const hasReachedEdge = (offset22) => {
const edgeReached = offset22 < 0 && atStartEdge.value || offset22 > 0 && atEndEdge.value;
return edgeReached;
};
const onWheel = (e) => {
cAF(frameHandle);
let { deltaX, deltaY } = e;
if (e.shiftKey && deltaY !== 0) {
deltaX = deltaY;
deltaY = 0;
}
const newOffset = layout2.value === HORIZONTAL ? deltaX : deltaY;
if (hasReachedEdge(newOffset)) return;
offset3 += newOffset;
if (!isFirefox() && newOffset !== 0) {
e.preventDefault();
}
frameHandle = rAF(() => {
onWheelDelta(offset3);
offset3 = 0;
});
};
return {
hasReachedEdge,
onWheel
};
};
// node_modules/element-plus/es/components/virtual-list/src/props.mjs
var itemSize = buildProp({
type: definePropType([Number, Function]),
required: true
});
var estimatedItemSize = buildProp({
type: Number
});
var cache = buildProp({
type: Number,
default: 2
});
var direction = buildProp({
type: String,
values: ["ltr", "rtl"],
default: "ltr"
});
var initScrollOffset = buildProp({
type: Number,
default: 0
});
var total = buildProp({
type: Number,
required: true
});
var layout = buildProp({
type: String,
values: ["horizontal", "vertical"],
default: VERTICAL
});
var virtualizedProps = buildProps({
className: {
type: String,
default: ""
},
containerElement: {
type: definePropType([String, Object]),
default: "div"
},
data: {
type: definePropType(Array),
default: () => mutable([])
},
/**
* @description controls the horizontal direction.
*/
direction,
height: {
type: [String, Number],
required: true
},
innerElement: {
type: [String, Object],
default: "div"
},
innerProps: {
type: definePropType(Object),
default: () => ({})
},
style: {
type: definePropType([Object, String, Array])
},
useIsScrolling: Boolean,
width: {
type: [Number, String],
required: false
},
perfMode: {
type: Boolean,
default: true
},
scrollbarAlwaysOn: Boolean
});
var virtualizedListProps = buildProps({
/**
* @description describes how many items should be pre rendered to the head
* and the tail of the window
*/
cache,
estimatedItemSize,
/**
* @description controls the list's orientation
*/
layout,
initScrollOffset,
/**
* @description describes the total number of the list.
*/
total,
itemSize,
...virtualizedProps
});
var scrollbarSize = {
type: Number,
default: 6
};
var startGap = { type: Number, default: 0 };
var endGap = { type: Number, default: 2 };
var virtualizedGridProps = buildProps({
columnCache: cache,
columnWidth: itemSize,
estimatedColumnWidth: estimatedItemSize,
estimatedRowHeight: estimatedItemSize,
initScrollLeft: initScrollOffset,
initScrollTop: initScrollOffset,
itemKey: {
type: definePropType(Function),
default: ({
columnIndex,
rowIndex
}) => `${rowIndex}:${columnIndex}`
},
rowCache: cache,
rowHeight: itemSize,
totalColumn: total,
totalRow: total,
hScrollbarSize: scrollbarSize,
vScrollbarSize: scrollbarSize,
scrollbarStartGap: startGap,
scrollbarEndGap: endGap,
role: String,
...virtualizedProps
});
var virtualizedScrollbarProps = buildProps({
alwaysOn: Boolean,
class: String,
layout,
total,
ratio: {
type: Number,
required: true
},
clientSize: {
type: Number,
required: true
},
scrollFrom: {
type: Number,
required: true
},
scrollbarSize,
startGap,
endGap,
visible: Boolean
});
// node_modules/element-plus/es/components/virtual-list/src/utils.mjs
var getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
var isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
var isRTL = (dir) => dir === RTL;
var cachedRTLResult = null;
function getRTLOffsetType(recalculate = false) {
if (cachedRTLResult === null || recalculate) {
const outerDiv = document.createElement("div");
const outerStyle = outerDiv.style;
outerStyle.width = "50px";
outerStyle.height = "50px";
outerStyle.overflow = "scroll";
outerStyle.direction = "rtl";
const innerDiv = document.createElement("div");
const innerStyle = innerDiv.style;
innerStyle.width = "100px";
innerStyle.height = "100px";
outerDiv.appendChild(innerDiv);
document.body.appendChild(outerDiv);
if (outerDiv.scrollLeft > 0) {
cachedRTLResult = RTL_OFFSET_POS_DESC;
} else {
outerDiv.scrollLeft = 1;
if (outerDiv.scrollLeft === 0) {
cachedRTLResult = RTL_OFFSET_NAG;
} else {
cachedRTLResult = RTL_OFFSET_POS_ASC;
}
}
document.body.removeChild(outerDiv);
return cachedRTLResult;
}
return cachedRTLResult;
}
function renderThumbStyle2({ move, size: size2, bar }, layout2) {
const style = {};
const translate2 = `translate${bar.axis}(${move}px)`;
style[bar.size] = size2;
style.transform = translate2;
if (layout2 === "horizontal") {
style.height = "100%";
} else {
style.width = "100%";
}
return style;
}
// node_modules/element-plus/es/components/virtual-list/src/components/scrollbar.mjs
var ScrollBar = defineComponent({
name: "ElVirtualScrollBar",
props: virtualizedScrollbarProps,
emits: ["scroll", "start-move", "stop-move"],
setup(props2, { emit }) {
const GAP2 = computed(() => props2.startGap + props2.endGap);
const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
const nsScrollbar = useNamespace("scrollbar");
const trackRef = ref();
const thumbRef = ref();
let frameHandle = null;
let onselectstartStore = null;
const state = reactive({
isDragging: false,
traveled: 0
});
const bar = computed(() => BAR_MAP[props2.layout]);
const trackSize = computed(() => props2.clientSize - unref(GAP2));
const trackStyle = computed(() => ({
position: "absolute",
width: `${HORIZONTAL === props2.layout ? trackSize.value : props2.scrollbarSize}px`,
height: `${HORIZONTAL === props2.layout ? props2.scrollbarSize : trackSize.value}px`,
[ScrollbarDirKey[props2.layout]]: "2px",
right: "2px",
bottom: "2px",
borderRadius: "4px"
}));
const thumbSize = computed(() => {
const ratio = props2.ratio;
if (ratio >= 100) {
return Number.POSITIVE_INFINITY;
}
if (ratio >= 50) {
return ratio * trackSize.value / 100;
}
const SCROLLBAR_MAX_SIZE = trackSize.value / 3;
return Math.floor(
Math.min(
Math.max(ratio * trackSize.value / 100, SCROLLBAR_MIN_SIZE),
SCROLLBAR_MAX_SIZE
)
);
});
const thumbStyle = computed(() => {
if (!Number.isFinite(thumbSize.value)) {
return {
display: "none"
};
}
const thumb = `${thumbSize.value}px`;
const style = renderThumbStyle2(
{
bar: bar.value,
size: thumb,
move: state.traveled
},
props2.layout
);
return style;
});
const totalSteps = computed(
() => Math.ceil(props2.clientSize - thumbSize.value - unref(GAP2))
);
const attachEvents2 = () => {
window.addEventListener("mousemove", onMouseMove);
window.addEventListener("mouseup", onMouseUp);
const thumbEl = unref(thumbRef);
if (!thumbEl) return;
onselectstartStore = document.onselectstart;
document.onselectstart = () => false;
thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
thumbEl.addEventListener("touchend", onMouseUp);
};
const detachEvents = () => {
window.removeEventListener("mousemove", onMouseMove);
window.removeEventListener("mouseup", onMouseUp);
document.onselectstart = onselectstartStore;
onselectstartStore = null;
const thumbEl = unref(thumbRef);
if (!thumbEl) return;
thumbEl.removeEventListener("touchmove", onMouseMove);
thumbEl.removeEventListener("touchend", onMouseUp);
};
const onThumbMouseDown = (e) => {
e.stopImmediatePropagation();
if (e.ctrlKey || [1, 2].includes(e.button)) {
return;
}
state.isDragging = true;
state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
emit("start-move");
attachEvents2();
};
const onMouseUp = () => {
state.isDragging = false;
state[bar.value.axis] = 0;
emit("stop-move");
detachEvents();
};
const onMouseMove = (e) => {
const { isDragging: isDragging2 } = state;
if (!isDragging2) return;
if (!thumbRef.value || !trackRef.value) return;
const prevPage = state[bar.value.axis];
if (!prevPage) return;
cAF(frameHandle);
const offset3 = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
const thumbClickPosition = thumbRef.value[bar.value.offset] - prevPage;
const distance = offset3 - thumbClickPosition;
frameHandle = rAF(() => {
state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
emit("scroll", distance, totalSteps.value);
});
};
const clickTrackHandler = (e) => {
const offset3 = Math.abs(
e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]
);
const thumbHalf = thumbRef.value[bar.value.offset] / 2;
const distance = offset3 - thumbHalf;
state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
emit("scroll", distance, totalSteps.value);
};
watch(
() => props2.scrollFrom,
(v2) => {
if (state.isDragging) return;
state.traveled = Math.ceil(v2 * totalSteps.value);
}
);
onBeforeUnmount(() => {
detachEvents();
});
return () => {
return h(
"div",
{
role: "presentation",
ref: trackRef,
class: [
nsVirtualScrollbar.b(),
props2.class,
(props2.alwaysOn || state.isDragging) && "always-on"
],
style: trackStyle.value,
onMousedown: withModifiers(clickTrackHandler, [
"stop",
"prevent"
]),
onTouchstartPrevent: onThumbMouseDown
},
h(
"div",
{
ref: thumbRef,
class: nsScrollbar.e("thumb"),
style: thumbStyle.value,
onMousedown: onThumbMouseDown
},
[]
)
);
};
}
});
// node_modules/element-plus/es/components/virtual-list/src/builders/build-list.mjs
var createList = ({
name,
getOffset: getOffset3,
getItemSize,
getItemOffset,
getEstimatedTotalSize: getEstimatedTotalSize2,
getStartIndexForOffset,
getStopIndexForStartIndex,
initCache,
clearCache,
validateProps
}) => {
return defineComponent({
name: name != null ? name : "ElVirtualList",
props: virtualizedListProps,
emits: [ITEM_RENDER_EVT, SCROLL_EVT],
setup(props2, { emit, expose }) {
validateProps(props2);
const instance = getCurrentInstance();
const ns = useNamespace("vl");
const dynamicSizeCache = ref(initCache(props2, instance));
const getItemStyleCache = useCache();
const windowRef = ref();
const innerRef = ref();
const scrollbarRef = ref();
const states = ref({
isScrolling: false,
scrollDir: "forward",
scrollOffset: isNumber(props2.initScrollOffset) ? props2.initScrollOffset : 0,
updateRequested: false,
isScrollbarDragging: false,
scrollbarAlwaysOn: props2.scrollbarAlwaysOn
});
const itemsToRender = computed(() => {
const { total: total2, cache: cache2 } = props2;
const { isScrolling, scrollDir, scrollOffset } = unref(states);
if (total2 === 0) {
return [0, 0, 0, 0];
}
const startIndex = getStartIndexForOffset(
props2,
scrollOffset,
unref(dynamicSizeCache)
);
const stopIndex = getStopIndexForStartIndex(
props2,
startIndex,
scrollOffset,
unref(dynamicSizeCache)
);
const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache2) : 1;
const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache2) : 1;
return [
Math.max(0, startIndex - cacheBackward),
Math.max(0, Math.min(total2 - 1, stopIndex + cacheForward)),
startIndex,
stopIndex
];
});
const estimatedTotalSize = computed(
() => getEstimatedTotalSize2(props2, unref(dynamicSizeCache))
);
const _isHorizontal = computed(() => isHorizontal(props2.layout));
const windowStyle = computed(() => [
{
position: "relative",
[`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
WebkitOverflowScrolling: "touch",
willChange: "transform"
},
{
direction: props2.direction,
height: isNumber(props2.height) ? `${props2.height}px` : props2.height,
width: isNumber(props2.width) ? `${props2.width}px` : props2.width
},
props2.style
]);
const innerStyle = computed(() => {
const size2 = unref(estimatedTotalSize);
const horizontal = unref(_isHorizontal);
return {
height: horizontal ? "100%" : `${size2}px`,
pointerEvents: unref(states).isScrolling ? "none" : void 0,
width: horizontal ? `${size2}px` : "100%",
// fix scrolling issues in Firefox.
margin: 0,
boxSizing: "border-box"
};
});
const clientSize = computed(
() => _isHorizontal.value ? props2.width : props2.height
);
const { onWheel } = useWheel(
{
atStartEdge: computed(() => states.value.scrollOffset <= 0),
atEndEdge: computed(
() => states.value.scrollOffset >= estimatedTotalSize.value
),
layout: computed(() => props2.layout)
},
(offset3) => {
var _a, _b;
(_b = (_a = scrollbarRef.value).onMouseUp) == null ? void 0 : _b.call(_a);
scrollTo2(
Math.min(
states.value.scrollOffset + offset3,
estimatedTotalSize.value - clientSize.value
)
);
}
);
useEventListener(windowRef, "wheel", onWheel, {
passive: false
});
const emitEvents = () => {
const { total: total2 } = props2;
if (total2 > 0) {
const [cacheStart, cacheEnd, visibleStart, visibleEnd] = unref(itemsToRender);
emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
}
const { scrollDir, scrollOffset, updateRequested } = unref(states);
emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
};
const scrollVertically = (e) => {
const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
const _states = unref(states);
if (_states.scrollOffset === scrollTop) {
return;
}
const scrollOffset = Math.max(
0,
Math.min(scrollTop, scrollHeight - clientHeight)
);
states.value = {
..._states,
isScrolling: true,
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
scrollOffset,
updateRequested: false
};
nextTick(resetIsScrolling);
};
const scrollHorizontally = (e) => {
const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
const _states = unref(states);
if (_states.scrollOffset === scrollLeft) {
return;
}
const { direction: direction2 } = props2;
let scrollOffset = scrollLeft;
if (direction2 === RTL) {
switch (getRTLOffsetType()) {
case RTL_OFFSET_NAG: {
scrollOffset = -scrollLeft;
break;
}
case RTL_OFFSET_POS_DESC: {
scrollOffset = scrollWidth - clientWidth - scrollLeft;
break;
}
}
}
scrollOffset = Math.max(
0,
Math.min(scrollOffset, scrollWidth - clientWidth)
);
states.value = {
..._states,
isScrolling: true,
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
scrollOffset,
updateRequested: false
};
nextTick(resetIsScrolling);
};
const onScroll = (e) => {
unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
emitEvents();
};
const onScrollbarScroll = (distanceToGo, totalSteps) => {
const offset3 = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
scrollTo2(
Math.min(
estimatedTotalSize.value - clientSize.value,
offset3
)
);
};
const scrollTo2 = (offset3) => {
offset3 = Math.max(offset3, 0);
if (offset3 === unref(states).scrollOffset) {
return;
}
states.value = {
...unref(states),
scrollOffset: offset3,
scrollDir: getScrollDir(unref(states).scrollOffset, offset3),
updateRequested: true
};
nextTick(resetIsScrolling);
};
const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
const { scrollOffset } = unref(states);
idx = Math.max(0, Math.min(idx, props2.total - 1));
scrollTo2(
getOffset3(
props2,
idx,
alignment,
scrollOffset,
unref(dynamicSizeCache)
)
);
};
const getItemStyle = (idx) => {
const { direction: direction2, itemSize: itemSize3, layout: layout2 } = props2;
const itemStyleCache = getItemStyleCache.value(
clearCache && itemSize3,
clearCache && layout2,
clearCache && direction2
);
let style;
if (hasOwn(itemStyleCache, String(idx))) {
style = itemStyleCache[idx];
} else {
const offset3 = getItemOffset(props2, idx, unref(dynamicSizeCache));
const size2 = getItemSize(props2, idx, unref(dynamicSizeCache));
const horizontal = unref(_isHorizontal);
const isRtl = direction2 === RTL;
const offsetHorizontal = horizontal ? offset3 : 0;
itemStyleCache[idx] = style = {
position: "absolute",
left: isRtl ? void 0 : `${offsetHorizontal}px`,
right: isRtl ? `${offsetHorizontal}px` : void 0,
top: !horizontal ? `${offset3}px` : 0,
height: !horizontal ? `${size2}px` : "100%",
width: horizontal ? `${size2}px` : "100%"
};
}
return style;
};
const resetIsScrolling = () => {
states.value.isScrolling = false;
nextTick(() => {
getItemStyleCache.value(-1, null, null);
});
};
const resetScrollTop = () => {
const window2 = windowRef.value;
if (window2) {
window2.scrollTop = 0;
}
};
onMounted(() => {
if (!isClient) return;
const { initScrollOffset: initScrollOffset2 } = props2;
const windowElement = unref(windowRef);
if (isNumber(initScrollOffset2) && windowElement) {
if (unref(_isHorizontal)) {
windowElement.scrollLeft = initScrollOffset2;
} else {
windowElement.scrollTop = initScrollOffset2;
}
}
emitEvents();
});
onUpdated(() => {
const { direction: direction2, layout: layout2 } = props2;
const { scrollOffset, updateRequested } = unref(states);
const windowElement = unref(windowRef);
if (updateRequested && windowElement) {
if (layout2 === HORIZONTAL) {
if (direction2 === RTL) {
switch (getRTLOffsetType()) {
case RTL_OFFSET_NAG: {
windowElement.scrollLeft = -scrollOffset;
break;
}
case RTL_OFFSET_POS_ASC: {
windowElement.scrollLeft = scrollOffset;
break;
}
default: {
const { clientWidth, scrollWidth } = windowElement;
windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
break;
}
}
} else {
windowElement.scrollLeft = scrollOffset;
}
} else {
windowElement.scrollTop = scrollOffset;
}
}
});
onActivated(() => {
unref(windowRef).scrollTop = unref(states).scrollOffset;
});
const api = {
ns,
clientSize,
estimatedTotalSize,
windowStyle,
windowRef,
innerRef,
innerStyle,
itemsToRender,
scrollbarRef,
states,
getItemStyle,
onScroll,
onScrollbarScroll,
onWheel,
scrollTo: scrollTo2,
scrollToItem,
resetScrollTop
};
expose({
windowRef,
innerRef,
getItemStyleCache,
scrollTo: scrollTo2,
scrollToItem,
resetScrollTop,
states
});
return api;
},
render(ctx) {
var _a;
const {
$slots,
className,
clientSize,
containerElement,
data,
getItemStyle,
innerElement,
itemsToRender,
innerStyle,
layout: layout2,
total: total2,
onScroll,
onScrollbarScroll,
states,
useIsScrolling,
windowStyle,
ns
} = ctx;
const [start, end] = itemsToRender;
const Container = resolveDynamicComponent(containerElement);
const Inner = resolveDynamicComponent(innerElement);
const children = [];
if (total2 > 0) {
for (let i = start; i <= end; i++) {
children.push(
h(
Fragment,
{ key: i },
(_a = $slots.default) == null ? void 0 : _a.call($slots, {
data,
index: i,
isScrolling: useIsScrolling ? states.isScrolling : void 0,
style: getItemStyle(i)
})
)
);
}
}
const InnerNode = [
h(
Inner,
mergeProps(ctx.innerProps, {
style: innerStyle,
ref: "innerRef"
}),
!isString(Inner) ? {
default: () => children
} : children
)
];
const scrollbar = h(ScrollBar, {
ref: "scrollbarRef",
clientSize,
layout: layout2,
onScroll: onScrollbarScroll,
ratio: clientSize * 100 / this.estimatedTotalSize,
scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
total: total2,
alwaysOn: states.scrollbarAlwaysOn
});
const listContainer = h(
Container,
{
class: [ns.e("window"), className],
style: windowStyle,
onScroll,
ref: "windowRef",
key: 0
},
!isString(Container) ? { default: () => [InnerNode] } : [InnerNode]
);
return h(
"div",
{
key: 0,
class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
},
[listContainer, scrollbar]
);
}
});
};
// node_modules/element-plus/es/components/virtual-list/src/components/fixed-size-list.mjs
var FixedSizeList = createList({
name: "ElFixedSizeList",
getItemOffset: ({ itemSize: itemSize3 }, index) => index * itemSize3,
getItemSize: ({ itemSize: itemSize3 }) => itemSize3,
getEstimatedTotalSize: ({ total: total2, itemSize: itemSize3 }) => itemSize3 * total2,
getOffset: ({ height, total: total2, itemSize: itemSize3, layout: layout2, width }, index, alignment, scrollOffset) => {
const size2 = isHorizontal(layout2) ? width : height;
if (isString(size2)) {
throwError(
"[ElVirtualList]",
`
You should set
width/height
to number when your layout is
horizontal/vertical
`
);
}
const lastItemOffset = Math.max(0, total2 * itemSize3 - size2);
const maxOffset = Math.min(lastItemOffset, index * itemSize3);
const minOffset = Math.max(0, (index + 1) * itemSize3 - size2);
if (alignment === SMART_ALIGNMENT) {
if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
alignment = AUTO_ALIGNMENT;
} else {
alignment = CENTERED_ALIGNMENT;
}
}
switch (alignment) {
case START_ALIGNMENT: {
return maxOffset;
}
case END_ALIGNMENT: {
return minOffset;
}
case CENTERED_ALIGNMENT: {
const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
if (middleOffset < Math.ceil(size2 / 2)) {
return 0;
} else if (middleOffset > lastItemOffset + Math.floor(size2 / 2)) {
return lastItemOffset;
} else {
return middleOffset;
}
}
case AUTO_ALIGNMENT:
default: {
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
return scrollOffset;
} else if (scrollOffset < minOffset) {
return minOffset;
} else {
return maxOffset;
}
}
}
},
getStartIndexForOffset: ({ total: total2, itemSize: itemSize3 }, offset3) => Math.max(0, Math.min(total2 - 1, Math.floor(offset3 / itemSize3))),
getStopIndexForStartIndex: ({ height, total: total2, itemSize: itemSize3, layout: layout2, width }, startIndex, scrollOffset) => {
const offset3 = startIndex * itemSize3;
const size2 = isHorizontal(layout2) ? width : height;
const numVisibleItems = Math.ceil(
(size2 + scrollOffset - offset3) / itemSize3
);
return Math.max(
0,
Math.min(
total2 - 1,
// because startIndex is inclusive, so in order to prevent array outbound indexing
// we need to - 1 to prevent outbound behavior
startIndex + numVisibleItems - 1
)
);
},
/**
* Fixed size list does not need this cache
* Using any to bypass it, TODO: Using type inference to fix this.
*/
initCache() {
return void 0;
},
clearCache: true,
validateProps() {
}
});
// node_modules/element-plus/es/components/virtual-list/src/components/dynamic-size-list.mjs
var SCOPE7 = "ElDynamicSizeList";
var getItemFromCache = (props2, index, listCache) => {
const { itemSize: itemSize3 } = props2;
const { items, lastVisitedIndex } = listCache;
if (index > lastVisitedIndex) {
let offset3 = 0;
if (lastVisitedIndex >= 0) {
const item = items[lastVisitedIndex];
offset3 = item.offset + item.size;
}
for (let i = lastVisitedIndex + 1; i <= index; i++) {
const size2 = itemSize3(i);
items[i] = {
offset: offset3,
size: size2
};
offset3 += size2;
}
listCache.lastVisitedIndex = index;
}
return items[index];
};
var findItem = (props2, listCache, offset3) => {
const { items, lastVisitedIndex } = listCache;
const lastVisitedOffset = lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0;
if (lastVisitedOffset >= offset3) {
return bs(props2, listCache, 0, lastVisitedIndex, offset3);
}
return es(props2, listCache, Math.max(0, lastVisitedIndex), offset3);
};
var bs = (props2, listCache, low, high, offset3) => {
while (low <= high) {
const mid = low + Math.floor((high - low) / 2);
const currentOffset = getItemFromCache(props2, mid, listCache).offset;
if (currentOffset === offset3) {
return mid;
} else if (currentOffset < offset3) {
low = mid + 1;
} else if (currentOffset > offset3) {
high = mid - 1;
}
}
return Math.max(0, low - 1);
};
var es = (props2, listCache, index, offset3) => {
const { total: total2 } = props2;
let exponent = 1;
while (index < total2 && getItemFromCache(props2, index, listCache).offset < offset3) {
index += exponent;
exponent *= 2;
}
return bs(
props2,
listCache,
Math.floor(index / 2),
Math.min(index, total2 - 1),
offset3
);
};
var getEstimatedTotalSize = ({ total: total2 }, { items, estimatedItemSize: estimatedItemSize2, lastVisitedIndex }) => {
let totalSizeOfMeasuredItems = 0;
if (lastVisitedIndex >= total2) {
lastVisitedIndex = total2 - 1;
}
if (lastVisitedIndex >= 0) {
const item = items[lastVisitedIndex];
totalSizeOfMeasuredItems = item.offset + item.size;
}
const numUnmeasuredItems = total2 - lastVisitedIndex - 1;
const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize2;
return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
};
var DynamicSizeList = createList({
name: "ElDynamicSizeList",
getItemOffset: (props2, index, listCache) => getItemFromCache(props2, index, listCache).offset,
getItemSize: (_2, index, { items }) => items[index].size,
getEstimatedTotalSize,
getOffset: (props2, index, alignment, scrollOffset, listCache) => {
const { height, layout: layout2, width } = props2;
const size2 = isHorizontal(layout2) ? width : height;
const item = getItemFromCache(props2, index, listCache);
const estimatedTotalSize = getEstimatedTotalSize(props2, listCache);
const maxOffset = Math.max(
0,
Math.min(estimatedTotalSize - size2, item.offset)
);
const minOffset = Math.max(0, item.offset - size2 + item.size);
if (alignment === SMART_ALIGNMENT) {
if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
alignment = AUTO_ALIGNMENT;
} else {
alignment = CENTERED_ALIGNMENT;
}
}
switch (alignment) {
case START_ALIGNMENT: {
return maxOffset;
}
case END_ALIGNMENT: {
return minOffset;
}
case CENTERED_ALIGNMENT: {
return Math.round(minOffset + (maxOffset - minOffset) / 2);
}
case AUTO_ALIGNMENT:
default: {
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
return scrollOffset;
} else if (scrollOffset < minOffset) {
return minOffset;
} else {
return maxOffset;
}
}
}
},
getStartIndexForOffset: (props2, offset3, listCache) => findItem(props2, listCache, offset3),
getStopIndexForStartIndex: (props2, startIndex, scrollOffset, listCache) => {
const { height, total: total2, layout: layout2, width } = props2;
const size2 = isHorizontal(layout2) ? width : height;
const item = getItemFromCache(props2, startIndex, listCache);
const maxOffset = scrollOffset + size2;
let offset3 = item.offset + item.size;
let stopIndex = startIndex;
while (stopIndex < total2 - 1 && offset3 < maxOffset) {
stopIndex++;
offset3 += getItemFromCache(props2, stopIndex, listCache).size;
}
return stopIndex;
},
initCache({ estimatedItemSize: estimatedItemSize2 = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
const cache2 = {
items: {},
estimatedItemSize: estimatedItemSize2,
lastVisitedIndex: -1
};
cache2.clearCacheAfterIndex = (index, forceUpdate = true) => {
var _a, _b;
cache2.lastVisitedIndex = Math.min(cache2.lastVisitedIndex, index - 1);
(_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache(-1);
if (forceUpdate) {
(_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
}
};
return cache2;
},
clearCache: false,
validateProps: ({ itemSize: itemSize3 }) => {
if (true) {
if (typeof itemSize3 !== "function") {
throwError(
SCOPE7,
`
itemSize is required as function, but the given value was ${typeof itemSize3}
`
);
}
}
}
});
// node_modules/element-plus/es/components/select-v2/src/select-dropdown.mjs
var props = {
loading: Boolean,
data: {
type: Array,
required: true
},
hoveringIndex: Number,
width: Number,
id: String,
ariaLabel: String
};
var ElSelectMenu2 = defineComponent({
name: "ElSelectDropdown",
props,
setup(props2, {
slots,
expose
}) {
const select = inject(selectV2InjectionKey);
const ns = useNamespace("select");
const {
getLabel,
getValue,
getDisabled
} = useProps(select.props);
const cachedHeights = ref([]);
const listRef = ref();
const size2 = computed(() => props2.data.length);
watch(() => size2.value, () => {
var _a, _b;
(_b = (_a = select.tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
});
const isSized = computed(() => isUndefined(select.props.estimatedOptionHeight));
const listProps = computed(() => {
if (isSized.value) {
return {
itemSize: select.props.itemHeight
};
}
return {
estimatedSize: select.props.estimatedOptionHeight,
itemSize: (idx) => cachedHeights.value[idx]
};
});
const contains = (arr = [], target2) => {
const {
props: {
valueKey
}
} = select;
if (!isObject(target2)) {
return arr.includes(target2);
}
return arr && arr.some((item) => {
return toRaw(get_default(item, valueKey)) === get_default(target2, valueKey);
});
};
const isEqual2 = (selected, target2) => {
if (!isObject(target2)) {
return selected === target2;
} else {
const {
valueKey
} = select.props;
return get_default(selected, valueKey) === get_default(target2, valueKey);
}
};
const isItemSelected = (modelValue, target2) => {
if (select.props.multiple) {
return contains(modelValue, getValue(target2));
}
return isEqual2(modelValue, getValue(target2));
};
const isItemDisabled = (modelValue, selected) => {
const {
disabled,
multiple,
multipleLimit
} = select.props;
return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
};
const isItemHovering = (target2) => props2.hoveringIndex === target2;
const scrollToItem = (index) => {
const list = listRef.value;
if (list) {
list.scrollToItem(index);
}
};
const resetScrollTop = () => {
const list = listRef.value;
if (list) {
list.resetScrollTop();
}
};
const exposed = {
listRef,
isSized,
isItemDisabled,
isItemHovering,
isItemSelected,
scrollToItem,
resetScrollTop
};
expose(exposed);
const Item = (itemProps) => {
const {
index,
data,
style
} = itemProps;
const sized = unref(isSized);
const {
itemSize: itemSize3,
estimatedSize
} = unref(listProps);
const {
modelValue
} = select.props;
const {
onSelect,
onHover
} = select;
const item = data[index];
if (item.type === "Group") {
return createVNode(GroupItem, {
"item": item,
"style": style,
"height": sized ? itemSize3 : estimatedSize
}, null);
}
const isSelected = isItemSelected(modelValue, item);
const isDisabled = isItemDisabled(modelValue, isSelected);
const isHovering = isItemHovering(index);
return createVNode(OptionItem, mergeProps(itemProps, {
"selected": isSelected,
"disabled": getDisabled(item) || isDisabled,
"created": !!item.created,
"hovering": isHovering,
"item": item,
"onSelect": onSelect,
"onHover": onHover
}), {
default: (props3) => {
var _a;
return ((_a = slots.default) == null ? void 0 : _a.call(slots, props3)) || createVNode("span", null, [getLabel(item)]);
}
});
};
const {
onKeyboardNavigate,
onKeyboardSelect
} = select;
const onForward = () => {
onKeyboardNavigate("forward");
};
const onBackward = () => {
onKeyboardNavigate("backward");
};
const onKeydown = (e) => {
const code = getEventCode(e);
const {
tab,
esc,
down,
up,
enter,
numpadEnter
} = EVENT_CODE;
if ([esc, down, up, enter, numpadEnter].includes(code)) {
e.preventDefault();
e.stopPropagation();
}
switch (code) {
case tab:
case esc:
break;
case down:
onForward();
break;
case up:
onBackward();
break;
case enter:
case numpadEnter:
onKeyboardSelect();
break;
}
};
return () => {
var _a, _b, _c, _d;
const {
data,
width
} = props2;
const {
height,
multiple,
scrollbarAlwaysOn
} = select.props;
const isScrollbarAlwaysOn = computed(() => {
return isIOS ? true : scrollbarAlwaysOn;
});
const List = unref(isSized) ? FixedSizeList : DynamicSizeList;
return createVNode("div", {
"class": [ns.b("dropdown"), ns.is("multiple", multiple)],
"style": {
width: `${width}px`
}
}, [(_a = slots.header) == null ? void 0 : _a.call(slots), ((_b = slots.loading) == null ? void 0 : _b.call(slots)) || ((_c = slots.empty) == null ? void 0 : _c.call(slots)) || createVNode(List, mergeProps({
"ref": listRef
}, unref(listProps), {
"className": ns.be("dropdown", "list"),
"scrollbarAlwaysOn": isScrollbarAlwaysOn.value,
"data": data,
"height": height,
"width": width,
"total": data.length,
"innerElement": "ul",
"innerProps": {
id: props2.id,
role: "listbox",
"aria-label": props2.ariaLabel,
"aria-orientation": "vertical"
},
"onKeydown": onKeydown
}), {
default: (props3) => createVNode(Item, props3, null)
}), (_d = slots.footer) == null ? void 0 : _d.call(slots)]);
};
}
});
// node_modules/element-plus/es/components/select-v2/src/useAllowCreate.mjs
function useAllowCreate(props2, states) {
const { aliasProps, getLabel, getValue } = useProps(props2);
const createOptionCount = ref(0);
const cachedSelectedOption = ref();
const enableAllowCreateMode = computed(() => {
return props2.allowCreate && props2.filterable;
});
watch(
() => props2.options,
(options) => {
const optionLabelsSet = new Set(options.map((option) => getLabel(option)));
states.createdOptions = states.createdOptions.filter(
(createdOption) => !optionLabelsSet.has(getLabel(createdOption))
);
}
);
function hasExistingOption(query) {
const hasOption = (option) => getLabel(option) === query;
return props2.options && props2.options.some(hasOption) || states.createdOptions.some(hasOption);
}
function selectNewOption(option) {
if (!enableAllowCreateMode.value) {
return;
}
if (props2.multiple && option.created) {
createOptionCount.value++;
} else {
cachedSelectedOption.value = option;
}
}
function createNewOption(query) {
if (enableAllowCreateMode.value) {
if (query && query.length > 0) {
if (hasExistingOption(query)) {
states.createdOptions = states.createdOptions.filter(
(createdOption) => getLabel(createdOption) !== states.previousQuery
);
return;
}
const newOption = {
[aliasProps.value.value]: query,
[aliasProps.value.label]: query,
created: true,
[aliasProps.value.disabled]: false
};
if (states.createdOptions.length >= createOptionCount.value) {
states.createdOptions[createOptionCount.value] = newOption;
} else {
states.createdOptions.push(newOption);
}
} else {
if (props2.multiple) {
states.createdOptions.length = createOptionCount.value;
} else {
const selectedOption = cachedSelectedOption.value;
states.createdOptions.length = 0;
if (selectedOption && selectedOption.created) {
states.createdOptions.push(selectedOption);
}
}
}
}
}
function removeNewOption(option) {
if (!enableAllowCreateMode.value || !option || !option.created || option.created && props2.reserveKeyword && states.inputValue === getLabel(option)) {
return;
}
const idx = states.createdOptions.findIndex(
(it2) => getValue(it2) === getValue(option)
);
if (~idx) {
states.createdOptions.splice(idx, 1);
createOptionCount.value--;
}
}
function clearAllNewOption() {
if (enableAllowCreateMode.value) {
states.createdOptions.length = 0;
createOptionCount.value = 0;
}
}
return {
createNewOption,
removeNewOption,
selectNewOption,
clearAllNewOption
};
}
// node_modules/element-plus/es/components/select-v2/src/useSelect.mjs
var useSelect2 = (props2, emit) => {
const { t } = useLocale();
const slots = useSlots();
const nsSelect = useNamespace("select");
const nsInput = useNamespace("input");
const { form: elForm, formItem: elFormItem } = useFormItem();
const { inputId } = useFormItemInputId(props2, {
formItemContext: elFormItem
});
const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props2);
const { valueOnClear, isEmptyValue } = useEmptyValues(props2);
const states = reactive({
inputValue: "",
cachedOptions: [],
createdOptions: [],
hoveringIndex: -1,
inputHovering: false,
selectionWidth: 0,
collapseItemWidth: 0,
previousQuery: null,
previousValue: void 0,
selectedLabel: "",
menuVisibleOnFocus: false,
isBeforeHide: false
});
const popperSize = ref(-1);
const debouncing = ref(false);
const selectRef = ref();
const selectionRef = ref();
const tooltipRef = ref();
const tagTooltipRef = ref();
const inputRef = ref();
const prefixRef = ref();
const suffixRef = ref();
const menuRef = ref();
const tagMenuRef = ref();
const collapseItemRef = ref();
const {
isComposing,
handleCompositionStart,
handleCompositionEnd,
handleCompositionUpdate
} = useComposition({
afterComposition: (e) => onInput(e)
});
const selectDisabled = useFormDisabled();
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
disabled: selectDisabled,
afterFocus() {
if (props2.automaticDropdown && !expanded.value) {
expanded.value = true;
states.menuVisibleOnFocus = true;
}
},
beforeBlur(event) {
var _a, _b;
return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
},
afterBlur() {
var _a;
expanded.value = false;
states.menuVisibleOnFocus = false;
if (props2.validateEvent) {
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "blur").catch((err) => debugWarn(err));
}
}
});
const allOptions = computed(() => filterOptions(""));
const hasOptions = computed(() => {
if (props2.loading) return false;
return props2.options.length > 0 || states.createdOptions.length > 0;
});
const filteredOptions = ref([]);
const expanded = ref(false);
const needStatusIcon = computed(() => {
var _a;
return (_a = elForm == null ? void 0 : elForm.statusIcon) != null ? _a : false;
});
const popupHeight = computed(() => {
const totalHeight = filteredOptions.value.length * props2.itemHeight;
return totalHeight > props2.height ? props2.height : totalHeight;
});
const hasModelValue = computed(() => {
return props2.multiple ? isArray(props2.modelValue) && props2.modelValue.length > 0 : !isEmptyValue(props2.modelValue);
});
const showClearBtn = computed(() => {
return props2.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
});
const iconComponent = computed(
() => props2.remote && props2.filterable && !props2.remoteShowSuffix ? "" : props2.suffixIcon
);
const iconReverse = computed(
() => iconComponent.value && nsSelect.is("reverse", expanded.value)
);
const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
const validateIcon = computed(() => {
if (!validateState.value) return;
return ValidateComponentsMap[validateState.value];
});
const debounce = computed(() => props2.remote ? props2.debounce : 0);
const isRemoteSearchEmpty = computed(
() => props2.remote && !states.inputValue && !hasOptions.value
);
const emptyText = computed(() => {
if (props2.loading) {
return props2.loadingText || t("el.select.loading");
} else {
if (props2.filterable && states.inputValue && hasOptions.value && filteredOptions.value.length === 0) {
return props2.noMatchText || t("el.select.noMatch");
}
if (!hasOptions.value) {
return props2.noDataText || t("el.select.noData");
}
}
return null;
});
const isFilterMethodValid = computed(
() => props2.filterable && isFunction(props2.filterMethod)
);
const isRemoteMethodValid = computed(
() => props2.filterable && props2.remote && isFunction(props2.remoteMethod)
);
const filterOptions = (query) => {
const regexp = new RegExp(escapeStringRegexp(query), "i");
const isValidOption = (o2) => {
if (isFilterMethodValid.value || isRemoteMethodValid.value) return true;
return query ? regexp.test(getLabel(o2) || "") : true;
};
if (props2.loading) {
return [];
}
return [...states.createdOptions, ...props2.options].reduce((all, item) => {
const options = getOptions(item);
if (isArray(options)) {
const filtered = options.filter(isValidOption);
if (filtered.length > 0) {
all.push(
{
label: getLabel(item),
type: "Group"
},
...filtered
);
}
} else if (props2.remote || isValidOption(item)) {
all.push(item);
}
return all;
}, []);
};
const updateOptions2 = () => {
filteredOptions.value = filterOptions(states.inputValue);
};
const allOptionsValueMap = computed(() => {
const valueMap = /* @__PURE__ */ new Map();
allOptions.value.forEach((option, index) => {
valueMap.set(getValueKey(getValue(option)), { option, index });
});
return valueMap;
});
const filteredOptionsValueMap = computed(() => {
const valueMap = /* @__PURE__ */ new Map();
filteredOptions.value.forEach((option, index) => {
valueMap.set(getValueKey(getValue(option)), { option, index });
});
return valueMap;
});
const optionsAllDisabled = computed(
() => filteredOptions.value.every((option) => getDisabled(option))
);
const selectSize = useFormSize();
const collapseTagSize = computed(
() => "small" === selectSize.value ? "small" : "default"
);
const calculatePopperSize = () => {
var _a;
if (isNumber(props2.fitInputWidth)) {
popperSize.value = props2.fitInputWidth;
return;
}
const width = ((_a = selectRef.value) == null ? void 0 : _a.offsetWidth) || 200;
if (!props2.fitInputWidth && hasOptions.value) {
nextTick(() => {
popperSize.value = Math.max(width, calculateLabelMaxWidth());
});
} else {
popperSize.value = width;
}
};
const calculateLabelMaxWidth = () => {
var _a, _b;
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const selector = nsSelect.be("dropdown", "item");
const dom = ((_b = (_a = menuRef.value) == null ? void 0 : _a.listRef) == null ? void 0 : _b.innerRef) || document;
const dropdownItemEl = dom.querySelector(`.${selector}`);
if (dropdownItemEl === null || ctx === null) return 0;
const style = getComputedStyle(dropdownItemEl);
const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
ctx.font = `bold ${style.font.replace(
new RegExp(`\\b${style.fontWeight}\\b`),
""
)}`;
const maxWidth = filteredOptions.value.reduce((max3, option) => {
const metrics = ctx.measureText(getLabel(option));
return Math.max(metrics.width, max3);
}, 0);
return maxWidth + padding;
};
const getGapWidth = () => {
if (!selectionRef.value) return 0;
const style = window.getComputedStyle(selectionRef.value);
return Number.parseFloat(style.gap || "6px");
};
const tagStyle = computed(() => {
const gapWidth = getGapWidth();
const inputSlotWidth = props2.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth;
return { maxWidth: `${maxWidth}px` };
});
const collapseTagStyle = computed(() => {
return { maxWidth: `${states.selectionWidth}px` };
});
const shouldShowPlaceholder = computed(() => {
if (isArray(props2.modelValue)) {
return props2.modelValue.length === 0 && !states.inputValue;
}
return props2.filterable ? !states.inputValue : true;
});
const currentPlaceholder = computed(() => {
var _a;
const _placeholder = (_a = props2.placeholder) != null ? _a : t("el.select.placeholder");
return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
});
const popperRef = computed(() => {
var _a, _b;
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
});
const indexRef = computed(() => {
if (props2.multiple) {
const len = props2.modelValue.length;
if (len > 0 && filteredOptionsValueMap.value.has(props2.modelValue[len - 1])) {
const { index } = filteredOptionsValueMap.value.get(
props2.modelValue[len - 1]
);
return index;
}
} else {
if (!isEmptyValue(props2.modelValue) && filteredOptionsValueMap.value.has(props2.modelValue)) {
const { index } = filteredOptionsValueMap.value.get(props2.modelValue);
return index;
}
}
return -1;
});
const dropdownMenuVisible = computed({
get() {
return expanded.value && (props2.loading || !isRemoteSearchEmpty.value || props2.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
},
set(val) {
expanded.value = val;
}
});
const showTagList = computed(() => {
if (!props2.multiple) {
return [];
}
return props2.collapseTags ? states.cachedOptions.slice(0, props2.maxCollapseTags) : states.cachedOptions;
});
const collapseTagList = computed(() => {
if (!props2.multiple) {
return [];
}
return props2.collapseTags ? states.cachedOptions.slice(props2.maxCollapseTags) : [];
});
const {
createNewOption,
removeNewOption,
selectNewOption,
clearAllNewOption
} = useAllowCreate(props2, states);
const toggleMenu = (event) => {
var _a;
if (selectDisabled.value || props2.filterable && expanded.value && event && !((_a = suffixRef.value) == null ? void 0 : _a.contains(event.target)))
return;
if (states.menuVisibleOnFocus) {
states.menuVisibleOnFocus = false;
} else {
expanded.value = !expanded.value;
}
};
const onInputChange = () => {
if (states.inputValue.length > 0 && !expanded.value) {
expanded.value = true;
}
createNewOption(states.inputValue);
nextTick(() => {
handleQueryChange(states.inputValue);
});
};
const debouncedOnInputChange = useDebounceFn(() => {
onInputChange();
debouncing.value = false;
}, debounce);
const handleQueryChange = (val) => {
if (states.previousQuery === val || isComposing.value) {
return;
}
states.previousQuery = val;
if (props2.filterable && isFunction(props2.filterMethod)) {
props2.filterMethod(val);
} else if (props2.filterable && props2.remote && isFunction(props2.remoteMethod)) {
props2.remoteMethod(val);
}
if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptions.value.length) {
nextTick(checkDefaultFirstOption);
} else {
nextTick(updateHoveringIndex);
}
};
const checkDefaultFirstOption = () => {
const optionsInDropdown = filteredOptions.value.filter(
(n) => !n.disabled && n.type !== "Group"
);
const userCreatedOption = optionsInDropdown.find((n) => n.created);
const firstOriginOption = optionsInDropdown[0];
states.hoveringIndex = getValueIndex(
filteredOptions.value,
userCreatedOption || firstOriginOption
);
};
const emitChange = (val) => {
if (!isEqual_default(props2.modelValue, val)) {
emit(CHANGE_EVENT, val);
}
};
const update = (val) => {
emit(UPDATE_MODEL_EVENT, val);
emitChange(val);
states.previousValue = props2.multiple ? String(val) : val;
nextTick(() => {
if (props2.multiple && isArray(props2.modelValue)) {
const cachedOptions = states.cachedOptions.slice();
const selectedOptions = props2.modelValue.map(
(value) => getOption(value, cachedOptions)
);
if (!isEqual_default(states.cachedOptions, selectedOptions)) {
states.cachedOptions = selectedOptions;
}
} else {
initStates(true);
}
});
};
const getValueIndex = (arr = [], value) => {
if (!isObject(value)) {
return arr.indexOf(value);
}
const valueKey = props2.valueKey;
let index = -1;
arr.some((item, i) => {
if (get_default(item, valueKey) === get_default(value, valueKey)) {
index = i;
return true;
}
return false;
});
return index;
};
const getValueKey = (item) => {
return isObject(item) ? get_default(item, props2.valueKey) : item;
};
const handleResize = () => {
calculatePopperSize();
};
const resetSelectionWidth = () => {
states.selectionWidth = Number.parseFloat(
window.getComputedStyle(selectionRef.value).width
);
};
const resetCollapseItemWidth = () => {
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
};
const updateTooltip = () => {
var _a, _b;
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
};
const updateTagTooltip = () => {
var _a, _b;
(_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
};
const onSelect = (option) => {
const optionValue = getValue(option);
if (props2.multiple) {
let selectedOptions = props2.modelValue.slice();
const index = getValueIndex(selectedOptions, optionValue);
if (index > -1) {
selectedOptions = [
...selectedOptions.slice(0, index),
...selectedOptions.slice(index + 1)
];
states.cachedOptions.splice(index, 1);
removeNewOption(option);
} else if (props2.multipleLimit <= 0 || selectedOptions.length < props2.multipleLimit) {
selectedOptions = [...selectedOptions, optionValue];
states.cachedOptions.push(option);
selectNewOption(option);
}
update(selectedOptions);
if (option.created) {
handleQueryChange("");
}
if (props2.filterable && !props2.reserveKeyword) {
states.inputValue = "";
}
} else {
states.selectedLabel = getLabel(option);
!isEqual_default(props2.modelValue, optionValue) && update(optionValue);
expanded.value = false;
selectNewOption(option);
if (!option.created) {
clearAllNewOption();
}
}
focus();
};
const deleteTag = (event, option) => {
let selectedOptions = props2.modelValue.slice();
const index = getValueIndex(selectedOptions, getValue(option));
if (index > -1 && !selectDisabled.value) {
selectedOptions = [
...props2.modelValue.slice(0, index),
...props2.modelValue.slice(index + 1)
];
states.cachedOptions.splice(index, 1);
update(selectedOptions);
emit("remove-tag", getValue(option));
removeNewOption(option);
}
event.stopPropagation();
focus();
};
const focus = () => {
var _a;
(_a = inputRef.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
if (expanded.value) {
expanded.value = false;
nextTick(() => {
var _a2;
return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
});
return;
}
(_a = inputRef.value) == null ? void 0 : _a.blur();
};
const handleEsc = () => {
if (states.inputValue.length > 0) {
states.inputValue = "";
} else {
expanded.value = false;
}
};
const getLastNotDisabledIndex = (value) => findLastIndex_default(
value,
(it2) => !states.cachedOptions.some(
(option) => getValue(option) === it2 && getDisabled(option)
)
);
const handleDel = (e) => {
const code = getEventCode(e);
if (!props2.multiple) return;
if (code === EVENT_CODE.delete) return;
if (states.inputValue.length === 0) {
e.preventDefault();
const selected = props2.modelValue.slice();
const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
if (lastNotDisabledIndex < 0) return;
const removeTagValue = selected[lastNotDisabledIndex];
selected.splice(lastNotDisabledIndex, 1);
const option = states.cachedOptions[lastNotDisabledIndex];
states.cachedOptions.splice(lastNotDisabledIndex, 1);
removeNewOption(option);
update(selected);
emit("remove-tag", removeTagValue);
}
};
const handleClear = () => {
let emptyValue;
if (isArray(props2.modelValue)) {
emptyValue = [];
} else {
emptyValue = valueOnClear.value;
}
states.selectedLabel = "";
expanded.value = false;
update(emptyValue);
emit("clear");
clearAllNewOption();
focus();
};
const onKeyboardNavigate = (direction2, hoveringIndex = void 0) => {
const options = filteredOptions.value;
if (!["forward", "backward"].includes(direction2) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) {
return;
}
if (!expanded.value) {
return toggleMenu();
}
if (isUndefined(hoveringIndex)) {
hoveringIndex = states.hoveringIndex;
}
let newIndex = -1;
if (direction2 === "forward") {
newIndex = hoveringIndex + 1;
if (newIndex >= options.length) {
newIndex = 0;
}
} else if (direction2 === "backward") {
newIndex = hoveringIndex - 1;
if (newIndex < 0 || newIndex >= options.length) {
newIndex = options.length - 1;
}
}
const option = options[newIndex];
if (getDisabled(option) || option.type === "Group") {
return onKeyboardNavigate(direction2, newIndex);
} else {
states.hoveringIndex = newIndex;
scrollToItem(newIndex);
}
};
const onKeyboardSelect = () => {
if (!expanded.value) {
return toggleMenu();
} else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) {
onSelect(filteredOptions.value[states.hoveringIndex]);
}
};
const onHoverOption = (idx) => {
states.hoveringIndex = idx != null ? idx : -1;
};
const updateHoveringIndex = () => {
if (!props2.multiple) {
states.hoveringIndex = filteredOptions.value.findIndex((item) => {
return getValueKey(getValue(item)) === getValueKey(props2.modelValue);
});
} else {
const length = props2.modelValue.length;
if (length > 0) {
const lastValue = props2.modelValue[length - 1];
states.hoveringIndex = filteredOptions.value.findIndex(
(item) => getValueKey(lastValue) === getValueKey(getValue(item))
);
} else {
states.hoveringIndex = -1;
}
}
};
const onInput = (event) => {
states.inputValue = event.target.value;
if (props2.remote) {
debouncing.value = true;
debouncedOnInputChange();
} else {
return onInputChange();
}
};
const handleClickOutside = (event) => {
expanded.value = false;
if (isFocused.value) {
const _event2 = new FocusEvent("blur", event);
handleBlur(_event2);
}
};
const handleMenuEnter = () => {
states.isBeforeHide = false;
return nextTick(() => {
if (~indexRef.value) {
scrollToItem(indexRef.value);
}
});
};
const scrollToItem = (index) => {
menuRef.value.scrollToItem(index);
};
const getOption = (value, cachedOptions) => {
const selectValue = getValueKey(value);
if (allOptionsValueMap.value.has(selectValue)) {
const { option } = allOptionsValueMap.value.get(selectValue);
return option;
}
if (cachedOptions && cachedOptions.length) {
const option = cachedOptions.find(
(option2) => getValueKey(getValue(option2)) === selectValue
);
if (option) {
return option;
}
}
return {
[aliasProps.value.value]: value,
[aliasProps.value.label]: value
};
};
const getIndex = (option) => {
var _a, _b;
return (_b = (_a = allOptionsValueMap.value.get(getValue(option))) == null ? void 0 : _a.index) != null ? _b : -1;
};
const initStates = (needUpdateSelectedLabel = false) => {
if (props2.multiple) {
if (props2.modelValue.length > 0) {
const cachedOptions = states.cachedOptions.slice();
states.cachedOptions.length = 0;
states.previousValue = props2.modelValue.toString();
for (const value of props2.modelValue) {
const option = getOption(value, cachedOptions);
states.cachedOptions.push(option);
}
} else {
states.cachedOptions = [];
states.previousValue = void 0;
}
} else {
if (hasModelValue.value) {
states.previousValue = props2.modelValue;
const options = filteredOptions.value;
const selectedItemIndex = options.findIndex(
(option) => getValueKey(getValue(option)) === getValueKey(props2.modelValue)
);
if (~selectedItemIndex) {
states.selectedLabel = getLabel(options[selectedItemIndex]);
} else {
if (!states.selectedLabel || needUpdateSelectedLabel) {
states.selectedLabel = getValueKey(props2.modelValue);
}
}
} else {
states.selectedLabel = "";
states.previousValue = void 0;
}
}
clearAllNewOption();
calculatePopperSize();
};
watch(
() => props2.fitInputWidth,
() => {
calculatePopperSize();
}
);
watch(expanded, (val) => {
if (val) {
if (!props2.persistent) {
calculatePopperSize();
}
handleQueryChange("");
} else {
states.inputValue = "";
states.previousQuery = null;
states.isBeforeHide = true;
states.menuVisibleOnFocus = false;
createNewOption("");
}
});
watch(
() => props2.modelValue,
(val, oldVal) => {
var _a;
const isValEmpty = !val || isArray(val) && val.length === 0;
if (isValEmpty || props2.multiple && !isEqual_default(val.toString(), states.previousValue) || !props2.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
initStates(true);
}
if (!isEqual_default(val, oldVal) && props2.validateEvent) {
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err));
}
},
{
deep: true
}
);
watch(
() => props2.options,
() => {
const input = inputRef.value;
if (!input || input && document.activeElement !== input) {
initStates();
}
},
{
deep: true,
flush: "post"
}
);
watch(
() => filteredOptions.value,
() => {
calculatePopperSize();
return menuRef.value && nextTick(menuRef.value.resetScrollTop);
}
);
watchEffect(() => {
if (states.isBeforeHide) return;
updateOptions2();
});
watchEffect(() => {
const { valueKey, options } = props2;
const duplicateValue = /* @__PURE__ */ new Map();
for (const item of options) {
const optionValue = getValue(item);
let v2 = optionValue;
if (isObject(v2)) {
v2 = get_default(optionValue, valueKey);
}
if (duplicateValue.get(v2)) {
debugWarn(
"ElSelectV2",
`The option values you provided seem to be duplicated, which may cause some problems, please check.`
);
break;
} else {
duplicateValue.set(v2, true);
}
}
});
onMounted(() => {
initStates();
});
useResizeObserver(selectRef, handleResize);
useResizeObserver(selectionRef, resetSelectionWidth);
useResizeObserver(wrapperRef, updateTooltip);
useResizeObserver(tagMenuRef, updateTagTooltip);
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
let stop;
watch(
() => dropdownMenuVisible.value,
(newVal) => {
if (newVal) {
stop = useResizeObserver(menuRef, updateTooltip).stop;
} else {
stop == null ? void 0 : stop();
stop = void 0;
}
emit("visible-change", newVal);
}
);
return {
// data exports
inputId,
collapseTagSize,
currentPlaceholder,
expanded,
emptyText,
popupHeight,
debounce,
allOptions,
allOptionsValueMap,
filteredOptions,
iconComponent,
iconReverse,
tagStyle,
collapseTagStyle,
popperSize,
dropdownMenuVisible,
hasModelValue,
shouldShowPlaceholder,
selectDisabled,
selectSize,
needStatusIcon,
showClearBtn,
states,
isFocused,
nsSelect,
nsInput,
// refs items exports
inputRef,
menuRef,
tagMenuRef,
tooltipRef,
tagTooltipRef,
selectRef,
wrapperRef,
selectionRef,
prefixRef,
suffixRef,
collapseItemRef,
popperRef,
validateState,
validateIcon,
showTagList,
collapseTagList,
// methods exports
debouncedOnInputChange,
deleteTag,
getLabel,
getValue,
getDisabled,
getValueKey,
getIndex,
handleClear,
handleClickOutside,
handleDel,
handleEsc,
focus,
blur,
handleMenuEnter,
handleResize,
resetSelectionWidth,
updateTooltip,
updateTagTooltip,
updateOptions: updateOptions2,
toggleMenu,
scrollTo: scrollToItem,
onInput,
onKeyboardNavigate,
onKeyboardSelect,
onSelect,
onHover: onHoverOption,
handleCompositionStart,
handleCompositionEnd,
handleCompositionUpdate
};
};
// node_modules/element-plus/es/components/select-v2/src/select.vue2.mjs
var _sfc_main116 = defineComponent({
name: "ElSelectV2",
components: {
ElSelectMenu: ElSelectMenu2,
ElTag,
ElTooltip,
ElIcon
},
directives: { ClickOutside },
props: selectV2Props,
emits: selectV2Emits,
setup(props2, { emit }) {
const modelValue = computed(() => {
const { modelValue: rawModelValue, multiple } = props2;
const fallback = multiple ? [] : void 0;
if (isArray(rawModelValue)) {
return multiple ? rawModelValue : fallback;
}
return multiple ? fallback : rawModelValue;
});
const API = useSelect2(
reactive({
...toRefs(props2),
modelValue
}),
emit
);
const { calculatorRef, inputStyle } = useCalcInputWidth();
const contentId = useId();
provide(selectV2InjectionKey, {
props: reactive({
...toRefs(props2),
height: API.popupHeight,
modelValue
}),
expanded: API.expanded,
tooltipRef: API.tooltipRef,
contentId,
onSelect: API.onSelect,
onHover: API.onHover,
onKeyboardNavigate: API.onKeyboardNavigate,
onKeyboardSelect: API.onKeyboardSelect
});
const selectedLabel = computed(() => {
if (!props2.multiple) {
return API.states.selectedLabel;
}
return API.states.cachedOptions.map((i) => API.getLabel(i));
});
return {
...API,
modelValue,
selectedLabel,
calculatorRef,
inputStyle,
contentId,
BORDER_HORIZONTAL_WIDTH
};
}
});
// node_modules/element-plus/es/components/select-v2/src/select.vue.mjs
var _hoisted_161 = ["id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name"];
var _hoisted_233 = ["textContent"];
var _hoisted_314 = { key: 1 };
function _sfc_render17(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_tag = resolveComponent("el-tag");
const _component_el_tooltip = resolveComponent("el-tooltip");
const _component_el_icon = resolveComponent("el-icon");
const _component_el_select_menu = resolveComponent("el-select-menu");
const _directive_click_outside = resolveDirective("click-outside");
return withDirectives((openBlock(), createElementBlock(
"div",
{
ref: "selectRef",
class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
onMouseenter: _cache[14] || (_cache[14] = ($event) => _ctx.states.inputHovering = true),
onMouseleave: _cache[15] || (_cache[15] = ($event) => _ctx.states.inputHovering = false)
},
[
createVNode(_component_el_tooltip, {
ref: "tooltipRef",
visible: _ctx.dropdownMenuVisible,
teleported: _ctx.teleported,
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
"popper-style": _ctx.popperStyle,
"gpu-acceleration": false,
"stop-popper-mouse-event": false,
"popper-options": _ctx.popperOptions,
"fallback-placements": _ctx.fallbackPlacements,
effect: _ctx.effect,
placement: _ctx.placement,
pure: "",
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
trigger: "click",
persistent: _ctx.persistent,
"append-to": _ctx.appendTo,
"show-arrow": _ctx.showArrow,
offset: _ctx.offset,
onBeforeShow: _ctx.handleMenuEnter,
onHide: _cache[13] || (_cache[13] = ($event) => _ctx.states.isBeforeHide = false)
}, {
default: withCtx(() => {
var _a, _b;
return [
createBaseVNode(
"div",
{
ref: "wrapperRef",
class: normalizeClass([
_ctx.nsSelect.e("wrapper"),
_ctx.nsSelect.is("focused", _ctx.isFocused),
_ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
_ctx.nsSelect.is("filterable", _ctx.filterable),
_ctx.nsSelect.is("disabled", _ctx.selectDisabled)
]),
onClick: _cache[10] || (_cache[10] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
},
[
_ctx.$slots.prefix ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "prefixRef",
class: normalizeClass(_ctx.nsSelect.e("prefix"))
},
[
renderSlot(_ctx.$slots, "prefix")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
ref: "selectionRef",
class: normalizeClass([
_ctx.nsSelect.e("selection"),
_ctx.nsSelect.is(
"near",
_ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length
)
])
},
[
_ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
key: 0,
data: _ctx.states.cachedOptions,
deleteTag: _ctx.deleteTag,
selectDisabled: _ctx.selectDisabled
}, () => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.showTagList, (item) => {
return openBlock(), createElementBlock(
"div",
{
key: _ctx.getValueKey(_ctx.getValue(item)),
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
"disable-transitions": "",
style: normalizeStyle(_ctx.tagStyle),
onClose: ($event) => _ctx.deleteTag($event, item)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
[
renderSlot(_ctx.$slots, "label", {
index: _ctx.getIndex(item),
label: _ctx.getLabel(item),
value: _ctx.getValue(item)
}, () => [
createTextVNode(
toDisplayString(_ctx.getLabel(item)),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
)),
_ctx.collapseTags && _ctx.modelValue.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
key: 0,
ref: "tagTooltipRef",
disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: _ctx.effect,
placement: "bottom",
"popper-class": _ctx.popperClass,
"popper-style": _ctx.popperStyle,
teleported: _ctx.teleported,
"popper-options": _ctx.popperOptions
}, {
default: withCtx(() => [
createBaseVNode(
"div",
{
ref: "collapseItemRef",
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
closable: false,
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
style: normalizeStyle(_ctx.collapseTagStyle),
"disable-transitions": ""
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
" + " + toDisplayString(_ctx.modelValue.length - _ctx.maxCollapseTags),
3
/* TEXT, CLASS */
)
]),
_: 1
/* STABLE */
}, 8, ["size", "type", "effect", "style"])
],
2
/* CLASS */
)
]),
content: withCtx(() => [
createBaseVNode(
"div",
{
ref: "tagMenuRef",
class: normalizeClass(_ctx.nsSelect.e("selection"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.collapseTagList, (selected) => {
return openBlock(), createElementBlock(
"div",
{
key: _ctx.getValueKey(_ctx.getValue(selected)),
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
},
[
createVNode(_component_el_tag, {
class: "in-tooltip",
closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
size: _ctx.collapseTagSize,
type: _ctx.tagType,
effect: _ctx.tagEffect,
"disable-transitions": "",
onClose: ($event) => _ctx.deleteTag($event, selected)
}, {
default: withCtx(() => [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
},
[
renderSlot(_ctx.$slots, "label", {
index: _ctx.getIndex(selected),
label: _ctx.getLabel(selected),
value: _ctx.getValue(selected)
}, () => [
createTextVNode(
toDisplayString(_ctx.getLabel(selected)),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["closable", "size", "type", "effect", "onClose"])
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported", "popper-options"])) : createCommentVNode("v-if", true)
]) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([
_ctx.nsSelect.e("selected-item"),
_ctx.nsSelect.e("input-wrapper"),
_ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled)
])
},
[
createBaseVNode("input", {
id: _ctx.inputId,
ref: "inputRef",
value: _ctx.states.inputValue,
style: normalizeStyle(_ctx.inputStyle),
autocomplete: _ctx.autocomplete,
tabindex: _ctx.tabindex,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
autocapitalize: "off",
"aria-expanded": _ctx.expanded,
"aria-label": _ctx.ariaLabel,
class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
disabled: _ctx.selectDisabled,
role: "combobox",
"aria-controls": _ctx.contentId,
"aria-activedescendant": _ctx.states.hoveringIndex >= 0 ? `${_ctx.contentId}-${_ctx.states.hoveringIndex}` : "",
readonly: !_ctx.filterable,
spellcheck: "false",
type: "text",
name: _ctx.name,
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
onCompositionstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
onCompositionupdate: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
onCompositionend: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
onKeydown: [
_cache[4] || (_cache[4] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
_cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
_cache[6] || (_cache[6] = withKeys(withModifiers((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])),
_cache[7] || (_cache[7] = withKeys(withModifiers((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"])),
_cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.handleDel && _ctx.handleDel(...args), ["stop"]), ["delete"]))
],
onClick: _cache[9] || (_cache[9] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
}, null, 46, _hoisted_161),
_ctx.filterable ? (openBlock(), createElementBlock("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
textContent: toDisplayString(_ctx.states.inputValue)
}, null, 10, _hoisted_233)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
_ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([
_ctx.nsSelect.e("selected-item"),
_ctx.nsSelect.e("placeholder"),
_ctx.nsSelect.is(
"transparent",
!_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue
)
])
},
[
_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
key: 0,
index: (_b = (_a = _ctx.allOptionsValueMap.get(_ctx.modelValue)) == null ? void 0 : _a.index) != null ? _b : -1,
label: _ctx.currentPlaceholder,
value: _ctx.modelValue
}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.currentPlaceholder),
1
/* TEXT */
)
]) : (openBlock(), createElementBlock(
"span",
_hoisted_314,
toDisplayString(_ctx.currentPlaceholder),
1
/* TEXT */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
ref: "suffixRef",
class: normalizeClass(_ctx.nsSelect.e("suffix"))
},
[
_ctx.iconComponent ? withDirectives((openBlock(), createBlock(_component_el_icon, {
key: 0,
class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
]),
_: 1
/* STABLE */
}, 8, ["class"])), [
[vShow, !_ctx.showClearBtn]
]) : createCommentVNode("v-if", true),
_ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
key: 1,
class: normalizeClass([
_ctx.nsSelect.e("caret"),
_ctx.nsInput.e("icon"),
_ctx.nsSelect.e("clear")
]),
onClick: withModifiers(_ctx.handleClear, ["prevent", "stop"])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
key: 2,
class: normalizeClass([
_ctx.nsInput.e("icon"),
_ctx.nsInput.e("validateIcon"),
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
)
];
}),
content: withCtx(() => [
createVNode(_component_el_select_menu, {
id: _ctx.contentId,
ref: "menuRef",
data: _ctx.filteredOptions,
width: _ctx.popperSize - _ctx.BORDER_HORIZONTAL_WIDTH,
"hovering-index": _ctx.states.hoveringIndex,
"scrollbar-always-on": _ctx.scrollbarAlwaysOn,
"aria-label": _ctx.ariaLabel
}, createSlots({
default: withCtx((scope) => [
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.header ? {
name: "header",
fn: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
onClick: _cache[11] || (_cache[11] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "header")
],
2
/* CLASS */
)
]),
key: "0"
} : void 0,
_ctx.$slots.loading && _ctx.loading ? {
name: "loading",
fn: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
},
[
renderSlot(_ctx.$slots, "loading")
],
2
/* CLASS */
)
]),
key: "1"
} : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
name: "empty",
fn: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => [
createBaseVNode(
"span",
null,
toDisplayString(_ctx.emptyText),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]),
key: "2"
} : void 0,
_ctx.$slots.footer ? {
name: "footer",
fn: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
onClick: _cache[12] || (_cache[12] = withModifiers(() => {
}, ["stop"]))
},
[
renderSlot(_ctx.$slots, "footer")
],
2
/* CLASS */
)
]),
key: "3"
} : void 0
]), 1032, ["id", "data", "width", "hovering-index", "scrollbar-always-on", "aria-label"])
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
],
34
/* CLASS, NEED_HYDRATION */
)), [
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
]);
}
var Select2 = _export_sfc(_sfc_main116, [["render", _sfc_render17]]);
// node_modules/element-plus/es/components/select-v2/index.mjs
var ElSelectV2 = withInstall(Select2);
// node_modules/element-plus/es/components/skeleton/src/skeleton.mjs
var skeletonProps = buildProps({
/**
* @description whether showing the animation
*/
animated: Boolean,
/**
* @description how many fake items to render to the DOM
*/
count: {
type: Number,
default: 1
},
/**
* @description numbers of the row, only useful when no template slot were given
*/
rows: {
type: Number,
default: 3
},
/**
* @description whether showing the real DOM
*/
loading: {
type: Boolean,
default: true
},
/**
* @description rendering delay in milliseconds
*/
throttle: {
type: definePropType([Number, Object])
}
});
// node_modules/element-plus/es/components/skeleton/src/skeleton-item.mjs
var skeletonItemProps = buildProps({
/**
* @description the current rendering skeleton type
*/
variant: {
type: String,
values: [
"circle",
"rect",
"h1",
"h3",
"text",
"caption",
"p",
"image",
"button"
],
default: "text"
}
});
// node_modules/element-plus/es/components/skeleton/src/skeleton-item.vue2.mjs
var _sfc_main117 = defineComponent({
...{
name: "ElSkeletonItem"
},
__name: "skeleton-item",
props: skeletonItemProps,
setup(__props) {
const ns = useNamespace("skeleton");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).e("item"), unref(ns).e(__props.variant)])
},
[
__props.variant === "image" ? (openBlock(), createBlock(unref(picture_filled_default), { key: 0 })) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/hooks/use-throttle-render/index.mjs
var useThrottleRender = (loading, throttle = 0) => {
if (throttle === 0) return loading;
const initVal = isObject(throttle) && Boolean(throttle.initVal);
const throttled = ref(initVal);
let timeoutHandle = null;
const dispatchThrottling = (timer) => {
if (isUndefined(timer)) {
throttled.value = loading.value;
return;
}
if (timeoutHandle) {
clearTimeout(timeoutHandle);
}
timeoutHandle = setTimeout(() => {
throttled.value = loading.value;
}, timer);
};
const dispatcher = (type) => {
if (type === "leading") {
if (isNumber(throttle)) {
dispatchThrottling(throttle);
} else {
dispatchThrottling(throttle.leading);
}
} else {
if (isObject(throttle)) {
dispatchThrottling(throttle.trailing);
} else {
throttled.value = false;
}
}
};
onMounted(() => dispatcher("leading"));
watch(
() => loading.value,
(val) => {
dispatcher(val ? "leading" : "trailing");
}
);
return throttled;
};
// node_modules/element-plus/es/components/skeleton/src/skeleton.vue2.mjs
var _sfc_main118 = defineComponent({
...{
name: "ElSkeleton"
},
__name: "skeleton",
props: skeletonProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const ns = useNamespace("skeleton");
const uiLoading = useThrottleRender(toRef(props2, "loading"), props2.throttle);
__expose({
/** @description loading state */
uiLoading
});
return (_ctx, _cache) => {
return unref(uiLoading) ? (openBlock(), createElementBlock(
"div",
mergeProps({
key: 0,
class: [unref(ns).b(), unref(ns).is("animated", __props.animated)]
}, _ctx.$attrs),
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.count, (i) => {
return openBlock(), createElementBlock(
Fragment,
{ key: i },
[
unref(uiLoading) ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
createVNode(_sfc_main117, {
class: normalizeClass(unref(ns).is("first")),
variant: "p"
}, null, 8, ["class"]),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.rows, (item) => {
return openBlock(), createBlock(_sfc_main117, {
key: item,
class: normalizeClass([
unref(ns).e("paragraph"),
unref(ns).is("last", item === __props.rows && __props.rows > 1)
]),
variant: "p"
}, null, 8, ["class"]);
}),
128
/* KEYED_FRAGMENT */
))
]) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
))
],
16
/* FULL_PROPS */
)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
};
}
});
// node_modules/element-plus/es/components/skeleton/index.mjs
var ElSkeleton = withInstall(_sfc_main118, {
SkeletonItem: _sfc_main117
});
var ElSkeletonItem = withNoopInstall(_sfc_main117);
// node_modules/element-plus/es/components/slider/src/constants.mjs
var sliderContextKey = /* @__PURE__ */ Symbol("sliderContextKey");
// node_modules/element-plus/es/components/slider/src/slider.mjs
var sliderProps = buildProps({
/**
* @description binding value
*/
modelValue: {
type: definePropType([Number, Array]),
default: 0
},
id: {
type: String,
default: void 0
},
/**
* @description minimum value
*/
min: {
type: Number,
default: 0
},
/**
* @description maximum value
*/
max: {
type: Number,
default: 100
},
/**
* @description step size
*/
step: {
type: Number,
default: 1
},
/**
* @description whether to display an input box, works when `range` is false
*/
showInput: Boolean,
/**
* @description whether to display control buttons when `show-input` is true
*/
showInputControls: {
type: Boolean,
default: true
},
/**
* @description size of the slider wrapper, will not work in vertical mode
*/
size: useSizeProp,
/**
* @description size of the input box, when set `size`, the default is the value of `size`
*/
inputSize: useSizeProp,
/**
* @description whether to display breakpoints
*/
showStops: Boolean,
/**
* @description whether to display tooltip value
*/
showTooltip: {
type: Boolean,
default: true
},
/**
* @description format to display tooltip value
*/
formatTooltip: {
type: definePropType(Function),
default: void 0
},
/**
* @description whether Slider is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether to select a range
*/
range: Boolean,
/**
* @description vertical mode
*/
vertical: Boolean,
/**
* @description slider height, required in vertical mode
*/
height: String,
/**
* @description when `range` is true, screen reader label for the start of the range
*/
rangeStartLabel: {
type: String,
default: void 0
},
/**
* @description when `range` is true, screen reader label for the end of the range
*/
rangeEndLabel: {
type: String,
default: void 0
},
/**
* @description format to display the `aria-valuenow` attribute for screen readers
*/
formatValueText: {
type: definePropType(Function),
default: void 0
},
/**
* @description custom class name for the tooltip
*/
tooltipClass: {
type: String,
default: void 0
},
/**
* @description position of Tooltip
*/
placement: {
type: String,
values: Ee,
default: "top"
},
/**
* @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style
*/
marks: {
type: definePropType(Object)
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description when slider tooltip inactive and `persistent` is `false` , popconfirm will be destroyed. `persistent` always be `false` when `show-tooltip ` is `false`
*/
persistent: {
type: Boolean,
default: true
},
...useAriaProps(["ariaLabel"])
});
var isValidValue = (value) => isNumber(value) || isArray(value) && value.every(isNumber);
var sliderEmits = {
[UPDATE_MODEL_EVENT]: isValidValue,
[INPUT_EVENT]: isValidValue,
[CHANGE_EVENT]: isValidValue
};
// node_modules/element-plus/es/components/slider/src/button.mjs
var sliderButtonProps = buildProps({
modelValue: {
type: Number,
default: 0
},
vertical: Boolean,
tooltipClass: String,
placement: {
type: String,
values: Ee,
default: "top"
}
});
var sliderButtonEmits = {
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
};
// node_modules/element-plus/es/components/slider/src/composables/use-slider-button.mjs
var useTooltip = (props2, formatTooltip, showTooltip) => {
const tooltip = ref();
const tooltipVisible = ref(false);
const enableFormat = computed(() => {
return formatTooltip.value instanceof Function;
});
const formatValue = computed(() => {
return enableFormat.value && formatTooltip.value(props2.modelValue) || props2.modelValue;
});
const displayTooltip = debounce_default(() => {
showTooltip.value && (tooltipVisible.value = true);
}, 50);
const hideTooltip = debounce_default(() => {
showTooltip.value && (tooltipVisible.value = false);
}, 50);
return {
tooltip,
tooltipVisible,
formatValue,
displayTooltip,
hideTooltip
};
};
var useSliderButton = (props2, initData, emit) => {
const {
disabled,
min: min3,
max: max3,
step: step2,
showTooltip,
persistent,
precision,
sliderSize,
formatTooltip,
emitChange,
resetSize,
updateDragging
} = inject(sliderContextKey);
const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props2, formatTooltip, showTooltip);
const button = ref();
const currentPosition = computed(() => {
return `${(props2.modelValue - min3.value) / (max3.value - min3.value) * 100}%`;
});
const wrapperStyle = computed(() => {
return props2.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
});
const handleMouseEnter = () => {
initData.hovering = true;
displayTooltip();
};
const handleMouseLeave = () => {
initData.hovering = false;
if (!initData.dragging) {
hideTooltip();
}
};
const onButtonDown = (event) => {
if (disabled.value) return;
event.preventDefault();
onDragStart(event);
window.addEventListener("mousemove", onDragging);
window.addEventListener("touchmove", onDragging);
window.addEventListener("mouseup", onDragEnd);
window.addEventListener("touchend", onDragEnd);
window.addEventListener("contextmenu", onDragEnd);
button.value.focus();
};
const incrementPosition = (amount) => {
if (disabled.value) return;
initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max3.value - min3.value) * 100;
setPosition(initData.newPosition);
emitChange();
};
const onLeftKeyDown = () => {
incrementPosition(-step2.value);
};
const onRightKeyDown = () => {
incrementPosition(step2.value);
};
const onPageDownKeyDown = () => {
incrementPosition(-step2.value * 4);
};
const onPageUpKeyDown = () => {
incrementPosition(step2.value * 4);
};
const onHomeKeyDown = () => {
if (disabled.value) return;
setPosition(0);
emitChange();
};
const onEndKeyDown = () => {
if (disabled.value) return;
setPosition(100);
emitChange();
};
const onKeyDown = (event) => {
const code = getEventCode(event);
let isPreventDefault = true;
switch (code) {
case EVENT_CODE.left:
case EVENT_CODE.down:
onLeftKeyDown();
break;
case EVENT_CODE.right:
case EVENT_CODE.up:
onRightKeyDown();
break;
case EVENT_CODE.home:
onHomeKeyDown();
break;
case EVENT_CODE.end:
onEndKeyDown();
break;
case EVENT_CODE.pageDown:
onPageDownKeyDown();
break;
case EVENT_CODE.pageUp:
onPageUpKeyDown();
break;
default:
isPreventDefault = false;
break;
}
isPreventDefault && event.preventDefault();
};
const getClientXY2 = (event) => {
let clientX;
let clientY;
if (event.type.startsWith("touch")) {
clientY = event.touches[0].clientY;
clientX = event.touches[0].clientX;
} else {
clientY = event.clientY;
clientX = event.clientX;
}
return {
clientX,
clientY
};
};
const onDragStart = (event) => {
initData.dragging = true;
initData.isClick = true;
const { clientX, clientY } = getClientXY2(event);
if (props2.vertical) {
initData.startY = clientY;
} else {
initData.startX = clientX;
}
initData.startPosition = Number.parseFloat(currentPosition.value);
initData.newPosition = initData.startPosition;
};
const onDragging = (event) => {
if (initData.dragging) {
initData.isClick = false;
displayTooltip();
resetSize();
let diff;
const { clientX, clientY } = getClientXY2(event);
if (props2.vertical) {
initData.currentY = clientY;
diff = (initData.startY - initData.currentY) / sliderSize.value * 100;
} else {
initData.currentX = clientX;
diff = (initData.currentX - initData.startX) / sliderSize.value * 100;
}
initData.newPosition = initData.startPosition + diff;
setPosition(initData.newPosition);
}
};
const onDragEnd = () => {
if (initData.dragging) {
setTimeout(() => {
initData.dragging = false;
if (!initData.hovering) {
hideTooltip();
}
if (!initData.isClick) {
setPosition(initData.newPosition);
}
emitChange();
}, 0);
window.removeEventListener("mousemove", onDragging);
window.removeEventListener("touchmove", onDragging);
window.removeEventListener("mouseup", onDragEnd);
window.removeEventListener("touchend", onDragEnd);
window.removeEventListener("contextmenu", onDragEnd);
}
};
const setPosition = async (newPosition) => {
if (newPosition === null || Number.isNaN(+newPosition)) return;
newPosition = clamp_default(newPosition, 0, 100);
const fullSteps = Math.floor((max3.value - min3.value) / step2.value);
const fullRangePercentage = fullSteps * step2.value / (max3.value - min3.value) * 100;
const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
let value;
if (newPosition < fullRangePercentage) {
const valueBetween = fullRangePercentage / fullSteps;
const steps = Math.round(newPosition / valueBetween);
value = min3.value + steps * step2.value;
} else if (newPosition < threshold) {
value = min3.value + fullSteps * step2.value;
} else {
value = max3.value;
}
value = Number.parseFloat(value.toFixed(precision.value));
if (value !== props2.modelValue) {
emit(UPDATE_MODEL_EVENT, value);
}
if (!initData.dragging && props2.modelValue !== initData.oldValue) {
initData.oldValue = props2.modelValue;
}
await nextTick();
initData.dragging && displayTooltip();
tooltip.value.updatePopper();
};
watch(
() => initData.dragging,
(val) => {
updateDragging(val);
}
);
useEventListener(button, "touchstart", onButtonDown, { passive: false });
return {
disabled,
button,
tooltip,
tooltipVisible,
showTooltip,
persistent,
wrapperStyle,
formatValue,
handleMouseEnter,
handleMouseLeave,
onButtonDown,
onKeyDown,
setPosition
};
};
// node_modules/element-plus/es/components/slider/src/button.vue2.mjs
var _hoisted_163 = ["tabindex"];
var _sfc_main119 = defineComponent({
...{
name: "ElSliderButton"
},
__name: "button",
props: sliderButtonProps,
emits: sliderButtonEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("slider");
const initData = reactive({
hovering: false,
dragging: false,
isClick: false,
startX: 0,
currentX: 0,
startY: 0,
currentY: 0,
startPosition: 0,
newPosition: 0,
oldValue: props2.modelValue
});
const tooltipPersistent = computed(
() => !showTooltip.value ? false : persistent.value
);
const {
disabled,
button,
tooltip,
showTooltip,
persistent,
tooltipVisible,
wrapperStyle,
formatValue,
handleMouseEnter,
handleMouseLeave,
onButtonDown,
onKeyDown,
setPosition
} = useSliderButton(props2, initData, emit);
const { hovering, dragging } = toRefs(initData);
__expose({
onButtonDown,
onKeyDown,
setPosition,
hovering,
dragging
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "button",
ref: button,
class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
style: normalizeStyle(unref(wrapperStyle)),
tabindex: unref(disabled) ? void 0 : 0,
onMouseenter: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
onMouseleave: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
onMousedown: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
onFocus: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
onBlur: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
onKeydown: _cache[5] || (_cache[5] = //@ts-ignore
(...args) => unref(onKeyDown) && unref(onKeyDown)(...args))
}, [
createVNode(unref(ElTooltip), {
ref_key: "tooltip",
ref: tooltip,
visible: unref(tooltipVisible),
placement: _ctx.placement,
"fallback-placements": ["top", "bottom", "right", "left"],
"stop-popper-mouse-event": false,
"popper-class": _ctx.tooltipClass,
disabled: !unref(showTooltip),
persistent: tooltipPersistent.value
}, {
content: withCtx(() => [
createBaseVNode(
"span",
null,
toDisplayString(unref(formatValue)),
1
/* TEXT */
)
]),
default: withCtx(() => [
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
},
null,
2
/* CLASS */
)
]),
_: 1
/* STABLE */
}, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
], 46, _hoisted_163);
};
}
});
// node_modules/element-plus/es/components/slider/src/marker.mjs
var sliderMarkerProps = buildProps({
mark: {
type: definePropType([String, Object]),
default: void 0
}
});
var SliderMarker = defineComponent({
name: "ElSliderMarker",
props: sliderMarkerProps,
setup(props2) {
const ns = useNamespace("slider");
const label = computed(() => {
return isString(props2.mark) ? props2.mark : props2.mark.label;
});
const style = computed(
() => isString(props2.mark) ? void 0 : props2.mark.style
);
return () => h(
"div",
{
class: ns.e("marks-text"),
style: style.value
},
label.value
);
}
});
// node_modules/element-plus/es/components/slider/src/composables/use-slide.mjs
var useSlide = (props2, initData, emit) => {
const { formItem: elFormItem } = useFormItem();
const slider = shallowRef();
const firstButton = ref();
const secondButton = ref();
const buttonRefs = {
firstButton,
secondButton
};
const sliderDisabled = useFormDisabled();
const minValue3 = computed(() => {
return Math.min(initData.firstValue, initData.secondValue);
});
const maxValue3 = computed(() => {
return Math.max(initData.firstValue, initData.secondValue);
});
const barSize = computed(() => {
return props2.range ? `${100 * (maxValue3.value - minValue3.value) / (props2.max - props2.min)}%` : `${100 * (initData.firstValue - props2.min) / (props2.max - props2.min)}%`;
});
const barStart = computed(() => {
return props2.range ? `${100 * (minValue3.value - props2.min) / (props2.max - props2.min)}%` : "0%";
});
const runwayStyle = computed(() => {
return props2.vertical ? { height: props2.height } : {};
});
const barStyle = computed(() => {
return props2.vertical ? {
height: barSize.value,
bottom: barStart.value
} : {
width: barSize.value,
left: barStart.value
};
});
const resetSize = () => {
if (slider.value) {
const rect = slider.value.getBoundingClientRect();
initData.sliderSize = rect[props2.vertical ? "height" : "width"];
}
};
const getButtonRefByPercent = (percent) => {
const targetValue = props2.min + percent * (props2.max - props2.min) / 100;
if (!props2.range) {
return firstButton;
}
let buttonRefName;
if (Math.abs(minValue3.value - targetValue) < Math.abs(maxValue3.value - targetValue)) {
buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton";
} else {
buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton";
}
return buttonRefs[buttonRefName];
};
const setPosition = (percent) => {
const buttonRef = getButtonRefByPercent(percent);
buttonRef.value.setPosition(percent);
return buttonRef;
};
const setFirstValue = (firstValue) => {
initData.firstValue = firstValue != null ? firstValue : props2.min;
_emit(
props2.range ? [minValue3.value, maxValue3.value] : firstValue != null ? firstValue : props2.min
);
};
const setSecondValue = (secondValue) => {
initData.secondValue = secondValue;
if (props2.range) {
_emit([minValue3.value, maxValue3.value]);
}
};
const _emit = (val) => {
emit(UPDATE_MODEL_EVENT, val);
emit(INPUT_EVENT, val);
};
const emitChange = async () => {
await nextTick();
emit(
CHANGE_EVENT,
props2.range ? [minValue3.value, maxValue3.value] : props2.modelValue
);
};
const handleSliderPointerEvent = (event) => {
var _a, _b, _c, _d, _e, _f;
if (sliderDisabled.value || initData.dragging) return;
resetSize();
let newPercent = 0;
if (props2.vertical) {
const clientY = (_c = (_b = (_a = event.touches) == null ? void 0 : _a.item(0)) == null ? void 0 : _b.clientY) != null ? _c : event.clientY;
const sliderOffsetBottom = slider.value.getBoundingClientRect().bottom;
newPercent = (sliderOffsetBottom - clientY) / initData.sliderSize * 100;
} else {
const clientX = (_f = (_e = (_d = event.touches) == null ? void 0 : _d.item(0)) == null ? void 0 : _e.clientX) != null ? _f : event.clientX;
const sliderOffsetLeft = slider.value.getBoundingClientRect().left;
newPercent = (clientX - sliderOffsetLeft) / initData.sliderSize * 100;
}
if (newPercent < 0 || newPercent > 100) return;
return setPosition(newPercent);
};
const onSliderWrapperPrevent = (event) => {
var _a, _b;
if (((_a = buttonRefs["firstButton"].value) == null ? void 0 : _a.dragging) || ((_b = buttonRefs["secondButton"].value) == null ? void 0 : _b.dragging)) {
event.preventDefault();
}
};
const onSliderDown = async (event) => {
const buttonRef = handleSliderPointerEvent(event);
if (buttonRef) {
await nextTick();
buttonRef.value.onButtonDown(event);
}
};
const onSliderClick = (event) => {
const buttonRef = handleSliderPointerEvent(event);
if (buttonRef) {
emitChange();
}
};
const onSliderMarkerDown = (position) => {
if (sliderDisabled.value || initData.dragging) return;
const buttonRef = setPosition(position);
if (buttonRef) {
emitChange();
}
};
return {
elFormItem,
slider,
firstButton,
secondButton,
sliderDisabled,
minValue: minValue3,
maxValue: maxValue3,
runwayStyle,
barStyle,
resetSize,
setPosition,
emitChange,
onSliderWrapperPrevent,
onSliderClick,
onSliderDown,
onSliderMarkerDown,
setFirstValue,
setSecondValue
};
};
// node_modules/element-plus/es/components/slider/src/composables/use-stops.mjs
var useStops = (props2, initData, minValue3, maxValue3) => {
const stops = computed(() => {
if (!props2.showStops || props2.min > props2.max) return [];
if (props2.step === 0) {
debugWarn("ElSlider", "step should not be 0.");
return [];
}
const stopCount = Math.ceil((props2.max - props2.min) / props2.step);
const stepWidth = 100 * props2.step / (props2.max - props2.min);
const result = Array.from({ length: stopCount - 1 }).map(
(_2, index) => (index + 1) * stepWidth
);
if (props2.range) {
return result.filter((step2) => {
return step2 < 100 * (minValue3.value - props2.min) / (props2.max - props2.min) || step2 > 100 * (maxValue3.value - props2.min) / (props2.max - props2.min);
});
} else {
return result.filter(
(step2) => step2 > 100 * (initData.firstValue - props2.min) / (props2.max - props2.min)
);
}
});
const getStopStyle = (position) => {
return props2.vertical ? { bottom: `${position}%` } : { left: `${position}%` };
};
return {
stops,
getStopStyle
};
};
// node_modules/element-plus/es/components/slider/src/composables/use-marks.mjs
var useMarks = (props2) => {
return computed(() => {
if (!props2.marks) {
return [];
}
const marksKeys = Object.keys(props2.marks);
return marksKeys.map(Number.parseFloat).sort((a2, b2) => a2 - b2).filter((point) => point <= props2.max && point >= props2.min).map(
(point) => ({
point,
position: (point - props2.min) * 100 / (props2.max - props2.min),
mark: props2.marks[point]
})
);
});
};
// node_modules/element-plus/es/components/slider/src/composables/use-watch.mjs
var useWatch = (props2, initData, minValue3, maxValue3, emit, elFormItem) => {
const _emit = (val) => {
emit(UPDATE_MODEL_EVENT, val);
emit(INPUT_EVENT, val);
};
const valueChanged = () => {
if (props2.range) {
return ![minValue3.value, maxValue3.value].every(
(item, index) => item === initData.oldValue[index]
);
} else {
return props2.modelValue !== initData.oldValue;
}
};
const setValues = () => {
var _a, _b;
if (props2.min > props2.max) {
throwError("Slider", "min should not be greater than max.");
}
const val = props2.modelValue;
if (props2.range && isArray(val)) {
if (val[1] < props2.min) {
_emit([props2.min, props2.min]);
} else if (val[0] > props2.max) {
_emit([props2.max, props2.max]);
} else if (val[0] < props2.min) {
_emit([props2.min, val[1]]);
} else if (val[1] > props2.max) {
_emit([val[0], props2.max]);
} else {
initData.firstValue = val[0];
initData.secondValue = val[1];
if (valueChanged()) {
if (props2.validateEvent) {
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn(err));
}
initData.oldValue = val.slice();
}
}
} else if (!props2.range && isNumber(val) && !Number.isNaN(val)) {
if (val < props2.min) {
_emit(props2.min);
} else if (val > props2.max) {
_emit(props2.max);
} else {
initData.firstValue = val;
if (valueChanged()) {
if (props2.validateEvent) {
(_b = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _b.call(elFormItem, "change").catch((err) => debugWarn(err));
}
initData.oldValue = val;
}
}
}
};
setValues();
watch(
() => initData.dragging,
(val) => {
if (!val) {
setValues();
}
}
);
watch(
() => props2.modelValue,
(val, oldVal) => {
if (initData.dragging || isArray(val) && isArray(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) {
return;
}
setValues();
},
{
deep: true
}
);
watch(
() => [props2.min, props2.max],
() => {
setValues();
}
);
};
// node_modules/element-plus/es/components/slider/src/composables/use-lifecycle.mjs
var useLifecycle = (props2, initData, resetSize) => {
const sliderWrapper = ref();
onMounted(async () => {
if (props2.range) {
if (isArray(props2.modelValue)) {
initData.firstValue = Math.max(props2.min, props2.modelValue[0]);
initData.secondValue = Math.min(props2.max, props2.modelValue[1]);
} else {
initData.firstValue = props2.min;
initData.secondValue = props2.max;
}
initData.oldValue = [initData.firstValue, initData.secondValue];
} else {
if (!isNumber(props2.modelValue) || Number.isNaN(props2.modelValue)) {
initData.firstValue = props2.min;
} else {
initData.firstValue = Math.min(
props2.max,
Math.max(props2.min, props2.modelValue)
);
}
initData.oldValue = initData.firstValue;
}
useEventListener(window, "resize", resetSize);
await nextTick();
resetSize();
});
return {
sliderWrapper
};
};
// node_modules/element-plus/es/components/slider/src/slider.vue2.mjs
var _hoisted_164 = ["id", "role", "aria-label", "aria-labelledby"];
var _hoisted_234 = { key: 1 };
var _sfc_main120 = defineComponent({
...{
name: "ElSlider"
},
__name: "slider",
props: sliderProps,
emits: sliderEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("slider");
const { t } = useLocale();
const initData = reactive({
firstValue: 0,
secondValue: 0,
oldValue: 0,
dragging: false,
sliderSize: 1
});
const {
elFormItem,
slider,
firstButton,
secondButton,
sliderDisabled,
minValue: minValue3,
maxValue: maxValue3,
runwayStyle,
barStyle,
resetSize,
emitChange,
onSliderWrapperPrevent,
onSliderClick,
onSliderDown,
onSliderMarkerDown,
setFirstValue,
setSecondValue
} = useSlide(props2, initData, emit);
const { stops, getStopStyle } = useStops(props2, initData, minValue3, maxValue3);
const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
formItemContext: elFormItem
});
const sliderWrapperSize = useFormSize();
const sliderInputSize = computed(
() => props2.inputSize || sliderWrapperSize.value
);
const groupLabel = computed(() => {
return props2.ariaLabel || t("el.slider.defaultLabel", {
min: props2.min,
max: props2.max
});
});
const firstButtonLabel = computed(() => {
if (props2.range) {
return props2.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
} else {
return groupLabel.value;
}
});
const firstValueText = computed(() => {
return props2.formatValueText ? props2.formatValueText(firstValue.value) : `${firstValue.value}`;
});
const secondButtonLabel = computed(() => {
return props2.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
});
const secondValueText = computed(() => {
return props2.formatValueText ? props2.formatValueText(secondValue.value) : `${secondValue.value}`;
});
const sliderKls = computed(() => [
ns.b(),
ns.m(sliderWrapperSize.value),
ns.is("vertical", props2.vertical),
{ [ns.m("with-input")]: props2.showInput }
]);
const markList = useMarks(props2);
useWatch(props2, initData, minValue3, maxValue3, emit, elFormItem);
const precision = computed(() => {
const precisions = [props2.min, props2.max, props2.step].map((item) => {
const decimal = `${item}`.split(".")[1];
return decimal ? decimal.length : 0;
});
return Math.max.apply(null, precisions);
});
const { sliderWrapper } = useLifecycle(props2, initData, resetSize);
const { firstValue, secondValue, sliderSize } = toRefs(initData);
const updateDragging = (val) => {
initData.dragging = val;
};
useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, {
passive: false
});
useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, {
passive: false
});
provide(sliderContextKey, {
...toRefs(props2),
sliderSize,
disabled: sliderDisabled,
precision,
emitChange,
resetSize,
updateDragging
});
__expose({
onSliderClick
});
return (_ctx, _cache) => {
var _a, _b;
return openBlock(), createElementBlock("div", {
id: _ctx.range ? unref(inputId) : void 0,
ref_key: "sliderWrapper",
ref: sliderWrapper,
class: normalizeClass(sliderKls.value),
role: _ctx.range ? "group" : void 0,
"aria-label": _ctx.range && !unref(isLabeledByFormItem) ? groupLabel.value : void 0,
"aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? (_a = unref(elFormItem)) == null ? void 0 : _a.labelId : void 0
}, [
createBaseVNode(
"div",
{
ref_key: "slider",
ref: slider,
class: normalizeClass([
unref(ns).e("runway"),
{ "show-input": _ctx.showInput && !_ctx.range },
unref(ns).is("disabled", unref(sliderDisabled))
]),
style: normalizeStyle(unref(runwayStyle)),
onMousedown: _cache[0] || (_cache[0] = //@ts-ignore
(...args) => unref(onSliderDown) && unref(onSliderDown)(...args)),
onTouchstartPassive: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => unref(onSliderDown) && unref(onSliderDown)(...args))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("bar")),
style: normalizeStyle(unref(barStyle))
},
null,
6
/* CLASS, STYLE */
),
createVNode(_sfc_main119, {
id: !_ctx.range ? unref(inputId) : void 0,
ref_key: "firstButton",
ref: firstButton,
"model-value": unref(firstValue),
vertical: _ctx.vertical,
"tooltip-class": _ctx.tooltipClass,
placement: _ctx.placement,
role: "slider",
"aria-label": _ctx.range || !unref(isLabeledByFormItem) ? firstButtonLabel.value : void 0,
"aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? (_b = unref(elFormItem)) == null ? void 0 : _b.labelId : void 0,
"aria-valuemin": _ctx.min,
"aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max,
"aria-valuenow": unref(firstValue),
"aria-valuetext": firstValueText.value,
"aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
"aria-disabled": unref(sliderDisabled),
"onUpdate:modelValue": unref(setFirstValue)
}, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
_ctx.range ? (openBlock(), createBlock(_sfc_main119, {
key: 0,
ref_key: "secondButton",
ref: secondButton,
"model-value": unref(secondValue),
vertical: _ctx.vertical,
"tooltip-class": _ctx.tooltipClass,
placement: _ctx.placement,
role: "slider",
"aria-label": secondButtonLabel.value,
"aria-valuemin": unref(firstValue),
"aria-valuemax": _ctx.max,
"aria-valuenow": unref(secondValue),
"aria-valuetext": secondValueText.value,
"aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
"aria-disabled": unref(sliderDisabled),
"onUpdate:modelValue": unref(setSecondValue)
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true),
_ctx.showStops ? (openBlock(), createElementBlock("div", _hoisted_234, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(stops), (item, key) => {
return openBlock(), createElementBlock(
"div",
{
key,
class: normalizeClass(unref(ns).e("stop")),
style: normalizeStyle(unref(getStopStyle)(item))
},
null,
6
/* CLASS, STYLE */
);
}),
128
/* KEYED_FRAGMENT */
))
])) : createCommentVNode("v-if", true),
unref(markList).length > 0 ? (openBlock(), createElementBlock(
Fragment,
{ key: 2 },
[
createBaseVNode("div", null, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(markList), (item, key) => {
return openBlock(), createElementBlock(
"div",
{
key,
style: normalizeStyle(unref(getStopStyle)(item.position)),
class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")])
},
null,
6
/* CLASS, STYLE */
);
}),
128
/* KEYED_FRAGMENT */
))
]),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("marks"))
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(markList), (item, key) => {
return openBlock(), createBlock(unref(SliderMarker), {
key,
mark: item.mark,
style: normalizeStyle(unref(getStopStyle)(item.position)),
onMousedown: withModifiers(($event) => unref(onSliderMarkerDown)(item.position), ["stop"])
}, null, 8, ["mark", "style", "onMousedown"]);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
38
/* CLASS, STYLE, NEED_HYDRATION */
),
_ctx.showInput && !_ctx.range ? (openBlock(), createBlock(unref(ElInputNumber), {
key: 0,
ref: "input",
"model-value": unref(firstValue),
class: normalizeClass(unref(ns).e("input")),
step: _ctx.step,
disabled: unref(sliderDisabled),
controls: _ctx.showInputControls,
min: _ctx.min,
max: _ctx.max,
precision: precision.value,
size: sliderInputSize.value,
"onUpdate:modelValue": unref(setFirstValue),
onChange: unref(emitChange)
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true)
], 10, _hoisted_164);
};
}
});
// node_modules/element-plus/es/components/slider/index.mjs
var ElSlider = withInstall(_sfc_main120);
// node_modules/element-plus/es/components/space/src/item.mjs
var spaceItemProps = buildProps({
prefixCls: {
type: String
}
});
var SpaceItem = defineComponent({
name: "ElSpaceItem",
props: spaceItemProps,
setup(props2, { slots }) {
const ns = useNamespace("space");
const classes = computed(() => `${props2.prefixCls || ns.b()}__item`);
return () => h("div", { class: classes.value }, renderSlot(slots, "default"));
}
});
// node_modules/element-plus/es/components/space/src/use-space.mjs
var SIZE_MAP = {
small: 8,
default: 12,
large: 16
};
function useSpace(props2) {
const ns = useNamespace("space");
const classes = computed(() => [ns.b(), ns.m(props2.direction), props2.class]);
const horizontalSize = ref(0);
const verticalSize = ref(0);
const containerStyle = computed(() => {
const wrapKls = props2.wrap || props2.fill ? { flexWrap: "wrap" } : {};
const alignment = {
alignItems: props2.alignment
};
const gap = {
rowGap: `${verticalSize.value}px`,
columnGap: `${horizontalSize.value}px`
};
return [wrapKls, alignment, gap, props2.style];
});
const itemStyle = computed(() => {
return props2.fill ? { flexGrow: 1, minWidth: `${props2.fillRatio}%` } : {};
});
watchEffect(() => {
const { size: size2 = "small", wrap, direction: dir, fill } = props2;
if (isArray(size2)) {
const [h3 = 0, v2 = 0] = size2;
horizontalSize.value = h3;
verticalSize.value = v2;
} else {
let val;
if (isNumber(size2)) {
val = size2;
} else {
val = SIZE_MAP[size2 || "small"] || SIZE_MAP.small;
}
if ((wrap || fill) && dir === "horizontal") {
horizontalSize.value = verticalSize.value = val;
} else {
if (dir === "horizontal") {
horizontalSize.value = val;
verticalSize.value = 0;
} else {
verticalSize.value = val;
horizontalSize.value = 0;
}
}
}
});
return {
classes,
containerStyle,
itemStyle
};
}
// node_modules/element-plus/es/components/space/src/space.mjs
var spaceProps = buildProps({
/**
* @description Placement direction
*/
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
/**
* @description Classname
*/
class: {
type: definePropType([
String,
Object,
Array
]),
default: ""
},
/**
* @description Extra style rules
*/
style: {
type: definePropType([String, Array, Object]),
default: ""
},
/**
* @description Controls the alignment of items
*/
alignment: {
type: definePropType(String),
default: "center"
},
/**
* @description Prefix for space-items
*/
prefixCls: {
type: String
},
/**
* @description Spacer
*/
spacer: {
type: definePropType([Object, String, Number, Array]),
default: null,
validator: (val) => isVNode(val) || isNumber(val) || isString(val)
},
/**
* @description Auto wrapping
*/
wrap: Boolean,
/**
* @description Whether to fill the container
*/
fill: Boolean,
/**
* @description Ratio of fill
*/
fillRatio: {
type: Number,
default: 100
},
/**
* @description Spacing size
*/
size: {
type: [String, Array, Number],
values: componentSizes,
validator: (val) => {
return isNumber(val) || isArray(val) && val.length === 2 && val.every(isNumber);
}
}
});
var Space = defineComponent({
name: "ElSpace",
props: spaceProps,
setup(props2, { slots }) {
const { classes, containerStyle, itemStyle } = useSpace(props2);
function extractChildren(children, parentKey = "", extractedChildren = []) {
const { prefixCls } = props2;
children.forEach((child, loopKey) => {
if (isFragment(child)) {
if (isArray(child.children)) {
child.children.forEach((nested, key) => {
if (isFragment(nested) && isArray(nested.children)) {
extractChildren(
nested.children,
`${parentKey + key}-`,
extractedChildren
);
} else {
if (isVNode(nested) && (nested == null ? void 0 : nested.type) === Comment) {
extractedChildren.push(nested);
} else {
extractedChildren.push(
createVNode(
SpaceItem,
{
style: itemStyle.value,
prefixCls,
key: `nested-${parentKey + key}`
},
{
default: () => [nested]
},
PatchFlags.PROPS | PatchFlags.STYLE,
["style", "prefixCls"]
)
);
}
}
});
}
} else if (isValidElementNode(child)) {
extractedChildren.push(
createVNode(
SpaceItem,
{
style: itemStyle.value,
prefixCls,
key: `LoopKey${parentKey + loopKey}`
},
{
default: () => [child]
},
PatchFlags.PROPS | PatchFlags.STYLE,
["style", "prefixCls"]
)
);
}
});
return extractedChildren;
}
return () => {
var _a;
const { spacer, direction: direction2 } = props2;
const children = renderSlot(slots, "default", { key: 0 }, () => []);
if (((_a = children.children) != null ? _a : []).length === 0) return null;
if (isArray(children.children)) {
let extractedChildren = extractChildren(children.children);
if (spacer) {
const len = extractedChildren.length - 1;
extractedChildren = extractedChildren.reduce(
(acc, child, idx) => {
const children2 = [...acc, child];
if (idx !== len) {
children2.push(
createVNode(
"span",
// adding width 100% for vertical alignment,
// when the spacer inherit the width from the
// parent, this span's width was not set, so space
// might disappear
{
style: [
itemStyle.value,
direction2 === "vertical" ? "width: 100%" : null
],
key: idx
},
[
// if spacer is already a valid vnode, then append it to the current
// span element.
// otherwise, treat it as string.
isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)
],
PatchFlags.STYLE
)
);
}
return children2;
},
[]
);
}
return createVNode(
"div",
{
class: classes.value,
style: containerStyle.value
},
extractedChildren,
PatchFlags.STYLE | PatchFlags.CLASS
);
}
return children.children;
};
}
});
// node_modules/element-plus/es/components/space/index.mjs
var ElSpace = withInstall(Space);
// node_modules/element-plus/es/components/statistic/src/statistic.mjs
var statisticProps = buildProps({
/**
* @description Setting the decimal point
*/
decimalSeparator: {
type: String,
default: "."
},
/**
* @description Sets the thousandth identifier
*/
groupSeparator: {
type: String,
default: ","
},
/**
* @description numerical precision
*/
precision: {
type: Number,
default: 0
},
/**
* @description Custom numerical presentation
*/
formatter: Function,
/**
* @description Numerical content
*/
value: {
type: definePropType([Number, Object]),
default: 0
},
/**
* @description Sets the prefix of a number
*/
prefix: String,
/**
* @description Sets the suffix of a number
*/
suffix: String,
/**
* @description Numeric titles
*/
title: String,
/**
* @description Styles numeric values
*/
valueStyle: {
type: definePropType([String, Object, Array])
}
});
// node_modules/element-plus/es/components/statistic/src/statistic.vue2.mjs
var _sfc_main121 = defineComponent({
...{
name: "ElStatistic"
},
__name: "statistic",
props: statisticProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const ns = useNamespace("statistic");
const displayValue = computed(() => {
const { value, formatter: formatter2, precision, decimalSeparator, groupSeparator } = props2;
if (isFunction(formatter2)) return formatter2(value);
if (!isNumber(value) || Number.isNaN(value)) return value;
let [integer, decimal = ""] = String(value).split(".");
decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
return [integer, decimal].join(decimal ? decimalSeparator : "");
});
__expose({
/**
* @description current display value
*/
displayValue
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("head"))
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("content"))
},
[
_ctx.$slots.prefix || __props.prefix ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("prefix"))
},
[
renderSlot(_ctx.$slots, "prefix", {}, () => [
createBaseVNode(
"span",
null,
toDisplayString(__props.prefix),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("number")),
style: normalizeStyle(__props.valueStyle)
},
toDisplayString(displayValue.value),
7
/* TEXT, CLASS, STYLE */
),
_ctx.$slots.suffix || __props.suffix ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("suffix"))
},
[
renderSlot(_ctx.$slots, "suffix", {}, () => [
createBaseVNode(
"span",
null,
toDisplayString(__props.suffix),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/statistic/index.mjs
var ElStatistic = withInstall(_sfc_main121);
// node_modules/element-plus/es/components/countdown/src/countdown.mjs
var countdownProps = buildProps({
/**
* @description Formatting the countdown display
*/
format: {
type: String,
default: "HH:mm:ss"
},
/**
* @description Sets the prefix of a countdown
*/
prefix: String,
/**
* @description Sets the suffix of a countdown
*/
suffix: String,
/**
* @description countdown titles
*/
title: String,
/**
* @description target time
*/
value: {
type: definePropType([Number, Object]),
default: 0
},
/**
* @description Styles countdown values
*/
valueStyle: {
type: definePropType([String, Object, Array])
}
});
var countdownEmits = {
finish: () => true,
[CHANGE_EVENT]: (value) => isNumber(value)
};
// node_modules/element-plus/es/components/countdown/src/utils.mjs
var timeUnits2 = [
["Y", 1e3 * 60 * 60 * 24 * 365],
// years
["M", 1e3 * 60 * 60 * 24 * 30],
// months
["D", 1e3 * 60 * 60 * 24],
// days
["H", 1e3 * 60 * 60],
// hours
["m", 1e3 * 60],
// minutes
["s", 1e3],
// seconds
["S", 1]
// million seconds
];
var getTime = (value) => {
return isNumber(value) ? new Date(value).getTime() : value.valueOf();
};
var formatTime = (timestamp2, format) => {
let timeLeft = timestamp2;
const escapeRegex = /\[([^\]]*)]/g;
const replacedText = timeUnits2.reduce((current, [name, unit4]) => {
const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g");
if (replaceRegex.test(current)) {
const value = Math.floor(timeLeft / unit4);
timeLeft -= value * unit4;
return current.replace(
replaceRegex,
(match) => String(value).padStart(match.length, "0")
);
}
return current;
}, format);
return replacedText.replace(escapeRegex, "$1");
};
// node_modules/element-plus/es/components/countdown/src/countdown.vue2.mjs
var _sfc_main122 = defineComponent({
...{
name: "ElCountdown"
},
__name: "countdown",
props: countdownProps,
emits: countdownEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
let timer;
const rawValue = ref(0);
const displayValue = computed(() => formatTime(rawValue.value, props2.format));
const formatter2 = (val) => formatTime(val, props2.format);
const stopTimer = () => {
if (timer) {
cAF(timer);
timer = void 0;
}
};
const startTimer = () => {
const timestamp2 = getTime(props2.value);
const frameFunc = () => {
let diff = timestamp2 - Date.now();
emit(CHANGE_EVENT, diff);
if (diff <= 0) {
diff = 0;
stopTimer();
emit("finish");
} else {
timer = rAF(frameFunc);
}
rawValue.value = diff;
};
timer = rAF(frameFunc);
};
onMounted(() => {
rawValue.value = getTime(props2.value) - Date.now();
watch(
() => [props2.value, props2.format],
() => {
stopTimer();
startTimer();
},
{
immediate: true
}
);
});
onBeforeUnmount(() => {
stopTimer();
});
__expose({
/**
* @description current display value
*/
displayValue
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElStatistic), {
value: rawValue.value,
title: __props.title,
prefix: __props.prefix,
suffix: __props.suffix,
"value-style": __props.valueStyle,
formatter: formatter2
}, createSlots({
_: 2
/* DYNAMIC */
}, [
renderList(_ctx.$slots, (_2, name) => {
return {
name,
fn: withCtx(() => [
renderSlot(_ctx.$slots, name)
])
};
})
]), 1032, ["value", "title", "prefix", "suffix", "value-style"]);
};
}
});
// node_modules/element-plus/es/components/countdown/index.mjs
var ElCountdown = withInstall(_sfc_main122);
// node_modules/element-plus/es/components/steps/src/steps.mjs
var stepsProps = buildProps({
/**
* @description the spacing of each step, will be responsive if omitted. Supports percentage.
*/
space: {
type: [Number, String],
default: ""
},
/**
* @description current activation step
*/
active: {
type: Number,
default: 0
},
/**
* @description display direction
*/
direction: {
type: String,
default: "horizontal",
values: ["horizontal", "vertical"]
},
/**
* @description center title and description
*/
alignCenter: {
type: Boolean
},
/**
* @description whether to apply simple theme
*/
simple: {
type: Boolean
},
/**
* @description status of end step
*/
finishStatus: {
type: String,
values: ["wait", "process", "finish", "error", "success"],
default: "finish"
},
/**
* @description status of current step
*/
processStatus: {
type: String,
values: ["wait", "process", "finish", "error", "success"],
default: "process"
}
});
var stepsEmits = {
[CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber)
};
// node_modules/element-plus/es/components/steps/src/tokens.mjs
var STEPS_INJECTION_KEY = "ElSteps";
// node_modules/element-plus/es/components/steps/src/steps.vue2.mjs
var _sfc_main123 = defineComponent({
...{
name: "ElSteps"
},
__name: "steps",
props: stepsProps,
emits: stepsEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const ns = useNamespace("steps");
const {
children: steps,
addChild: addStep,
removeChild: removeStep,
ChildrenSorter: StepsSorter
} = useOrderedChildren(getCurrentInstance(), "ElStep");
watch(steps, () => {
steps.value.forEach((instance, index) => {
instance.setIndex(index);
});
});
provide(STEPS_INJECTION_KEY, { props: props2, steps, addStep, removeStep });
watch(
() => props2.active,
(newVal, oldVal) => {
emit(CHANGE_EVENT, newVal, oldVal);
}
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b(), unref(ns).m(__props.simple ? "simple" : __props.direction)])
},
[
renderSlot(_ctx.$slots, "default"),
createVNode(unref(StepsSorter))
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/steps/src/item.mjs
var stepProps = buildProps({
/**
* @description step title
*/
title: {
type: String,
default: ""
},
/**
* @description step custom icon. Icons can be passed via named slot as well
*/
icon: {
type: iconPropType
},
/**
* @description step description
*/
description: {
type: String,
default: ""
},
/**
* @description current status. It will be automatically set by Steps if not configured.
*/
status: {
type: String,
values: ["", "wait", "process", "finish", "error", "success"],
default: ""
}
});
// node_modules/element-plus/es/components/steps/src/item.vue2.mjs
var _sfc_main124 = defineComponent({
...{
name: "ElStep"
},
__name: "item",
props: stepProps,
setup(__props) {
const props2 = __props;
const ns = useNamespace("step");
const index = ref(-1);
const lineStyle = ref({});
const internalStatus = ref("");
const parent = inject(STEPS_INJECTION_KEY);
const currentInstance = getCurrentInstance();
let stepDiff = 0;
let beforeActive = 0;
onMounted(() => {
watch(
[
() => parent.props.active,
() => parent.props.processStatus,
() => parent.props.finishStatus
],
([active], [oldActive]) => {
beforeActive = oldActive || 0;
stepDiff = active - beforeActive;
updateStatus(active);
},
{ immediate: true }
);
});
const currentStatus = computed(() => {
return props2.status || internalStatus.value;
});
const prevInternalStatus = computed(() => {
const prevStep = parent.steps.value[index.value - 1];
return prevStep ? prevStep.internalStatus.value : "wait";
});
const isCenter = computed(() => {
return parent.props.alignCenter;
});
const isVertical = computed(() => {
return parent.props.direction === "vertical";
});
const isSimple = computed(() => {
return parent.props.simple;
});
const stepsCount = computed(() => {
return parent.steps.value.length;
});
const isLast = computed(() => {
var _a;
return ((_a = parent.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.uid) === currentInstance.uid;
});
const space = computed(() => {
return isSimple.value ? "" : parent.props.space;
});
const containerKls = computed(() => {
return [
ns.b(),
ns.is(isSimple.value ? "simple" : parent.props.direction),
ns.is("flex", isLast.value && !space.value && !isCenter.value),
ns.is("center", isCenter.value && !isVertical.value && !isSimple.value)
];
});
const style = computed(() => {
const style2 = {
flexBasis: isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%`
};
if (isVertical.value) return style2;
if (isLast.value) {
style2.maxWidth = `${100 / stepsCount.value}%`;
}
return style2;
});
const setIndex = (val) => {
index.value = val;
};
const calcProgress = (status) => {
const isWait = status === "wait";
const delayTimer = Math.abs(stepDiff) === 1 ? 0 : stepDiff > 0 ? (index.value + 1 - beforeActive) * 150 : -(index.value + 1 - parent.props.active) * 150;
const style2 = {
transitionDelay: `${delayTimer}ms`
};
const step2 = status === parent.props.processStatus || isWait ? 0 : 100;
style2.borderWidth = step2 && !isSimple.value ? "1px" : 0;
style2[parent.props.direction === "vertical" ? "height" : "width"] = `${step2}%`;
lineStyle.value = style2;
};
const updateStatus = (activeIndex) => {
if (activeIndex > index.value) {
internalStatus.value = parent.props.finishStatus;
} else if (activeIndex === index.value && prevInternalStatus.value !== "error") {
internalStatus.value = parent.props.processStatus;
} else {
internalStatus.value = "wait";
}
const prevChild = parent.steps.value[index.value - 1];
if (prevChild) prevChild.calcProgress(internalStatus.value);
};
const stepItemState = {
uid: currentInstance.uid,
getVnode: () => currentInstance.vnode,
currentStatus,
internalStatus,
setIndex,
calcProgress
};
parent.addStep(stepItemState);
onBeforeUnmount(() => {
parent.removeStep(stepItemState);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
style: normalizeStyle(style.value),
class: normalizeClass(containerKls.value)
},
[
createCommentVNode(" icon & line "),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("head"), unref(ns).is(currentStatus.value)])
},
[
!isSimple.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("line"))
},
[
createBaseVNode(
"i",
{
class: normalizeClass(unref(ns).e("line-inner")),
style: normalizeStyle(lineStyle.value)
},
null,
6
/* CLASS, STYLE */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("icon"), unref(ns).is(__props.icon || _ctx.$slots.icon ? "icon" : "text")])
},
[
renderSlot(_ctx.$slots, "icon", {}, () => [
__props.icon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("icon-inner"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : currentStatus.value === "success" ? (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
}, {
default: withCtx(() => [
createVNode(unref(check_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : currentStatus.value === "error" ? (openBlock(), createBlock(unref(ElIcon), {
key: 2,
class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
}, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : !isSimple.value ? (openBlock(), createElementBlock(
"div",
{
key: 3,
class: normalizeClass(unref(ns).e("icon-inner"))
},
toDisplayString(index.value + 1),
3
/* TEXT, CLASS */
)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)
],
2
/* CLASS */
),
createCommentVNode(" title & description "),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("main"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).e("title"), unref(ns).is(currentStatus.value)])
},
[
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(
toDisplayString(__props.title),
1
/* TEXT */
)
])
],
2
/* CLASS */
),
isSimple.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("arrow"))
},
null,
2
/* CLASS */
)) : (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([unref(ns).e("description"), unref(ns).is(currentStatus.value)])
},
[
renderSlot(_ctx.$slots, "description", {}, () => [
createTextVNode(
toDisplayString(__props.description),
1
/* TEXT */
)
])
],
2
/* CLASS */
))
],
2
/* CLASS */
)
],
6
/* CLASS, STYLE */
);
};
}
});
// node_modules/element-plus/es/components/steps/index.mjs
var ElSteps = withInstall(_sfc_main123, {
Step: _sfc_main124
});
var ElStep = withNoopInstall(_sfc_main124);
// node_modules/element-plus/es/utils/vue/validator.mjs
var isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
// node_modules/element-plus/es/components/switch/src/switch.mjs
var switchProps = buildProps({
/**
* @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type
*/
modelValue: {
type: [Boolean, String, Number],
default: false
},
/**
* @description whether Switch is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether Switch is in loading state
*/
loading: Boolean,
/**
* @description size of Switch
*/
size: {
type: String,
validator: isValidComponentSize
},
/**
* @description width of Switch
*/
width: {
type: [String, Number],
default: ""
},
/**
* @description whether icon or text is displayed inside dot, only the first character will be rendered for text
*/
inlinePrompt: Boolean,
/**
* @description component of the icon displayed in action when in `off` state
*/
inactiveActionIcon: {
type: iconPropType
},
/**
* @description component of the icon displayed in action when in `on` state
*/
activeActionIcon: {
type: iconPropType
},
/**
* @description component of the icon displayed when in `on` state, overrides `active-text`
*/
activeIcon: {
type: iconPropType
},
/**
* @description component of the icon displayed when in `off` state, overrides `inactive-text`
*/
inactiveIcon: {
type: iconPropType
},
/**
* @description text displayed when in `on` state
*/
activeText: {
type: String,
default: ""
},
/**
* @description text displayed when in `off` state
*/
inactiveText: {
type: String,
default: ""
},
/**
* @description switch value when in `on` state
*/
activeValue: {
type: [Boolean, String, Number],
default: true
},
/**
* @description switch value when in `off` state
*/
inactiveValue: {
type: [Boolean, String, Number],
default: false
},
/**
* @description input name of Switch
*/
name: {
type: String,
default: ""
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
},
/**
* @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching
*/
beforeChange: {
type: definePropType(Function)
},
/**
* @description id for input
*/
id: String,
/**
* @description tabindex for input
*/
tabindex: {
type: [String, Number]
},
...useAriaProps(["ariaLabel"])
});
var switchEmits = {
[UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
[CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
[INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
};
// node_modules/element-plus/es/components/switch/src/switch.vue2.mjs
var _hoisted_165 = ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex"];
var _hoisted_235 = ["aria-hidden"];
var _hoisted_315 = { key: 1 };
var _hoisted_410 = { key: 1 };
var _hoisted_59 = ["aria-hidden"];
var COMPONENT_NAME17 = "ElSwitch";
var _sfc_main125 = defineComponent({
...{
name: COMPONENT_NAME17
},
__name: "switch",
props: switchProps,
emits: switchEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { formItem } = useFormItem();
const switchSize = useFormSize();
const ns = useNamespace("switch");
const { inputId } = useFormItemInputId(props2, {
formItemContext: formItem
});
const switchDisabled = useFormDisabled(
computed(() => {
if (props2.loading) {
return true;
}
return void 0;
})
);
const isControlled = ref(props2.modelValue !== false);
const input = shallowRef();
const switchKls = computed(() => [
ns.b(),
ns.m(switchSize.value),
ns.is("disabled", switchDisabled.value),
ns.is("checked", checked.value)
]);
const labelLeftKls = computed(() => [
ns.e("label"),
ns.em("label", "left"),
ns.is("active", !checked.value)
]);
const labelRightKls = computed(() => [
ns.e("label"),
ns.em("label", "right"),
ns.is("active", checked.value)
]);
const coreStyle = computed(() => ({
width: addUnit(props2.width)
}));
watch(
() => props2.modelValue,
() => {
isControlled.value = true;
}
);
const actualValue = computed(() => {
return isControlled.value ? props2.modelValue : false;
});
const checked = computed(() => actualValue.value === props2.activeValue);
if (![props2.activeValue, props2.inactiveValue].includes(actualValue.value)) {
emit(UPDATE_MODEL_EVENT, props2.inactiveValue);
emit(CHANGE_EVENT, props2.inactiveValue);
emit(INPUT_EVENT, props2.inactiveValue);
}
watch(checked, (val) => {
var _a;
input.value.checked = val;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
}
});
const handleChange = () => {
const val = checked.value ? props2.inactiveValue : props2.activeValue;
emit(UPDATE_MODEL_EVENT, val);
emit(CHANGE_EVENT, val);
emit(INPUT_EVENT, val);
nextTick(() => {
input.value.checked = checked.value;
});
};
const switchValue = () => {
if (switchDisabled.value) return;
const { beforeChange } = props2;
if (!beforeChange) {
handleChange();
return;
}
const shouldChange = beforeChange();
const isPromiseOrBool = [
isPromise(shouldChange),
isBoolean(shouldChange)
].includes(true);
if (!isPromiseOrBool) {
throwError(
COMPONENT_NAME17,
"beforeChange must return type `Promise` or `boolean`"
);
}
if (isPromise(shouldChange)) {
shouldChange.then((result) => {
if (result) {
handleChange();
}
}).catch((e) => {
debugWarn(COMPONENT_NAME17, `some error occurred: ${e}`);
});
} else if (shouldChange) {
handleChange();
}
};
const focus = () => {
var _a, _b;
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
};
onMounted(() => {
input.value.checked = checked.value;
});
__expose({
/**
* @description manual focus to the switch component
**/
focus,
/**
* @description whether Switch is checked
*/
checked
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(switchKls.value),
onClick: withModifiers(switchValue, ["prevent"])
},
[
createBaseVNode("input", {
id: unref(inputId),
ref_key: "input",
ref: input,
class: normalizeClass(unref(ns).e("input")),
type: "checkbox",
role: "switch",
"aria-checked": checked.value,
"aria-disabled": unref(switchDisabled),
"aria-label": __props.ariaLabel,
name: __props.name,
"true-value": __props.activeValue,
"false-value": __props.inactiveValue,
disabled: unref(switchDisabled),
tabindex: __props.tabindex,
onChange: handleChange,
onKeydown: withKeys(switchValue, ["enter"])
}, null, 42, _hoisted_165),
!__props.inlinePrompt && (__props.inactiveIcon || __props.inactiveText || _ctx.$slots.inactive) ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(labelLeftKls.value)
},
[
renderSlot(_ctx.$slots, "inactive", {}, () => [
__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
!__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock("span", {
key: 1,
"aria-hidden": checked.value
}, toDisplayString(__props.inactiveText), 9, _hoisted_235)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("core")),
style: normalizeStyle(coreStyle.value)
},
[
__props.inlinePrompt ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("inner"))
},
[
!checked.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns).e("inner-wrapper"))
},
[
renderSlot(_ctx.$slots, "inactive", {}, () => [
__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
!__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock(
"span",
_hoisted_315,
toDisplayString(__props.inactiveText),
1
/* TEXT */
)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)) : (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("inner-wrapper"))
},
[
renderSlot(_ctx.$slots, "active", {}, () => [
__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
!__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock(
"span",
_hoisted_410,
toDisplayString(__props.activeText),
1
/* TEXT */
)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
))
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("action"))
},
[
__props.loading ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).is("loading"))
}, {
default: withCtx(() => [
createVNode(unref(loading_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : checked.value ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [
__props.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.activeActionIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true)
]) : !checked.value ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [
__props.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveActionIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true)
]) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
6
/* CLASS, STYLE */
),
!__props.inlinePrompt && (__props.activeIcon || __props.activeText || _ctx.$slots.active) ? (openBlock(), createElementBlock(
"span",
{
key: 1,
class: normalizeClass(labelRightKls.value)
},
[
renderSlot(_ctx.$slots, "active", {}, () => [
__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))
]),
_: 1
/* STABLE */
})) : createCommentVNode("v-if", true),
!__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock("span", {
key: 1,
"aria-hidden": !checked.value
}, toDisplayString(__props.activeText), 9, _hoisted_59)) : createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/switch/index.mjs
var ElSwitch = withInstall(_sfc_main125);
// node_modules/element-plus/es/components/table/src/util.mjs
var getCell = function(event) {
var _a;
return (_a = event.target) == null ? void 0 : _a.closest("td");
};
var orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
if (!sortKey && !sortMethod && (!sortBy || isArray(sortBy) && !sortBy.length)) {
return array;
}
if (isString(reverse)) {
reverse = reverse === "descending" ? -1 : 1;
} else {
reverse = reverse && reverse < 0 ? -1 : 1;
}
const getKey = sortMethod ? null : function(value, index) {
if (sortBy) {
return flatMap_default(castArray_default(sortBy), (by) => {
if (isString(by)) {
return get_default(value, by);
} else {
return by(value, index, array);
}
});
}
if (sortKey !== "$key") {
if (isObject(value) && "$value" in value) value = value.$value;
}
return [
isObject(value) ? sortKey ? get_default(value, sortKey) : null : value
];
};
const compare = function(a2, b2) {
var _a, _b, _c, _d, _e, _f;
if (sortMethod) {
return sortMethod(a2.value, b2.value);
}
for (let i = 0, len = (_b = (_a = a2.key) == null ? void 0 : _a.length) != null ? _b : 0; i < len; i++) {
if (((_c = a2.key) == null ? void 0 : _c[i]) < ((_d = b2.key) == null ? void 0 : _d[i])) {
return -1;
}
if (((_e = a2.key) == null ? void 0 : _e[i]) > ((_f = b2.key) == null ? void 0 : _f[i])) {
return 1;
}
}
return 0;
};
return array.map((value, index) => {
return {
value,
index,
key: getKey ? getKey(value, index) : null
};
}).sort((a2, b2) => {
let order = compare(a2, b2);
if (!order) {
order = a2.index - b2.index;
}
return order * +reverse;
}).map((item) => item.value);
};
var getColumnById = function(table, columnId) {
let column2 = null;
table.columns.forEach((item) => {
if (item.id === columnId) {
column2 = item;
}
});
return column2;
};
var getColumnByKey = function(table, columnKey) {
let column2 = null;
for (let i = 0; i < table.columns.length; i++) {
const item = table.columns[i];
if (item.columnKey === columnKey) {
column2 = item;
break;
}
}
if (!column2)
throwError("ElTable", `No column matching with column-key: ${columnKey}`);
return column2;
};
var getColumnByCell = function(table, cell, namespace) {
const matches = (cell.className || "").match(
new RegExp(`${namespace}-table_[^\\s]+`, "gm")
);
if (matches) {
return getColumnById(table, matches[0]);
}
return null;
};
var getRowIdentity = (row, rowKey2) => {
if (!row) throw new Error("Row is required when get row identity");
if (isString(rowKey2)) {
if (!rowKey2.includes(".")) {
return `${row[rowKey2]}`;
}
const key = rowKey2.split(".");
let current = row;
for (const element of key) {
current = current[element];
}
return `${current}`;
} else if (isFunction(rowKey2)) {
return rowKey2.call(null, row);
}
return "";
};
var getKeysMap = function(array, rowKey2, flatten = false, childrenKey = "children") {
const data = array || [];
const arrayMap = {};
data.forEach((row, index) => {
arrayMap[getRowIdentity(row, rowKey2)] = { row, index };
if (flatten) {
const children = row[childrenKey];
if (isArray(children)) {
Object.assign(arrayMap, getKeysMap(children, rowKey2, true, childrenKey));
}
}
});
return arrayMap;
};
function mergeOptions(defaults, config) {
const options = {};
let key;
for (key in defaults) {
options[key] = defaults[key];
}
for (key in config) {
if (hasOwn(config, key)) {
const value = config[key];
if (!isUndefined(value)) {
options[key] = value;
}
}
}
return options;
}
function parseWidth(width) {
if (width === "") return width;
if (!isUndefined(width)) {
width = Number.parseInt(width, 10);
if (Number.isNaN(width)) {
width = "";
}
}
return width;
}
function parseMinWidth(minWidth) {
if (minWidth === "") return minWidth;
if (!isUndefined(minWidth)) {
minWidth = parseWidth(minWidth);
if (Number.isNaN(minWidth)) {
minWidth = 80;
}
}
return minWidth;
}
function parseHeight(height) {
if (isNumber(height)) {
return height;
}
if (isString(height)) {
if (/^\d+(?:px)?$/.test(height)) {
return Number.parseInt(height, 10);
} else {
return height;
}
}
return null;
}
function compose(...funcs) {
if (funcs.length === 0) {
return (arg) => arg;
}
if (funcs.length === 1) {
return funcs[0];
}
return funcs.reduce(
(a2, b2) => (...args) => a2(b2(...args))
);
}
function toggleRowStatus(statusArr, row, newVal, tableTreeProps, selectable, rowIndex, rowKey2) {
let _rowIndex = rowIndex != null ? rowIndex : 0;
let changed = false;
const getIndex = () => {
if (!rowKey2) {
return statusArr.indexOf(row);
}
const id = getRowIdentity(row, rowKey2);
return statusArr.findIndex((item) => getRowIdentity(item, rowKey2) === id);
};
const index = getIndex();
const included = index !== -1;
const isRowSelectable = selectable == null ? void 0 : selectable.call(null, row, _rowIndex);
const toggleStatus = (type) => {
if (type === "add") {
statusArr.push(row);
} else {
statusArr.splice(index, 1);
}
changed = true;
};
const getChildrenCount = (row2) => {
let count = 0;
const children = (tableTreeProps == null ? void 0 : tableTreeProps.children) && row2[tableTreeProps.children];
if (children && isArray(children)) {
count += children.length;
children.forEach((item) => {
count += getChildrenCount(item);
});
}
return count;
};
if (!selectable || isRowSelectable) {
if (isBoolean(newVal)) {
if (newVal && !included) {
toggleStatus("add");
} else if (!newVal && included) {
toggleStatus("remove");
}
} else {
included ? toggleStatus("remove") : toggleStatus("add");
}
}
if (!(tableTreeProps == null ? void 0 : tableTreeProps.checkStrictly) && (tableTreeProps == null ? void 0 : tableTreeProps.children) && isArray(row[tableTreeProps.children])) {
row[tableTreeProps.children].forEach((item) => {
const childChanged = toggleRowStatus(
statusArr,
item,
newVal != null ? newVal : !included,
tableTreeProps,
selectable,
_rowIndex + 1,
rowKey2
);
_rowIndex += getChildrenCount(item) + 1;
if (childChanged) {
changed = childChanged;
}
});
}
return changed;
}
function walkTreeNode(root, cb, childrenKey = "children", lazyKey = "hasChildren", lazy = false) {
const isNil = (array) => !(isArray(array) && array.length);
function _walker(parent, children, level) {
cb(parent, children, level);
children.forEach((item) => {
if (item[lazyKey] && lazy) {
cb(item, null, level + 1);
return;
}
const children2 = item[childrenKey];
if (!isNil(children2)) {
_walker(item, children2, level + 1);
}
});
}
root.forEach((item) => {
if (item[lazyKey] && lazy) {
cb(item, null, 0);
return;
}
const children = item[childrenKey];
if (!isNil(children)) {
_walker(item, children, 0);
}
});
}
var getTableOverflowTooltipProps = (props2, innerText, row, column2) => {
const popperOptions = {
strategy: "fixed",
...props2.popperOptions
};
const tooltipFormatterContent = isFunction(column2 == null ? void 0 : column2.tooltipFormatter) ? column2.tooltipFormatter({
row,
column: column2,
cellValue: getProp(row, column2.property).value
}) : void 0;
if (isVNode(tooltipFormatterContent)) {
return {
slotContent: tooltipFormatterContent,
content: null,
...props2,
popperOptions
};
}
return {
slotContent: null,
content: tooltipFormatterContent != null ? tooltipFormatterContent : innerText,
...props2,
popperOptions
};
};
var removePopper = null;
function createTablePopper(props2, popperContent, row, column2, trigger, table) {
var _a;
const tableOverflowTooltipProps = getTableOverflowTooltipProps(
props2,
popperContent,
row,
column2
);
const mergedProps = {
...tableOverflowTooltipProps,
slotContent: void 0
};
if ((removePopper == null ? void 0 : removePopper.trigger) === trigger) {
const comp = (_a = removePopper.vm) == null ? void 0 : _a.component;
merge_default(comp == null ? void 0 : comp.props, mergedProps);
if (comp && tableOverflowTooltipProps.slotContent) {
comp.slots.content = () => [tableOverflowTooltipProps.slotContent];
}
return;
}
removePopper == null ? void 0 : removePopper();
const parentNode = table == null ? void 0 : table.refs.tableWrapper;
const ns = parentNode == null ? void 0 : parentNode.dataset.prefix;
const vm = createVNode(
ElTooltip,
{
virtualTriggering: true,
virtualRef: trigger,
appendTo: parentNode,
placement: "top",
transition: "none",
// Default does not require transition
offset: 0,
hideAfter: 0,
...mergedProps
},
tableOverflowTooltipProps.slotContent ? {
content: () => tableOverflowTooltipProps.slotContent
} : void 0
);
vm.appContext = { ...table.appContext, ...table };
const container = document.createElement("div");
render(vm, container);
vm.component.exposed.onOpen();
const scrollContainer = parentNode == null ? void 0 : parentNode.querySelector(`.${ns}-scrollbar__wrap`);
removePopper = () => {
var _a2, _b;
if ((_b = (_a2 = vm.component) == null ? void 0 : _a2.exposed) == null ? void 0 : _b.onClose) {
vm.component.exposed.onClose();
}
render(null, container);
const currentRemovePopper = removePopper;
scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", currentRemovePopper);
currentRemovePopper.trigger = void 0;
currentRemovePopper.vm = void 0;
removePopper = null;
};
removePopper.trigger = trigger != null ? trigger : void 0;
removePopper.vm = vm;
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", removePopper);
}
function getCurrentColumns(column2) {
if (column2.children) {
return flatMap_default(column2.children, getCurrentColumns);
} else {
return [column2];
}
}
function getColSpan(colSpan, column2) {
return colSpan + column2.colSpan;
}
var isFixedColumn = (index, fixed, store, realColumns) => {
let start = 0;
let after = index;
const columns2 = store.states.columns.value;
if (realColumns) {
const curColumns = getCurrentColumns(realColumns[index]);
const preColumns = columns2.slice(0, columns2.indexOf(curColumns[0]));
start = preColumns.reduce(getColSpan, 0);
after = start + curColumns.reduce(getColSpan, 0) - 1;
} else {
start = index;
}
let fixedLayout;
switch (fixed) {
case "left":
if (after < store.states.fixedLeafColumnsLength.value) {
fixedLayout = "left";
}
break;
case "right":
if (start >= columns2.length - store.states.rightFixedLeafColumnsLength.value) {
fixedLayout = "right";
}
break;
default:
if (after < store.states.fixedLeafColumnsLength.value) {
fixedLayout = "left";
} else if (start >= columns2.length - store.states.rightFixedLeafColumnsLength.value) {
fixedLayout = "right";
}
}
return fixedLayout ? {
direction: fixedLayout,
start,
after
} : {};
};
var getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset3 = 0) => {
const classes = [];
const { direction: direction2, start, after } = isFixedColumn(
index,
fixed,
store,
realColumns
);
if (direction2) {
const isLeft = direction2 === "left";
classes.push(`${namespace}-fixed-column--${direction2}`);
if (isLeft && after + offset3 === store.states.fixedLeafColumnsLength.value - 1) {
classes.push("is-last-column");
} else if (!isLeft && start - offset3 === store.states.columns.value.length - store.states.rightFixedLeafColumnsLength.value) {
classes.push("is-first-column");
}
}
return classes;
};
function getOffset(offset3, column2) {
return offset3 + (isNull_default(column2.realWidth) || Number.isNaN(column2.realWidth) ? Number(column2.width) : column2.realWidth);
}
var getFixedColumnOffset = (index, fixed, store, realColumns) => {
const {
direction: direction2,
start = 0,
after = 0
} = isFixedColumn(index, fixed, store, realColumns);
if (!direction2) {
return;
}
const styles = {};
const isLeft = direction2 === "left";
const columns2 = store.states.columns.value;
if (isLeft) {
styles.left = columns2.slice(0, start).reduce(getOffset, 0);
} else {
styles.right = columns2.slice(after + 1).reverse().reduce(getOffset, 0);
}
return styles;
};
var ensurePosition = (style, key) => {
if (!style) return;
if (!Number.isNaN(style[key])) {
style[key] = `${style[key]}px`;
}
};
function ensureValidVNode(vnodes) {
return vnodes.some((child) => {
if (!isVNode(child)) return true;
if (child.type === Comment) return false;
if (child.type === Fragment && !ensureValidVNode(child.children)) {
return false;
}
return true;
}) ? vnodes : null;
}
// node_modules/element-plus/es/components/table/src/store/expand.mjs
function useExpand(watcherData) {
const instance = getCurrentInstance();
const defaultExpandAll = ref(false);
const expandRows = ref([]);
const canRowExpand = (row, index) => {
var _a;
const expandableFn = instance.store.states.rowExpandable.value;
return (_a = expandableFn == null ? void 0 : expandableFn(row, index)) != null ? _a : true;
};
const updateExpandRows = () => {
const data = watcherData.data.value || [];
const rowKey2 = watcherData.rowKey.value;
if (defaultExpandAll.value) {
expandRows.value = instance.store.states.rowExpandable.value ? data.filter(canRowExpand) : data.slice();
} else if (rowKey2) {
const expandRowsMap = getKeysMap(expandRows.value, rowKey2);
expandRows.value = data.filter((row, index) => {
const rowId = getRowIdentity(row, rowKey2);
return !!expandRowsMap[rowId] && canRowExpand(row, index);
});
} else {
expandRows.value = [];
}
};
const toggleRowExpansion = (row, expanded) => {
const dataArr = watcherData.data.value || [];
const rowIndex = dataArr.indexOf(row);
if (rowIndex > -1 && !canRowExpand(row, rowIndex)) return;
const changed = toggleRowStatus(
expandRows.value,
row,
expanded,
void 0,
void 0,
void 0,
watcherData.rowKey.value
);
if (changed) {
instance.emit("expand-change", row, expandRows.value.slice());
}
};
const setExpandRowKeys = (rowKeys) => {
instance.store.assertRowKey();
const data = watcherData.data.value || [];
const rowKey2 = watcherData.rowKey.value;
const keysMap = getKeysMap(data, rowKey2);
expandRows.value = rowKeys.reduce((prev, cur) => {
const info = keysMap[cur];
if (info && canRowExpand(info.row, info.index)) {
prev.push(info.row);
}
return prev;
}, []);
};
const isRowExpanded = (row) => {
const rowKey2 = watcherData.rowKey.value;
if (rowKey2) {
const expandMap = getKeysMap(expandRows.value, rowKey2);
return !!expandMap[getRowIdentity(row, rowKey2)];
}
return expandRows.value.includes(row);
};
return {
updateExpandRows,
toggleRowExpansion,
setExpandRowKeys,
isRowExpanded,
states: {
expandRows,
defaultExpandAll
}
};
}
// node_modules/element-plus/es/components/table/src/store/current.mjs
function useCurrent(watcherData) {
const instance = getCurrentInstance();
const _currentRowKey = ref(null);
const currentRow = ref(null);
const setCurrentRowKey = (key) => {
instance.store.assertRowKey();
_currentRowKey.value = key;
setCurrentRowByKey(key);
};
const restoreCurrentRowKey = () => {
_currentRowKey.value = null;
};
const setCurrentRowByKey = (key) => {
var _a;
const { data, rowKey: rowKey2 } = watcherData;
const oldCurrentRow = currentRow.value;
let _currentRow = null;
if (rowKey2.value) {
_currentRow = (_a = (unref(data) || []).find(
(item) => getRowIdentity(item, rowKey2.value) === key
)) != null ? _a : null;
}
currentRow.value = _currentRow != null ? _currentRow : null;
instance.emit("current-change", currentRow.value, oldCurrentRow);
};
const updateCurrentRow = (_currentRow) => {
const oldCurrentRow = currentRow.value;
if (_currentRow && _currentRow !== oldCurrentRow) {
currentRow.value = _currentRow;
instance.emit("current-change", currentRow.value, oldCurrentRow);
return;
}
if (!_currentRow && oldCurrentRow) {
currentRow.value = null;
instance.emit("current-change", null, oldCurrentRow);
}
};
const updateCurrentRowData = () => {
const rowKey2 = watcherData.rowKey.value;
const data = watcherData.data.value || [];
const oldCurrentRow = currentRow.value;
if (oldCurrentRow && !data.includes(oldCurrentRow)) {
if (rowKey2) {
const currentRowKey = getRowIdentity(oldCurrentRow, rowKey2);
setCurrentRowByKey(currentRowKey);
} else {
currentRow.value = null;
instance.emit("current-change", null, oldCurrentRow);
}
} else if (_currentRowKey.value) {
setCurrentRowByKey(_currentRowKey.value);
restoreCurrentRowKey();
}
};
return {
setCurrentRowKey,
restoreCurrentRowKey,
setCurrentRowByKey,
updateCurrentRow,
updateCurrentRowData,
states: {
_currentRowKey,
currentRow
}
};
}
// node_modules/element-plus/es/components/table/src/store/tree.mjs
function useTree(watcherData) {
const expandRowKeys = ref([]);
const treeData = ref({});
const indent = ref(16);
const lazy = ref(false);
const lazyTreeNodeMap = ref({});
const lazyColumnIdentifier = ref("hasChildren");
const childrenColumnName = ref("children");
const checkStrictly = ref(false);
const instance = getCurrentInstance();
const normalizedData = computed(() => {
if (!watcherData.rowKey.value) return {};
const data = watcherData.data.value || [];
return normalize(data);
});
const normalizedLazyNode = computed(() => {
const rowKey2 = watcherData.rowKey.value;
const keys2 = Object.keys(lazyTreeNodeMap.value);
const res = {};
if (!keys2.length) return res;
keys2.forEach((key) => {
if (lazyTreeNodeMap.value[key].length) {
const item = { children: [] };
lazyTreeNodeMap.value[key].forEach((row) => {
const currentRowKey = getRowIdentity(row, rowKey2);
item.children.push(currentRowKey);
if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {
res[currentRowKey] = { children: [] };
}
});
res[key] = item;
}
});
return res;
});
const normalize = (data) => {
const rowKey2 = watcherData.rowKey.value;
const res = {};
walkTreeNode(
data,
(parent, children, level) => {
const parentId = getRowIdentity(parent, rowKey2);
if (isArray(children)) {
res[parentId] = {
children: children.map((row) => getRowIdentity(row, rowKey2)),
level
};
} else if (lazy.value) {
res[parentId] = {
children: [],
lazy: true,
level
};
}
},
childrenColumnName.value,
lazyColumnIdentifier.value,
lazy.value
);
return res;
};
const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll) => {
var _a, _b;
ifExpandAll || (ifExpandAll = (_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value);
const nested = normalizedData.value;
const normalizedLazyNode_ = normalizedLazyNode.value;
const keys2 = Object.keys(nested);
const newTreeData = {};
if (keys2.length) {
const oldTreeData = unref(treeData);
const rootLazyRowKeys = [];
const getExpanded = (oldValue, key) => {
if (ifChangeExpandRowKeys) {
if (expandRowKeys.value) {
return ifExpandAll || expandRowKeys.value.includes(key);
} else {
return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded));
}
} else {
const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key);
return !!((oldValue == null ? void 0 : oldValue.expanded) || included);
}
};
keys2.forEach((key) => {
const oldValue = oldTreeData[key];
const newValue = { ...nested[key] };
newValue.expanded = getExpanded(oldValue, key);
if (newValue.lazy) {
const { loaded = false, loading = false } = oldValue || {};
newValue.loaded = !!loaded;
newValue.loading = !!loading;
rootLazyRowKeys.push(key);
}
newTreeData[key] = newValue;
});
const lazyKeys = Object.keys(normalizedLazyNode_);
if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {
lazyKeys.forEach((key) => {
var _a2;
const oldValue = oldTreeData[key];
const lazyNodeChildren = normalizedLazyNode_[key].children;
if (rootLazyRowKeys.includes(key)) {
if (((_a2 = newTreeData[key].children) == null ? void 0 : _a2.length) !== 0) {
throw new Error("[ElTable]children must be an empty array.");
}
newTreeData[key].children = lazyNodeChildren;
} else {
const { loaded = false, loading = false } = oldValue || {};
newTreeData[key] = {
lazy: true,
loaded: !!loaded,
loading: !!loading,
expanded: getExpanded(oldValue, key),
children: lazyNodeChildren,
level: void 0
};
}
});
}
}
treeData.value = newTreeData;
(_b = instance.store) == null ? void 0 : _b.updateTableScrollY();
};
watch(
() => expandRowKeys.value,
() => {
updateTreeData(true);
}
);
watch(
() => normalizedData.value,
() => {
updateTreeData();
}
);
watch(
() => normalizedLazyNode.value,
() => {
updateTreeData();
}
);
const updateTreeExpandKeys = (value) => {
expandRowKeys.value = value;
updateTreeData();
};
const isUseLazy = (data) => {
return lazy.value && data && "loaded" in data && !data.loaded;
};
const toggleTreeExpansion = (row, expanded) => {
instance.store.assertRowKey();
const rowKey2 = watcherData.rowKey.value;
const id = getRowIdentity(row, rowKey2);
const data = id && treeData.value[id];
if (id && data && "expanded" in data) {
const oldExpanded = data.expanded;
expanded = isUndefined(expanded) ? !data.expanded : expanded;
treeData.value[id].expanded = expanded;
if (oldExpanded !== expanded) {
instance.emit("expand-change", row, expanded);
}
expanded && isUseLazy(data) && loadData(row, id, data);
instance.store.updateTableScrollY();
}
};
const loadOrToggle = (row) => {
instance.store.assertRowKey();
const rowKey2 = watcherData.rowKey.value;
const id = getRowIdentity(row, rowKey2);
const data = treeData.value[id];
if (isUseLazy(data)) {
loadData(row, id, data);
} else {
toggleTreeExpansion(row, void 0);
}
};
const loadData = (row, key, treeNode) => {
const { load } = instance.props;
if (load && !treeData.value[key].loaded) {
treeData.value[key].loading = true;
load(row, treeNode, (data) => {
if (!isArray(data)) {
throw new TypeError("[ElTable] data must be an array");
}
treeData.value[key].loading = false;
treeData.value[key].loaded = true;
treeData.value[key].expanded = true;
if (data.length) {
lazyTreeNodeMap.value[key] = data;
}
instance.emit("expand-change", row, true);
});
}
};
const updateKeyChildren = (key, data) => {
const { lazy: lazy2, rowKey: rowKey2 } = instance.props;
if (!lazy2) return;
if (!rowKey2) throw new Error("[Table] rowKey is required in updateKeyChild");
if (lazyTreeNodeMap.value[key]) {
lazyTreeNodeMap.value[key] = data;
}
};
return {
loadData,
loadOrToggle,
toggleTreeExpansion,
updateTreeExpandKeys,
updateTreeData,
updateKeyChildren,
normalize,
states: {
expandRowKeys,
treeData,
indent,
lazy,
lazyTreeNodeMap,
lazyColumnIdentifier,
childrenColumnName,
checkStrictly
}
};
}
// node_modules/element-plus/es/components/table/src/store/watcher.mjs
var sortData = (data, states) => {
const sortingColumn = states.sortingColumn;
if (!sortingColumn || isString(sortingColumn.sortable)) {
return data;
}
return orderBy(
data,
states.sortProp,
states.sortOrder,
sortingColumn.sortMethod,
sortingColumn.sortBy
);
};
var doFlattenColumns = (columns2) => {
const result = [];
columns2.forEach((column2) => {
if (column2.children && column2.children.length > 0) {
result.push.apply(result, doFlattenColumns(column2.children));
} else {
result.push(column2);
}
});
return result;
};
function useWatcher() {
var _a;
const instance = getCurrentInstance();
const { size: tableSize } = toRefs((_a = instance.proxy) == null ? void 0 : _a.$props);
const rowKey2 = ref(null);
const data = ref([]);
const _data = ref([]);
const isComplex = ref(false);
const _columns = ref([]);
const originColumns = ref([]);
const columns2 = ref([]);
const fixedColumns = ref([]);
const rightFixedColumns = ref([]);
const leafColumns = ref([]);
const fixedLeafColumns = ref([]);
const rightFixedLeafColumns = ref([]);
const updateOrderFns = [];
const leafColumnsLength = ref(0);
const fixedLeafColumnsLength = ref(0);
const rightFixedLeafColumnsLength = ref(0);
const isAllSelected = ref(false);
const selection = ref([]);
const reserveSelection = ref(false);
const selectOnIndeterminate = ref(false);
const selectable = ref(null);
const rowExpandable = ref(null);
const filters = ref({});
const filteredData = ref(null);
const sortingColumn = ref(null);
const sortProp = ref(null);
const sortOrder = ref(null);
const hoverRow = ref(null);
const selectedMap = computed(() => {
return rowKey2.value ? getKeysMap(selection.value, rowKey2.value) : void 0;
});
watch(
data,
() => {
var _a2;
if (instance.state) {
scheduleLayout(false);
const needUpdateFixed = instance.props.tableLayout === "auto";
if (needUpdateFixed) {
(_a2 = instance.refs.tableHeaderRef) == null ? void 0 : _a2.updateFixedColumnStyle();
}
}
},
{
deep: true
}
);
const assertRowKey = () => {
if (!rowKey2.value) throw new Error("[ElTable] prop row-key is required");
};
const updateChildFixed = (column2) => {
var _a2;
(_a2 = column2.children) == null ? void 0 : _a2.forEach((childColumn) => {
childColumn.fixed = column2.fixed;
updateChildFixed(childColumn);
});
};
const updateColumns = () => {
_columns.value.forEach((column2) => {
updateChildFixed(column2);
});
fixedColumns.value = _columns.value.filter(
(column2) => [true, "left"].includes(column2.fixed)
);
const selectColumn = _columns.value.find(
(column2) => column2.type === "selection"
);
let selectColFixLeft;
if (selectColumn && selectColumn.fixed !== "right" && !fixedColumns.value.includes(selectColumn)) {
const selectColumnIndex = _columns.value.indexOf(selectColumn);
if (selectColumnIndex === 0 && fixedColumns.value.length) {
fixedColumns.value.unshift(selectColumn);
selectColFixLeft = true;
}
}
rightFixedColumns.value = _columns.value.filter(
(column2) => column2.fixed === "right"
);
const notFixedColumns = _columns.value.filter(
(column2) => (selectColFixLeft ? column2.type !== "selection" : true) && !column2.fixed
);
originColumns.value = Array.from(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value);
const leafColumns2 = doFlattenColumns(notFixedColumns);
const fixedLeafColumns2 = doFlattenColumns(fixedColumns.value);
const rightFixedLeafColumns2 = doFlattenColumns(rightFixedColumns.value);
leafColumnsLength.value = leafColumns2.length;
fixedLeafColumnsLength.value = fixedLeafColumns2.length;
rightFixedLeafColumnsLength.value = rightFixedLeafColumns2.length;
columns2.value = Array.from(fixedLeafColumns2).concat(leafColumns2).concat(rightFixedLeafColumns2);
isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0;
};
const scheduleLayout = (needUpdateColumns, immediate = false) => {
if (needUpdateColumns) {
updateColumns();
}
if (immediate) {
instance.state.doLayout();
} else {
instance.state.debouncedUpdateLayout();
}
};
const isSelected = (row) => {
if (selectedMap.value) {
return !!selectedMap.value[getRowIdentity(row, rowKey2.value)];
} else {
return selection.value.includes(row);
}
};
const clearSelection = () => {
isAllSelected.value = false;
const oldSelection = selection.value;
selection.value = [];
if (oldSelection.length) {
instance.emit("selection-change", []);
}
};
const cleanSelection = () => {
var _a2, _b;
let deleted;
if (rowKey2.value) {
deleted = [];
const childrenKey = (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.childrenColumnName.value;
const dataMap = getKeysMap(data.value, rowKey2.value, true, childrenKey);
for (const key in selectedMap.value) {
if (hasOwn(selectedMap.value, key) && !dataMap[key]) {
deleted.push(selectedMap.value[key].row);
}
}
} else {
deleted = selection.value.filter((item) => !data.value.includes(item));
}
if (deleted.length) {
const newSelection = selection.value.filter(
(item) => !deleted.includes(item)
);
selection.value = newSelection;
instance.emit("selection-change", newSelection.slice());
}
};
const getSelectionRows = () => {
return (selection.value || []).slice();
};
const toggleRowSelection = (row, selected, emitChange = true, ignoreSelectable = false) => {
var _a2, _b, _c, _d;
const treeProps3 = {
children: (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.childrenColumnName.value,
checkStrictly: (_d = (_c = instance == null ? void 0 : instance.store) == null ? void 0 : _c.states) == null ? void 0 : _d.checkStrictly.value
};
const changed = toggleRowStatus(
selection.value,
row,
selected,
treeProps3,
ignoreSelectable ? void 0 : selectable.value,
data.value.indexOf(row),
rowKey2.value
);
if (changed) {
const newSelection = (selection.value || []).slice();
if (emitChange) {
instance.emit("select", newSelection, row);
}
instance.emit("selection-change", newSelection);
}
};
const _toggleAllSelection = () => {
var _a2, _b;
const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length);
isAllSelected.value = value;
let selectionChanged = false;
let childrenCount = 0;
const rowKey22 = (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.rowKey.value;
const { childrenColumnName } = instance.store.states;
const treeProps3 = {
children: childrenColumnName.value,
checkStrictly: false
// Disable checkStrictly when selecting all
};
data.value.forEach((row, index) => {
const rowIndex = index + childrenCount;
if (toggleRowStatus(
selection.value,
row,
value,
treeProps3,
selectable.value,
rowIndex,
rowKey22
)) {
selectionChanged = true;
}
childrenCount += getChildrenCount(getRowIdentity(row, rowKey22));
});
if (selectionChanged) {
instance.emit(
"selection-change",
selection.value ? selection.value.slice() : []
);
}
instance.emit("select-all", (selection.value || []).slice());
};
const updateAllSelected = () => {
var _a2;
if (((_a2 = data.value) == null ? void 0 : _a2.length) === 0) {
isAllSelected.value = false;
return;
}
const { childrenColumnName } = instance.store.states;
let rowIndex = 0;
let selectedCount = 0;
const checkSelectedStatus = (data2) => {
var _a3;
for (const row of data2) {
const isRowSelectable = selectable.value && selectable.value.call(null, row, rowIndex);
if (!isSelected(row)) {
if (!selectable.value || isRowSelectable) {
return false;
}
} else {
selectedCount++;
}
rowIndex++;
if (((_a3 = row[childrenColumnName.value]) == null ? void 0 : _a3.length) && !checkSelectedStatus(row[childrenColumnName.value])) {
return false;
}
}
return true;
};
const isAllSelected_ = checkSelectedStatus(data.value || []);
isAllSelected.value = selectedCount === 0 ? false : isAllSelected_;
};
const getChildrenCount = (rowKey22) => {
var _a2;
if (!instance || !instance.store) return 0;
const { treeData } = instance.store.states;
let count = 0;
const children = (_a2 = treeData.value[rowKey22]) == null ? void 0 : _a2.children;
if (children) {
count += children.length;
children.forEach((childKey) => {
count += getChildrenCount(childKey);
});
}
return count;
};
const updateFilters = (column2, values) => {
const filters_ = {};
castArray_default(column2).forEach((col) => {
filters.value[col.id] = values;
filters_[col.columnKey || col.id] = values;
});
return filters_;
};
const updateSort = (column2, prop, order) => {
if (sortingColumn.value && sortingColumn.value !== column2) {
sortingColumn.value.order = null;
}
sortingColumn.value = column2;
sortProp.value = prop;
sortOrder.value = order;
};
const execFilter = () => {
let sourceData = unref(_data);
Object.keys(filters.value).forEach((columnId) => {
const values = filters.value[columnId];
if (!values || values.length === 0) return;
const column2 = getColumnById(
{
columns: columns2.value
},
columnId
);
if (column2 && column2.filterMethod) {
sourceData = sourceData.filter((row) => {
return values.some(
(value) => column2.filterMethod.call(null, value, row, column2)
);
});
}
});
filteredData.value = sourceData;
};
const execSort = () => {
var _a2;
data.value = sortData((_a2 = filteredData.value) != null ? _a2 : [], {
sortingColumn: sortingColumn.value,
sortProp: sortProp.value,
sortOrder: sortOrder.value
});
};
const execQuery = (ignore = void 0) => {
if (!(ignore == null ? void 0 : ignore.filter)) {
execFilter();
}
execSort();
};
const clearFilter = (columnKeys) => {
const { tableHeaderRef } = instance.refs;
if (!tableHeaderRef) return;
const panels = Object.assign({}, tableHeaderRef.filterPanels);
const keys2 = Object.keys(panels);
if (!keys2.length) return;
if (isString(columnKeys)) {
columnKeys = [columnKeys];
}
if (isArray(columnKeys)) {
const columns_ = columnKeys.map(
(key) => getColumnByKey(
{
columns: columns2.value
},
key
)
);
keys2.forEach((key) => {
const column2 = columns_.find((col) => col.id === key);
if (column2) {
column2.filteredValue = [];
}
});
instance.store.commit("filterChange", {
column: columns_,
values: [],
silent: true,
multi: true
});
} else {
keys2.forEach((key) => {
const column2 = columns2.value.find((col) => col.id === key);
if (column2) {
column2.filteredValue = [];
}
});
filters.value = {};
instance.store.commit("filterChange", {
column: {},
values: [],
silent: true
});
}
};
const clearSort = () => {
if (!sortingColumn.value) return;
updateSort(null, null, null);
instance.store.commit("changeSortCondition", {
silent: true
});
};
const {
setExpandRowKeys,
toggleRowExpansion,
updateExpandRows,
states: expandStates,
isRowExpanded
} = useExpand({
data,
rowKey: rowKey2
});
const {
updateTreeExpandKeys,
toggleTreeExpansion,
updateTreeData,
updateKeyChildren,
loadOrToggle,
states: treeStates
} = useTree({
data,
rowKey: rowKey2
});
const {
updateCurrentRowData,
updateCurrentRow,
setCurrentRowKey,
states: currentData
} = useCurrent({
data,
rowKey: rowKey2
});
const setExpandRowKeysAdapter = (val) => {
setExpandRowKeys(val);
updateTreeExpandKeys(val);
};
const toggleRowExpansionAdapter = (row, expanded) => {
const hasExpandColumn = columns2.value.some(({ type }) => type === "expand");
if (hasExpandColumn) {
toggleRowExpansion(row, expanded);
} else {
toggleTreeExpansion(row, expanded);
}
};
return {
assertRowKey,
updateColumns,
scheduleLayout,
isSelected,
clearSelection,
cleanSelection,
getSelectionRows,
toggleRowSelection,
_toggleAllSelection,
toggleAllSelection: null,
updateAllSelected,
updateFilters,
updateCurrentRow,
updateSort,
execFilter,
execSort,
execQuery,
clearFilter,
clearSort,
toggleRowExpansion,
setExpandRowKeysAdapter,
setCurrentRowKey,
toggleRowExpansionAdapter,
isRowExpanded,
updateExpandRows,
updateCurrentRowData,
loadOrToggle,
updateTreeData,
updateKeyChildren,
states: {
tableSize,
rowKey: rowKey2,
data,
_data,
isComplex,
_columns,
originColumns,
columns: columns2,
fixedColumns,
rightFixedColumns,
leafColumns,
fixedLeafColumns,
rightFixedLeafColumns,
updateOrderFns,
leafColumnsLength,
fixedLeafColumnsLength,
rightFixedLeafColumnsLength,
isAllSelected,
selection,
reserveSelection,
selectOnIndeterminate,
selectable,
rowExpandable,
filters,
filteredData,
sortingColumn,
sortProp,
sortOrder,
hoverRow,
...expandStates,
...treeStates,
...currentData
}
};
}
// node_modules/element-plus/es/components/table/src/store/index.mjs
function replaceColumn(array, column2) {
return array.map((item) => {
var _a;
if (item.id === column2.id) {
return column2;
} else if ((_a = item.children) == null ? void 0 : _a.length) {
item.children = replaceColumn(item.children, column2);
}
return item;
});
}
function sortColumn(array) {
array.forEach((item) => {
var _a, _b;
item.no = (_a = item.getColumnIndex) == null ? void 0 : _a.call(item);
if ((_b = item.children) == null ? void 0 : _b.length) {
sortColumn(item.children);
}
});
array.sort((cur, pre) => cur.no - pre.no);
}
function useStore() {
const instance = getCurrentInstance();
const watcher = useWatcher();
const ns = useNamespace("table");
const { t } = useLocale();
const mutations = {
setData(states, data) {
const dataInstanceChanged = unref(states._data) !== data;
states.data.value = data;
states._data.value = data;
instance.store.execQuery();
instance.store.updateCurrentRowData();
instance.store.updateExpandRows();
instance.store.updateTreeData(
instance.store.states.defaultExpandAll.value
);
if (unref(states.reserveSelection)) {
instance.store.assertRowKey();
} else {
if (dataInstanceChanged) {
instance.store.clearSelection();
} else {
instance.store.cleanSelection();
}
}
instance.store.updateAllSelected();
if (instance.$ready) {
instance.store.scheduleLayout();
}
},
insertColumn(states, column2, parent, updateColumnOrder) {
var _a;
const array = unref(states._columns);
let newColumns = [];
if (!parent) {
array.push(column2);
newColumns = array;
} else {
if (parent && !parent.children) {
parent.children = [];
}
(_a = parent.children) == null ? void 0 : _a.push(column2);
newColumns = replaceColumn(array, parent);
}
sortColumn(newColumns);
states._columns.value = newColumns;
states.updateOrderFns.push(updateColumnOrder);
if (column2.type === "selection") {
states.selectable.value = column2.selectable;
states.reserveSelection.value = column2.reserveSelection;
}
if (instance.$ready) {
instance.store.updateColumns();
instance.store.scheduleLayout();
}
},
updateColumnOrder(states, column2) {
var _a;
const newColumnIndex = (_a = column2.getColumnIndex) == null ? void 0 : _a.call(column2);
if (newColumnIndex === column2.no) return;
sortColumn(states._columns.value);
if (instance.$ready) {
instance.store.updateColumns();
}
},
removeColumn(states, column2, parent, updateColumnOrder) {
var _a;
const array = unref(states._columns) || [];
if (parent) {
(_a = parent.children) == null ? void 0 : _a.splice(
parent.children.findIndex((item) => item.id === column2.id),
1
);
nextTick(() => {
var _a2;
if (((_a2 = parent.children) == null ? void 0 : _a2.length) === 0) {
delete parent.children;
}
});
states._columns.value = replaceColumn(array, parent);
} else {
const index = array.indexOf(column2);
if (index > -1) {
array.splice(index, 1);
states._columns.value = array;
}
}
const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder);
updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1);
if (instance.$ready) {
instance.store.updateColumns();
instance.store.scheduleLayout();
}
},
sort(states, options) {
const { prop, order, init } = options;
if (prop) {
const column2 = unref(states.columns).find(
(column22) => column22.property === prop
);
if (column2) {
column2.order = order;
instance.store.updateSort(column2, prop, order);
instance.store.commit("changeSortCondition", { init });
}
}
},
changeSortCondition(states, options) {
const { sortingColumn, sortProp, sortOrder } = states;
const columnValue = unref(sortingColumn), propValue = unref(sortProp), orderValue = unref(sortOrder);
if (isNull_default(orderValue)) {
states.sortingColumn.value = null;
states.sortProp.value = null;
}
const ignore = { filter: true };
instance.store.execQuery(ignore);
if (!options || !(options.silent || options.init)) {
instance.emit("sort-change", {
column: columnValue,
prop: propValue,
order: orderValue
});
}
instance.store.updateTableScrollY();
},
filterChange(_states, options) {
const { column: column2, values, silent } = options;
const newFilters = instance.store.updateFilters(column2, values);
instance.store.execQuery();
if (!silent) {
instance.emit("filter-change", newFilters);
}
instance.store.updateTableScrollY();
},
toggleAllSelection() {
var _a, _b;
(_b = (_a = instance.store).toggleAllSelection) == null ? void 0 : _b.call(_a);
},
rowSelectedChanged(_states, row) {
instance.store.toggleRowSelection(row);
instance.store.updateAllSelected();
},
setHoverRow(states, row) {
states.hoverRow.value = row;
},
setCurrentRow(_states, row) {
instance.store.updateCurrentRow(row);
}
};
const commit = function(name, ...args) {
const mutations2 = instance.store.mutations;
if (mutations2[name]) {
mutations2[name].apply(instance, [
instance.store.states,
...args
]);
} else {
throw new Error(`Action not found: ${name}`);
}
};
const updateTableScrollY = function() {
nextTick(() => instance.layout.updateScrollY.apply(instance.layout));
};
return {
ns,
t,
...watcher,
mutations,
commit,
updateTableScrollY
};
}
// node_modules/element-plus/es/components/table/src/store/helper.mjs
var InitialStateMap = {
rowKey: "rowKey",
defaultExpandAll: "defaultExpandAll",
rowExpandable: "rowExpandable",
selectOnIndeterminate: "selectOnIndeterminate",
indent: "indent",
lazy: "lazy",
["treeProps.hasChildren"]: {
key: "lazyColumnIdentifier",
default: "hasChildren"
},
["treeProps.children"]: {
key: "childrenColumnName",
default: "children"
},
["treeProps.checkStrictly"]: {
key: "checkStrictly",
default: false
}
};
function createStore(table, props2) {
if (!table) {
throw new Error("Table is required.");
}
const store = useStore();
store.toggleAllSelection = debounce_default(store._toggleAllSelection, 10);
Object.keys(InitialStateMap).forEach((key) => {
handleValue(getArrKeysValue(props2, key), key, store);
});
proxyTableProps(store, props2);
return store;
}
function proxyTableProps(store, props2) {
Object.keys(InitialStateMap).forEach((key) => {
watch(
() => getArrKeysValue(props2, key),
(value) => {
handleValue(value, key, store);
}
);
});
}
function handleValue(value, propsKey, store) {
let newVal = value;
let storeKey = InitialStateMap[propsKey];
if (isObject(storeKey)) {
newVal = newVal || storeKey.default;
storeKey = storeKey.key;
}
store.states[storeKey].value = newVal;
}
function getArrKeysValue(props2, key) {
if (key.includes(".")) {
const keyList = key.split(".");
let value = props2;
keyList.forEach((k) => {
value = value[k];
});
return value;
} else {
return props2[key];
}
}
// node_modules/element-plus/es/components/table/src/table-layout.mjs
var __defProp6 = Object.defineProperty;
var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField6 = (obj, key, value) => __defNormalProp6(obj, typeof key !== "symbol" ? key + "" : key, value);
var TableLayout = class {
constructor(options) {
__publicField6(this, "observers");
__publicField6(this, "table");
__publicField6(this, "store");
__publicField6(this, "columns");
__publicField6(this, "fit");
__publicField6(this, "showHeader");
__publicField6(this, "height");
__publicField6(this, "scrollX");
__publicField6(this, "scrollY");
__publicField6(this, "bodyWidth");
__publicField6(this, "fixedWidth");
__publicField6(this, "rightFixedWidth");
__publicField6(this, "tableHeight");
__publicField6(this, "headerHeight");
__publicField6(this, "appendHeight");
__publicField6(this, "footerHeight");
__publicField6(this, "gutterWidth");
this.observers = [];
this.table = null;
this.store = null;
this.columns = [];
this.fit = true;
this.showHeader = true;
this.height = ref(null);
this.scrollX = ref(false);
this.scrollY = ref(false);
this.bodyWidth = ref(null);
this.fixedWidth = ref(null);
this.rightFixedWidth = ref(null);
this.gutterWidth = 0;
for (const name in options) {
if (hasOwn(options, name)) {
if (isRef(this[name])) {
this[name].value = options[name];
} else {
this[name] = options[name];
}
}
}
if (!this.table) {
throw new Error("Table is required for Table Layout");
}
if (!this.store) {
throw new Error("Store is required for Table Layout");
}
}
updateScrollY() {
const height = this.height.value;
if (isNull_default(height)) return false;
const scrollBarRef = this.table.refs.scrollBarRef;
if (this.table.vnode.el && (scrollBarRef == null ? void 0 : scrollBarRef.wrapRef)) {
let scrollY = true;
const prevScrollY = this.scrollY.value;
scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight;
this.scrollY.value = scrollY;
return prevScrollY !== scrollY;
}
return false;
}
setHeight(value, prop = "height") {
if (!isClient) return;
const el = this.table.vnode.el;
value = parseHeight(value);
this.height.value = Number(value);
if (!el && (value || value === 0)) {
nextTick(() => this.setHeight(value, prop));
return;
}
if (el && isNumber(value)) {
el.style[prop] = `${value}px`;
this.updateElsHeight();
} else if (el && isString(value)) {
el.style[prop] = value;
this.updateElsHeight();
}
}
setMaxHeight(value) {
this.setHeight(value, "max-height");
}
getFlattenColumns() {
const flattenColumns = [];
const columns2 = this.table.store.states.columns.value;
columns2.forEach((column2) => {
if (column2.isColumnGroup) {
flattenColumns.push.apply(flattenColumns, column2.columns);
} else {
flattenColumns.push(column2);
}
});
return flattenColumns;
}
updateElsHeight() {
this.updateScrollY();
this.notifyObservers("scrollable");
}
headerDisplayNone(elm) {
if (!elm) return true;
let headerChild = elm;
while (headerChild.tagName !== "DIV") {
if (getComputedStyle(headerChild).display === "none") {
return true;
}
headerChild = headerChild.parentElement;
}
return false;
}
updateColumnsWidth() {
var _a;
if (!isClient) return;
const fit = this.fit;
const bodyWidth = (_a = this.table.vnode.el) == null ? void 0 : _a.clientWidth;
let bodyMinWidth = 0;
const flattenColumns = this.getFlattenColumns();
const flexColumns = flattenColumns.filter(
(column2) => !isNumber(column2.width)
);
flattenColumns.forEach((column2) => {
if (isNumber(column2.width) && column2.realWidth) column2.realWidth = null;
});
if (flexColumns.length > 0 && fit) {
flattenColumns.forEach((column2) => {
bodyMinWidth += Number(column2.width || column2.minWidth || 80);
});
if (bodyMinWidth <= bodyWidth) {
this.scrollX.value = false;
const totalFlexWidth = bodyWidth - bodyMinWidth;
if (flexColumns.length === 1) {
flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth;
} else {
const allColumnsWidth = flexColumns.reduce(
(prev, column2) => prev + Number(column2.minWidth || 80),
0
);
const flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
let noneFirstWidth = 0;
flexColumns.forEach((column2, index) => {
if (index === 0) return;
const flexWidth = Math.floor(
Number(column2.minWidth || 80) * flexWidthPerPixel
);
noneFirstWidth += flexWidth;
column2.realWidth = Number(column2.minWidth || 80) + flexWidth;
});
flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
}
} else {
this.scrollX.value = true;
flexColumns.forEach((column2) => {
column2.realWidth = Number(column2.minWidth);
});
}
this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth);
this.table.state.resizeState.value.width = this.bodyWidth.value;
} else {
flattenColumns.forEach((column2) => {
if (!column2.width && !column2.minWidth) {
column2.realWidth = 80;
} else {
column2.realWidth = Number(column2.width || column2.minWidth);
}
bodyMinWidth += column2.realWidth;
});
this.scrollX.value = bodyMinWidth > bodyWidth;
this.bodyWidth.value = bodyMinWidth;
}
const fixedColumns = this.store.states.fixedColumns.value;
if (fixedColumns.length > 0) {
let fixedWidth = 0;
fixedColumns.forEach((column2) => {
fixedWidth += Number(column2.realWidth || column2.width);
});
this.fixedWidth.value = fixedWidth;
}
const rightFixedColumns = this.store.states.rightFixedColumns.value;
if (rightFixedColumns.length > 0) {
let rightFixedWidth = 0;
rightFixedColumns.forEach((column2) => {
rightFixedWidth += Number(column2.realWidth || column2.width);
});
this.rightFixedWidth.value = rightFixedWidth;
}
this.notifyObservers("columns");
}
addObserver(observer) {
this.observers.push(observer);
}
removeObserver(observer) {
const index = this.observers.indexOf(observer);
if (index !== -1) {
this.observers.splice(index, 1);
}
}
notifyObservers(event) {
const observers = this.observers;
observers.forEach((observer) => {
var _a, _b;
switch (event) {
case "columns":
(_a = observer.state) == null ? void 0 : _a.onColumnsChange(this);
break;
case "scrollable":
(_b = observer.state) == null ? void 0 : _b.onScrollableChange(this);
break;
default:
throw new Error(`Table Layout don't have event ${event}.`);
}
});
}
};
// node_modules/element-plus/es/components/table/src/filter-panel.vue2.mjs
var _sfc_main126 = defineComponent({
name: "ElTableFilterPanel",
components: {
ElCheckbox,
ElCheckboxGroup,
ElScrollbar,
ElTooltip,
ElIcon,
ArrowDown: arrow_down_default,
ArrowUp: arrow_up_default
},
props: {
placement: {
type: String,
default: "bottom-start"
},
store: {
type: Object
},
column: {
type: Object
},
upDataColumn: {
type: Function
},
appendTo: useTooltipContentProps.appendTo
},
setup(props2) {
const instance = getCurrentInstance();
const { t } = useLocale();
const ns = useNamespace("table-filter");
const parent = instance == null ? void 0 : instance.parent;
if (props2.column && !parent.filterPanels.value[props2.column.id]) {
parent.filterPanels.value[props2.column.id] = instance;
}
const tooltipRef = ref(null);
const rootRef = ref(null);
const checkedIndex = ref(0);
const filters = computed(() => {
return props2.column && props2.column.filters;
});
const filterClassName = computed(() => {
if (props2.column && props2.column.filterClassName) {
return `${ns.b()} ${props2.column.filterClassName}`;
}
return ns.b();
});
const filterValue = computed({
get: () => {
var _a;
return (((_a = props2.column) == null ? void 0 : _a.filteredValue) || [])[0];
},
set: (value) => {
if (filteredValue.value) {
if (!isPropAbsent(value)) {
filteredValue.value.splice(0, 1, value);
} else {
filteredValue.value.splice(0, 1);
}
}
}
});
const filteredValue = computed({
get() {
if (props2.column) {
return props2.column.filteredValue || [];
}
return [];
},
set(value) {
var _a;
if (props2.column) {
(_a = props2.upDataColumn) == null ? void 0 : _a.call(props2, "filteredValue", value);
}
}
});
const multiple = computed(() => {
if (props2.column) {
return props2.column.filterMultiple;
}
return true;
});
const isActive = (filter) => {
return filter.value === filterValue.value;
};
const hidden = () => {
var _a;
(_a = tooltipRef.value) == null ? void 0 : _a.onClose();
};
const handleConfirm = () => {
confirmFilter(filteredValue.value);
hidden();
};
const handleReset = () => {
filteredValue.value = [];
confirmFilter(filteredValue.value);
hidden();
};
const handleSelect = (_filterValue, index) => {
filterValue.value = _filterValue;
checkedIndex.value = index;
if (!isPropAbsent(_filterValue)) {
confirmFilter(filteredValue.value);
} else {
confirmFilter([]);
}
hidden();
};
const confirmFilter = (filteredValue2) => {
var _a, _b;
(_a = props2.store) == null ? void 0 : _a.commit("filterChange", {
column: props2.column,
values: filteredValue2
});
(_b = props2.store) == null ? void 0 : _b.updateAllSelected();
};
const handleShowTooltip = () => {
var _a, _b;
(_a = rootRef.value) == null ? void 0 : _a.focus();
!multiple.value && initCheckedIndex();
if (props2.column) {
(_b = props2.upDataColumn) == null ? void 0 : _b.call(props2, "filterOpened", true);
}
};
const handleHideTooltip = () => {
var _a;
if (props2.column) {
(_a = props2.upDataColumn) == null ? void 0 : _a.call(props2, "filterOpened", false);
}
};
const initCheckedIndex = () => {
if (isPropAbsent(filterValue)) {
checkedIndex.value = 0;
return;
}
const idx = (filters.value || []).findIndex((item) => {
return item.value === filterValue.value;
});
checkedIndex.value = idx >= 0 ? idx + 1 : 0;
};
const handleKeydown = (event) => {
var _a, _b;
const code = getEventCode(event);
const len = (filters.value ? filters.value.length : 0) + 1;
let index = checkedIndex.value;
let isPreventDefault = true;
switch (code) {
case EVENT_CODE.down:
case EVENT_CODE.right:
index = (index + 1) % len;
break;
case EVENT_CODE.up:
case EVENT_CODE.left:
index = (index - 1 + len) % len;
break;
case EVENT_CODE.tab:
hidden();
isPreventDefault = false;
break;
case EVENT_CODE.enter:
case EVENT_CODE.space:
if (index === 0) {
handleSelect(null, 0);
} else {
const item = (filters.value || [])[index - 1];
item.value && handleSelect(item.value, index);
}
break;
default:
isPreventDefault = false;
break;
}
isPreventDefault && event.preventDefault();
checkedIndex.value = index;
(_b = (_a = rootRef.value) == null ? void 0 : _a.querySelector(
`.${ns.e("list-item")}:nth-child(${index + 1})`
)) == null ? void 0 : _b.focus();
};
return {
multiple,
filterClassName,
filteredValue,
filterValue,
filters,
handleConfirm,
handleReset,
handleSelect,
isPropAbsent,
isActive,
t,
ns,
tooltipRef,
rootRef,
checkedIndex,
handleShowTooltip,
handleHideTooltip,
handleKeydown
};
}
});
// node_modules/element-plus/es/components/table/src/filter-panel.vue.mjs
var _hoisted_166 = ["disabled"];
var _hoisted_236 = ["tabindex", "aria-checked"];
var _hoisted_316 = ["tabindex", "aria-checked", "onClick"];
var _hoisted_411 = ["aria-label"];
function _sfc_render18(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_checkbox = resolveComponent("el-checkbox");
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
const _component_el_scrollbar = resolveComponent("el-scrollbar");
const _component_arrow_up = resolveComponent("arrow-up");
const _component_arrow_down = resolveComponent("arrow-down");
const _component_el_icon = resolveComponent("el-icon");
const _component_el_tooltip = resolveComponent("el-tooltip");
return openBlock(), createBlock(_component_el_tooltip, {
ref: "tooltipRef",
offset: 0,
placement: _ctx.placement,
"show-arrow": false,
trigger: "click",
role: "dialog",
teleported: "",
effect: "light",
pure: "",
loop: "",
"popper-class": _ctx.filterClassName,
persistent: "",
"append-to": _ctx.appendTo,
onShow: _ctx.handleShowTooltip,
onHide: _ctx.handleHideTooltip
}, {
content: withCtx(() => [
_ctx.multiple ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "rootRef",
tabindex: "-1",
class: normalizeClass(_ctx.ns.e("multiple"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.ns.e("content"))
},
[
createVNode(_component_el_scrollbar, {
"wrap-class": _ctx.ns.e("wrap")
}, {
default: withCtx(() => [
createVNode(_component_el_checkbox_group, {
modelValue: _ctx.filteredValue,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event),
class: normalizeClass(_ctx.ns.e("checkbox-group"))
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.filters, (filter) => {
return openBlock(), createBlock(_component_el_checkbox, {
key: filter.value,
value: filter.value
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(filter.text),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["value"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["modelValue", "class"])
]),
_: 1
/* STABLE */
}, 8, ["wrap-class"])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.ns.e("bottom"))
},
[
createBaseVNode("button", {
class: normalizeClass(_ctx.ns.is("disabled", _ctx.filteredValue.length === 0)),
disabled: _ctx.filteredValue.length === 0,
type: "button",
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args))
}, toDisplayString(_ctx.t("el.table.confirmFilter")), 11, _hoisted_166),
createBaseVNode(
"button",
{
type: "button",
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args))
},
toDisplayString(_ctx.t("el.table.resetFilter")),
1
/* TEXT */
)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : (openBlock(), createElementBlock(
"ul",
{
key: 1,
ref: "rootRef",
tabindex: "-1",
role: "radiogroup",
class: normalizeClass(_ctx.ns.e("list")),
onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
},
[
createBaseVNode("li", {
role: "radio",
class: normalizeClass([
_ctx.ns.e("list-item"),
_ctx.ns.is("active", _ctx.isPropAbsent(_ctx.filterValue))
]),
tabindex: _ctx.checkedIndex === 0 ? 0 : -1,
"aria-checked": _ctx.isPropAbsent(_ctx.filterValue),
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null, 0))
}, toDisplayString(_ctx.t("el.table.clearFilter")), 11, _hoisted_236),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.filters, (filter, idx) => {
return openBlock(), createElementBlock("li", {
key: filter.value,
role: "radio",
class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]),
tabindex: _ctx.checkedIndex === idx + 1 ? 0 : -1,
"aria-checked": _ctx.isActive(filter),
onClick: ($event) => _ctx.handleSelect(filter.value, idx + 1)
}, toDisplayString(filter.text), 11, _hoisted_316);
}),
128
/* KEYED_FRAGMENT */
))
],
34
/* CLASS, NEED_HYDRATION */
))
]),
default: withCtx(() => {
var _a;
return [
createBaseVNode("button", {
type: "button",
class: normalizeClass(`${_ctx.ns.namespace.value}-table__column-filter-trigger`),
"aria-label": _ctx.t("el.table.filterLabel", { column: ((_a = _ctx.column) == null ? void 0 : _a.label) || "" })
}, [
createVNode(_component_el_icon, null, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "filter-icon", {}, () => {
var _a2;
return [
((_a2 = _ctx.column) == null ? void 0 : _a2.filterOpened) ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_arrow_down, { key: 1 }))
];
})
]),
_: 3
/* FORWARDED */
})
], 10, _hoisted_411)
];
}),
_: 3
/* FORWARDED */
}, 8, ["placement", "popper-class", "append-to", "onShow", "onHide"]);
}
var FilterPanel = _export_sfc(_sfc_main126, [["render", _sfc_render18]]);
// node_modules/element-plus/es/components/table/src/layout-observer.mjs
function useLayoutObserver(root) {
const instance = getCurrentInstance();
onBeforeMount(() => {
tableLayout.value.addObserver(instance);
});
onMounted(() => {
onColumnsChange(tableLayout.value);
onScrollableChange(tableLayout.value);
});
onUpdated(() => {
onColumnsChange(tableLayout.value);
onScrollableChange(tableLayout.value);
});
onUnmounted(() => {
tableLayout.value.removeObserver(instance);
});
const tableLayout = computed(() => {
const layout2 = root.layout;
if (!layout2) {
throw new Error("Can not find table layout.");
}
return layout2;
});
const onColumnsChange = (layout2) => {
var _a;
const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col")) || [];
if (!cols.length) return;
const flattenColumns = layout2.getFlattenColumns();
const columnsMap = {};
flattenColumns.forEach((column2) => {
columnsMap[column2.id] = column2;
});
for (let i = 0, j = cols.length; i < j; i++) {
const col = cols[i];
const name = col.getAttribute("name");
const column2 = columnsMap[name];
if (column2) {
col.setAttribute("width", column2.realWidth || column2.width);
}
}
};
const onScrollableChange = (layout2) => {
var _a, _b;
const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col[name=gutter]")) || [];
for (let i = 0, j = cols.length; i < j; i++) {
const col = cols[i];
col.setAttribute("width", layout2.scrollY.value ? layout2.gutterWidth : "0");
}
const ths = ((_b = root.vnode.el) == null ? void 0 : _b.querySelectorAll("th.gutter")) || [];
for (let i = 0, j = ths.length; i < j; i++) {
const th = ths[i];
th.style.width = layout2.scrollY.value ? `${layout2.gutterWidth}px` : "0";
th.style.display = layout2.scrollY.value ? "" : "none";
}
};
return {
tableLayout: tableLayout.value,
onColumnsChange,
onScrollableChange
};
}
// node_modules/element-plus/es/components/table/src/tokens.mjs
var TABLE_INJECTION_KEY = /* @__PURE__ */ Symbol("ElTable");
// node_modules/element-plus/es/components/table/src/table-header/event-helper.mjs
function useEvent(props2, emit) {
const instance = getCurrentInstance();
const parent = inject(TABLE_INJECTION_KEY);
const handleFilterClick = (event) => {
event.stopPropagation();
return;
};
const handleHeaderClick = (event, column2) => {
if (!column2.filters && column2.sortable) {
handleSortClick(event, column2, false);
} else if (column2.filterable && !column2.sortable) {
handleFilterClick(event);
}
parent == null ? void 0 : parent.emit("header-click", column2, event);
};
const handleHeaderContextMenu = (event, column2) => {
parent == null ? void 0 : parent.emit("header-contextmenu", column2, event);
};
const draggingColumn = ref(null);
const dragging = ref(false);
const dragState = ref();
const handleMouseDown = (event, column2) => {
var _a, _b;
if (!isClient) return;
if (column2.children && column2.children.length > 0) return;
if (draggingColumn.value && props2.border && draggingColumn.value.id === column2.id) {
dragging.value = true;
const table = parent;
emit("set-drag-visible", true);
const tableEl = table == null ? void 0 : table.vnode.el;
const tableLeft = tableEl == null ? void 0 : tableEl.getBoundingClientRect().left;
const columnEl = (_b = (_a = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a.el) == null ? void 0 : _b.querySelector(`th.${column2.id}`);
const columnRect = columnEl.getBoundingClientRect();
const minLeft = columnRect.left - tableLeft + 30;
addClass(columnEl, "noclick");
dragState.value = {
startMouseLeft: event.clientX,
startLeft: columnRect.right - tableLeft,
startColumnLeft: columnRect.left - tableLeft,
tableLeft
};
const resizeProxy = table == null ? void 0 : table.refs.resizeProxy;
resizeProxy.style.left = `${dragState.value.startLeft}px`;
document.onselectstart = function() {
return false;
};
document.ondragstart = function() {
return false;
};
const handleMouseMove2 = (event2) => {
const deltaLeft = event2.clientX - dragState.value.startMouseLeft;
const proxyLeft = dragState.value.startLeft + deltaLeft;
resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`;
};
const handleMouseUp = () => {
if (dragging.value) {
const { startColumnLeft, startLeft } = dragState.value;
const finalLeft = Number.parseInt(resizeProxy.style.left, 10);
const columnWidth = finalLeft - startColumnLeft;
column2.width = column2.realWidth = columnWidth;
table == null ? void 0 : table.emit(
"header-dragend",
column2.width,
startLeft - startColumnLeft,
column2,
event
);
requestAnimationFrame(() => {
props2.store.scheduleLayout(false, true);
});
document.body.style.cursor = "";
dragging.value = false;
draggingColumn.value = null;
dragState.value = void 0;
emit("set-drag-visible", false);
}
document.removeEventListener("mousemove", handleMouseMove2);
document.removeEventListener("mouseup", handleMouseUp);
document.onselectstart = null;
document.ondragstart = null;
setTimeout(() => {
removeClass(columnEl, "noclick");
}, 0);
};
document.addEventListener("mousemove", handleMouseMove2);
document.addEventListener("mouseup", handleMouseUp);
}
};
const handleMouseMove = (event, column2) => {
var _a;
if (!props2.border || column2.children && column2.children.length > 0) return;
const el = event.target;
const target2 = isElement(el) ? el.closest("th") : null;
if (!target2) {
return;
}
const isSortable = hasClass(target2, "is-sortable");
if (isSortable) {
const cursor2 = dragging.value ? "col-resize" : "";
target2.style.cursor = cursor2;
const caret = target2.querySelector(".caret-wrapper");
if (caret) {
caret.style.cursor = cursor2;
}
}
if (!column2.resizable || dragging.value) {
draggingColumn.value = null;
return;
}
const rect = target2.getBoundingClientRect();
const isLastTh = ((_a = target2.parentNode) == null ? void 0 : _a.lastElementChild) === target2;
const allowDrag = props2.allowDragLastColumn || !isLastTh;
const isResizeHandleActive = rect.width > 12 && rect.right - event.clientX < 8 && allowDrag;
const cursor = isResizeHandleActive ? "col-resize" : "";
document.body.style.cursor = cursor;
draggingColumn.value = isResizeHandleActive ? column2 : null;
if (isSortable) {
target2.style.cursor = cursor;
}
};
const handleMouseOut = () => {
if (!isClient || dragging.value) return;
document.body.style.cursor = "";
};
const toggleOrder = ({ order, sortOrders }) => {
if (order === "") return sortOrders[0];
const index = sortOrders.indexOf(order || null);
return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
};
const handleSortClick = (event, column2, givenOrder) => {
var _a;
event.stopPropagation();
const order = column2.order === givenOrder ? null : givenOrder || toggleOrder(column2);
const target2 = (_a = event.target) == null ? void 0 : _a.closest("th");
if (target2) {
if (hasClass(target2, "noclick")) {
removeClass(target2, "noclick");
return;
}
}
if (!column2.sortable) return;
const clickTarget = event.currentTarget;
if (["ascending", "descending"].some(
(str) => hasClass(clickTarget, str) && !column2.sortOrders.includes(str)
)) {
return;
}
const states = props2.store.states;
let sortProp = states.sortProp.value;
let sortOrder;
const sortingColumn = states.sortingColumn.value;
if (sortingColumn !== column2 || sortingColumn === column2 && isNull_default(sortingColumn.order)) {
if (sortingColumn) {
sortingColumn.order = null;
}
states.sortingColumn.value = column2;
sortProp = column2.property;
}
if (!order) {
sortOrder = column2.order = null;
} else {
sortOrder = column2.order = order;
}
states.sortProp.value = sortProp;
states.sortOrder.value = sortOrder;
parent == null ? void 0 : parent.store.commit("changeSortCondition");
};
return {
handleHeaderClick,
handleHeaderContextMenu,
handleMouseDown,
handleMouseMove,
handleMouseOut,
handleSortClick,
handleFilterClick
};
}
// node_modules/element-plus/es/components/table/src/table-header/style.helper.mjs
function useStyle(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const getHeaderRowStyle = (rowIndex) => {
const headerRowStyle = parent == null ? void 0 : parent.props.headerRowStyle;
if (isFunction(headerRowStyle)) {
return headerRowStyle.call(null, { rowIndex });
}
return headerRowStyle;
};
const getHeaderRowClass = (rowIndex) => {
const classes = [];
const headerRowClassName = parent == null ? void 0 : parent.props.headerRowClassName;
if (isString(headerRowClassName)) {
classes.push(headerRowClassName);
} else if (isFunction(headerRowClassName)) {
classes.push(headerRowClassName.call(null, { rowIndex }));
}
return classes.join(" ");
};
const getHeaderCellStyle = (rowIndex, columnIndex, row, column2) => {
var _a;
let headerCellStyles = (_a = parent == null ? void 0 : parent.props.headerCellStyle) != null ? _a : {};
if (isFunction(headerCellStyles)) {
headerCellStyles = headerCellStyles.call(null, {
rowIndex,
columnIndex,
row,
column: column2
});
}
const fixedStyle = getFixedColumnOffset(
columnIndex,
column2.fixed,
props2.store,
row
);
ensurePosition(fixedStyle, "left");
ensurePosition(fixedStyle, "right");
return Object.assign({}, headerCellStyles, fixedStyle);
};
const getHeaderCellClass = (rowIndex, columnIndex, row, column2) => {
const fixedClasses = getFixedColumnsClass(
ns.b(),
columnIndex,
column2.fixed,
props2.store,
row
);
const classes = [
column2.id,
column2.order,
column2.headerAlign,
column2.className,
column2.labelClassName,
...fixedClasses
];
if (!column2.children) {
classes.push("is-leaf");
}
if (column2.sortable) {
classes.push("is-sortable");
}
const headerCellClassName = parent == null ? void 0 : parent.props.headerCellClassName;
if (isString(headerCellClassName)) {
classes.push(headerCellClassName);
} else if (isFunction(headerCellClassName)) {
classes.push(
headerCellClassName.call(null, {
rowIndex,
columnIndex,
row,
column: column2
})
);
}
classes.push(ns.e("cell"));
return classes.filter((className) => Boolean(className)).join(" ");
};
return {
getHeaderRowStyle,
getHeaderRowClass,
getHeaderCellStyle,
getHeaderCellClass
};
}
// node_modules/element-plus/es/components/table/src/table-header/utils-helper.mjs
var getAllColumns = (columns2) => {
const result = [];
columns2.forEach((column2) => {
if (column2.children) {
result.push(column2);
result.push.apply(result, getAllColumns(column2.children));
} else {
result.push(column2);
}
});
return result;
};
var convertToRows = (originColumns) => {
let maxLevel = 1;
const traverse = (column2, parent) => {
if (parent) {
column2.level = parent.level + 1;
if (maxLevel < column2.level) {
maxLevel = column2.level;
}
}
if (column2.children) {
let colSpan = 0;
column2.children.forEach((subColumn) => {
traverse(subColumn, column2);
colSpan += subColumn.colSpan;
});
column2.colSpan = colSpan;
} else {
column2.colSpan = 1;
}
};
originColumns.forEach((column2) => {
column2.level = 1;
traverse(column2, void 0);
});
const rows = [];
for (let i = 0; i < maxLevel; i++) {
rows.push([]);
}
const allColumns = getAllColumns(originColumns);
allColumns.forEach((column2) => {
if (!column2.children) {
column2.rowSpan = maxLevel - column2.level + 1;
} else {
column2.rowSpan = 1;
column2.children.forEach((col) => col.isSubColumn = true);
}
rows[column2.level - 1].push(column2);
});
return rows;
};
function useUtils(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const columnRows = computed(() => {
return convertToRows(props2.store.states.originColumns.value);
});
const isGroup = computed(() => {
const result = columnRows.value.length > 1;
if (result && parent) {
parent.state.isGroup.value = true;
}
return result;
});
const toggleAllSelection = (event) => {
event.stopPropagation();
parent == null ? void 0 : parent.store.commit("toggleAllSelection");
};
return {
isGroup,
toggleAllSelection,
columnRows
};
}
// node_modules/element-plus/es/components/table/src/table-header/index.mjs
var TableHeader = defineComponent({
name: "ElTableHeader",
components: {
ElCheckbox
},
props: {
fixed: {
type: String,
default: ""
},
store: {
required: true,
type: Object
},
border: Boolean,
defaultSort: {
type: Object,
default: () => {
return {
prop: "",
order: ""
};
}
},
appendFilterPanelTo: {
type: String
},
allowDragLastColumn: {
type: Boolean
}
},
setup(props2, { emit }) {
const instance = getCurrentInstance();
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const filterPanels = ref({});
const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
const isTableLayoutAuto = (parent == null ? void 0 : parent.props.tableLayout) === "auto";
const saveIndexSelection = reactive(/* @__PURE__ */ new Map());
const theadRef = ref();
let delayId;
const updateFixedColumnStyle = () => {
delayId = setTimeout(() => {
if (saveIndexSelection.size > 0) {
saveIndexSelection.forEach((column2, key) => {
const el = theadRef.value.querySelector(
`.${key.replace(/\s/g, ".")}`
);
if (el) {
const width = el.getBoundingClientRect().width;
column2.width = width || column2.width;
}
});
saveIndexSelection.clear();
}
});
};
watch(saveIndexSelection, updateFixedColumnStyle);
onBeforeUnmount(() => {
if (delayId) {
clearTimeout(delayId);
delayId = void 0;
}
});
onMounted(async () => {
await nextTick();
await nextTick();
const { prop, order } = props2.defaultSort;
parent == null ? void 0 : parent.store.commit("sort", { prop, order, init: true });
updateFixedColumnStyle();
});
const {
handleHeaderClick,
handleHeaderContextMenu,
handleMouseDown,
handleMouseMove,
handleMouseOut,
handleSortClick,
handleFilterClick
} = useEvent(props2, emit);
const {
getHeaderRowStyle,
getHeaderRowClass,
getHeaderCellStyle,
getHeaderCellClass
} = useStyle(props2);
const { isGroup, toggleAllSelection, columnRows } = useUtils(
props2
);
const { t } = useLocale();
instance.state = {
onColumnsChange,
onScrollableChange
};
instance.filterPanels = filterPanels;
return {
ns,
t,
filterPanels,
onColumnsChange,
onScrollableChange,
columnRows,
getHeaderRowClass,
getHeaderRowStyle,
getHeaderCellClass,
getHeaderCellStyle,
handleHeaderClick,
handleHeaderContextMenu,
handleMouseDown,
handleMouseMove,
handleMouseOut,
handleSortClick,
handleFilterClick,
isGroup,
toggleAllSelection,
saveIndexSelection,
isTableLayoutAuto,
theadRef,
updateFixedColumnStyle
};
},
render() {
const {
ns,
t,
isGroup,
columnRows,
getHeaderCellStyle,
getHeaderCellClass,
getHeaderRowClass,
getHeaderRowStyle,
handleHeaderClick,
handleHeaderContextMenu,
handleMouseDown,
handleMouseMove,
handleSortClick,
handleMouseOut,
store,
$parent,
saveIndexSelection,
isTableLayoutAuto
} = this;
let rowSpan = 1;
return h(
"thead",
{
ref: "theadRef",
class: ns.is("group", isGroup)
},
columnRows.map(
(subColumns, rowIndex) => h(
"tr",
{
class: getHeaderRowClass(rowIndex),
key: rowIndex,
style: getHeaderRowStyle(rowIndex)
},
subColumns.map((column2, cellIndex) => {
if (column2.rowSpan > rowSpan) {
rowSpan = column2.rowSpan;
}
const _class = getHeaderCellClass(
rowIndex,
cellIndex,
subColumns,
column2
);
if (isTableLayoutAuto && column2.fixed) {
saveIndexSelection.set(_class, column2);
}
return h(
"th",
{
class: _class,
colspan: column2.colSpan,
key: `${column2.id}-thead`,
rowspan: column2.rowSpan,
scope: column2.colSpan > 1 ? "colgroup" : "col",
ariaSort: column2.sortable ? column2.order : void 0,
style: getHeaderCellStyle(
rowIndex,
cellIndex,
subColumns,
column2
),
onClick: ($event) => {
var _a;
if ((_a = $event.currentTarget) == null ? void 0 : _a.classList.contains(
"noclick"
)) {
return;
}
handleHeaderClick($event, column2);
},
onContextmenu: ($event) => handleHeaderContextMenu($event, column2),
onMousedown: ($event) => handleMouseDown($event, column2),
onMousemove: ($event) => handleMouseMove($event, column2),
onMouseout: handleMouseOut
},
[
h(
"div",
{
class: [
"cell",
column2.filteredValue && column2.filteredValue.length > 0 ? "highlight" : ""
]
},
[
column2.renderHeader ? column2.renderHeader({
column: column2,
$index: cellIndex,
store,
_self: $parent
}) : column2.label,
column2.sortable && h(
"button",
{
type: "button",
class: "caret-wrapper",
"aria-label": t("el.table.sortLabel", {
column: column2.label || ""
}),
onClick: ($event) => handleSortClick($event, column2)
},
[
h("i", {
onClick: ($event) => handleSortClick($event, column2, "ascending"),
class: "sort-caret ascending"
}),
h("i", {
onClick: ($event) => handleSortClick($event, column2, "descending"),
class: "sort-caret descending"
})
]
),
column2.filterable && h(
FilterPanel,
{
store,
placement: column2.filterPlacement || "bottom-start",
appendTo: $parent == null ? void 0 : $parent.appendFilterPanelTo,
column: column2,
upDataColumn: (key, value) => {
column2[key] = value;
}
},
{
"filter-icon": () => column2.renderFilterIcon ? column2.renderFilterIcon({
filterOpened: column2.filterOpened
}) : null
}
)
]
)
]
);
})
)
)
);
}
});
// node_modules/element-plus/es/components/table/src/table-body/events-helper.mjs
function isGreaterThan(a2, b2, epsilon = 0.03) {
return a2 - b2 > epsilon;
}
function useEvents(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const tooltipContent = ref("");
const tooltipTrigger = ref(h("div"));
const handleEvent = (event, row, name) => {
var _a, _b, _c;
const table = parent;
const cell = getCell(event);
let column2 = null;
const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix;
if (cell) {
column2 = getColumnByCell(
{
columns: (_c = (_b = props2.store) == null ? void 0 : _b.states.columns.value) != null ? _c : []
},
cell,
namespace
);
if (column2) {
table == null ? void 0 : table.emit(`cell-${name}`, row, column2, cell, event);
}
}
table == null ? void 0 : table.emit(`row-${name}`, row, column2, event);
};
const handleDoubleClick = (event, row) => {
handleEvent(event, row, "dblclick");
};
const handleClick = (event, row) => {
var _a;
(_a = props2.store) == null ? void 0 : _a.commit("setCurrentRow", row);
handleEvent(event, row, "click");
};
const handleContextMenu = (event, row) => {
handleEvent(event, row, "contextmenu");
};
const handleMouseEnter = debounce_default((index) => {
var _a;
(_a = props2.store) == null ? void 0 : _a.commit("setHoverRow", index);
}, 30);
const handleMouseLeave = debounce_default(() => {
var _a;
(_a = props2.store) == null ? void 0 : _a.commit("setHoverRow", null);
}, 30);
const getPadding = (el) => {
const style = window.getComputedStyle(el, null);
const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
const paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
const paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
const paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
return {
left: paddingLeft,
right: paddingRight,
top: paddingTop,
bottom: paddingBottom
};
};
const toggleRowClassByCell = (rowSpan, event, toggle) => {
var _a;
let node = (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.parentNode;
while (rowSpan > 1) {
node = node == null ? void 0 : node.nextSibling;
if (!node || node.nodeName !== "TR") break;
toggle(node, "hover-row hover-fixed-row");
rowSpan--;
}
};
const handleCellMouseEnter = (event, row, tooltipOptions) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
if (!parent) return;
const table = parent;
const cell = getCell(event);
const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix;
let column2 = null;
if (cell) {
column2 = getColumnByCell(
{
columns: (_c = (_b = props2.store) == null ? void 0 : _b.states.columns.value) != null ? _c : []
},
cell,
namespace
);
if (!column2) {
return;
}
if (cell.rowSpan > 1) {
toggleRowClassByCell(cell.rowSpan, event, addClass);
}
const hoverState = table.hoverState = {
cell,
column: column2,
row
};
table == null ? void 0 : table.emit(
"cell-mouse-enter",
hoverState.row,
hoverState.column,
hoverState.cell,
event
);
}
if (!tooltipOptions) {
if (((_d = removePopper) == null ? void 0 : _d.trigger) === cell) {
(_e = removePopper) == null ? void 0 : _e();
}
return;
}
const cellChild = event.target.querySelector(
".cell"
);
if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length && ((_f = cellChild.textContent) == null ? void 0 : _f.trim()))) {
return;
}
const range = document.createRange();
range.setStart(cellChild, 0);
range.setEnd(cellChild, cellChild.childNodes.length);
const { width: rangeWidth, height: rangeHeight } = range.getBoundingClientRect();
const { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect();
const { top, left, right, bottom } = getPadding(cellChild);
const horizontalPadding = left + right;
const verticalPadding = top + bottom;
if (isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) || isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) || // When using a high-resolution screen, it is possible that a returns cellChild.scrollWidth value of 1921 and
// cellChildWidth returns a value of 1920.994140625. #16856 #16673
isGreaterThan(cellChild.scrollWidth, cellChildWidth)) {
createTablePopper(
tooltipOptions,
(_g = (cell == null ? void 0 : cell.innerText) || (cell == null ? void 0 : cell.textContent)) != null ? _g : "",
row,
column2,
cell,
table
);
} else if (((_h = removePopper) == null ? void 0 : _h.trigger) === cell) {
(_i = removePopper) == null ? void 0 : _i();
}
};
const handleCellMouseLeave = (event) => {
const cell = getCell(event);
if (!cell) return;
if (cell.rowSpan > 1) {
toggleRowClassByCell(cell.rowSpan, event, removeClass);
}
const oldHoverState = parent == null ? void 0 : parent.hoverState;
parent == null ? void 0 : parent.emit(
"cell-mouse-leave",
oldHoverState == null ? void 0 : oldHoverState.row,
oldHoverState == null ? void 0 : oldHoverState.column,
oldHoverState == null ? void 0 : oldHoverState.cell,
event
);
};
return {
handleDoubleClick,
handleClick,
handleContextMenu,
handleMouseEnter,
handleMouseLeave,
handleCellMouseEnter,
handleCellMouseLeave,
tooltipContent,
tooltipTrigger
};
}
// node_modules/element-plus/es/components/table/src/table-body/styles-helper.mjs
function useStyles(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const getRowStyle = (row, rowIndex) => {
const rowStyle = parent == null ? void 0 : parent.props.rowStyle;
if (isFunction(rowStyle)) {
return rowStyle.call(null, {
row,
rowIndex
});
}
return rowStyle || null;
};
const getRowClass = (row, rowIndex, displayIndex) => {
var _a;
const classes = [ns.e("row")];
if ((parent == null ? void 0 : parent.props.highlightCurrentRow) && row === ((_a = props2.store) == null ? void 0 : _a.states.currentRow.value)) {
classes.push("current-row");
}
if (props2.stripe && displayIndex % 2 === 1) {
classes.push(ns.em("row", "striped"));
}
const rowClassName = parent == null ? void 0 : parent.props.rowClassName;
if (isString(rowClassName)) {
classes.push(rowClassName);
} else if (isFunction(rowClassName)) {
classes.push(
rowClassName.call(null, {
row,
rowIndex
})
);
}
return classes;
};
const getCellStyle = (rowIndex, columnIndex, row, column2) => {
const cellStyle = parent == null ? void 0 : parent.props.cellStyle;
let cellStyles = cellStyle != null ? cellStyle : {};
if (isFunction(cellStyle)) {
cellStyles = cellStyle.call(null, {
rowIndex,
columnIndex,
row,
column: column2
});
}
const fixedStyle = getFixedColumnOffset(
columnIndex,
props2 == null ? void 0 : props2.fixed,
props2.store
);
ensurePosition(fixedStyle, "left");
ensurePosition(fixedStyle, "right");
return Object.assign({}, cellStyles, fixedStyle);
};
const getCellClass = (rowIndex, columnIndex, row, column2, offset3) => {
const fixedClasses = getFixedColumnsClass(
ns.b(),
columnIndex,
props2 == null ? void 0 : props2.fixed,
props2.store,
void 0,
offset3
);
const classes = [column2.id, column2.align, column2.className, ...fixedClasses];
const cellClassName = parent == null ? void 0 : parent.props.cellClassName;
if (isString(cellClassName)) {
classes.push(cellClassName);
} else if (isFunction(cellClassName)) {
classes.push(
cellClassName.call(null, {
rowIndex,
columnIndex,
row,
column: column2
})
);
}
classes.push(ns.e("cell"));
return classes.filter((className) => Boolean(className)).join(" ");
};
const getSpan = (row, column2, rowIndex, columnIndex) => {
let rowspan = 1;
let colspan = 1;
const fn2 = parent == null ? void 0 : parent.props.spanMethod;
if (isFunction(fn2)) {
const result = fn2({
row,
column: column2,
rowIndex,
columnIndex
});
if (isArray(result)) {
rowspan = result[0];
colspan = result[1];
} else if (isObject(result)) {
rowspan = result.rowspan;
colspan = result.colspan;
}
}
return { rowspan, colspan };
};
const getColspanRealWidth = (columns2, colspan, index) => {
if (colspan < 1) {
return columns2[index].realWidth;
}
const widthArr = columns2.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan);
return Number(
widthArr.reduce((acc, width) => Number(acc) + Number(width), -1)
);
};
return {
getRowStyle,
getRowClass,
getCellStyle,
getCellClass,
getSpan,
getColspanRealWidth
};
}
// node_modules/element-plus/es/components/table/src/table-body/td-wrapper.vue2.mjs
var _hoisted_167 = ["colspan", "rowspan"];
var _sfc_main127 = defineComponent({
...{
name: "TableTdWrapper"
},
__name: "td-wrapper",
props: {
colspan: {
type: Number,
default: 1
},
rowspan: {
type: Number,
default: 1
}
},
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("td", {
colspan: __props.colspan,
rowspan: __props.rowspan
}, [
renderSlot(_ctx.$slots, "default")
], 8, _hoisted_167);
};
}
});
// node_modules/element-plus/es/components/table/src/table-body/render-helper.mjs
function useRender(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const {
handleDoubleClick,
handleClick,
handleContextMenu,
handleMouseEnter,
handleMouseLeave,
handleCellMouseEnter,
handleCellMouseLeave,
tooltipContent,
tooltipTrigger
} = useEvents(props2);
const {
getRowStyle,
getRowClass,
getCellStyle,
getCellClass,
getSpan,
getColspanRealWidth
} = useStyles(props2);
let displayIndex = -1;
const firstDefaultColumnIndex = computed(() => {
var _a;
return (_a = props2.store) == null ? void 0 : _a.states.columns.value.findIndex(
({ type }) => type === "default"
);
});
const getKeyOfRow = (row, index) => {
var _a;
const rowKey2 = (_a = parent == null ? void 0 : parent.props) == null ? void 0 : _a.rowKey;
if (rowKey2) {
return getRowIdentity(row, rowKey2);
}
return index;
};
const rowRender = (row, $index, treeRowData, expanded = false) => {
const { tooltipEffect, tooltipOptions, store } = props2;
const { indent, columns: columns2 } = store.states;
const rowClasses = [];
let display = true;
if (treeRowData) {
rowClasses.push(ns.em("row", `level-${treeRowData.level}`));
display = !!treeRowData.display;
}
if ($index === 0) {
displayIndex = -1;
}
if (props2.stripe && display) {
displayIndex++;
}
rowClasses.push(...getRowClass(row, $index, displayIndex));
const displayStyle = display ? null : { display: "none" };
return h(
"tr",
{
style: [displayStyle, getRowStyle(row, $index)],
class: rowClasses,
key: getKeyOfRow(row, $index),
onDblclick: ($event) => handleDoubleClick($event, row),
onClick: ($event) => handleClick($event, row),
onContextmenu: ($event) => handleContextMenu($event, row),
onMouseenter: () => handleMouseEnter($index),
onMouseleave: handleMouseLeave
},
columns2.value.map((column2, cellIndex) => {
const { rowspan, colspan } = getSpan(row, column2, $index, cellIndex);
if (!rowspan || !colspan) {
return null;
}
const columnData = Object.assign({}, column2);
columnData.realWidth = getColspanRealWidth(
columns2.value,
colspan,
cellIndex
);
const data = {
store,
_self: props2.context || parent,
column: columnData,
row,
$index,
cellIndex,
expanded
};
if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {
data.treeNode = {
indent: treeRowData.level && treeRowData.level * indent.value,
level: treeRowData.level
};
if (isBoolean(treeRowData.expanded)) {
data.treeNode.expanded = treeRowData.expanded;
if ("loading" in treeRowData) {
data.treeNode.loading = treeRowData.loading;
}
if ("noLazyChildren" in treeRowData) {
data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
}
}
}
const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`;
const patchKey = columnData.columnKey || columnData.rawColumnKey || "";
const mergedTooltipOptions = column2.showOverflowTooltip && merge_default(
{
effect: tooltipEffect
},
tooltipOptions,
column2.showOverflowTooltip
);
return h(
_sfc_main127,
{
style: getCellStyle($index, cellIndex, row, column2),
class: getCellClass($index, cellIndex, row, column2, colspan - 1),
key: `${patchKey}${baseKey}`,
rowspan,
colspan,
onMouseenter: ($event) => handleCellMouseEnter(
$event,
row,
mergedTooltipOptions
),
onMouseleave: handleCellMouseLeave
},
{
default: () => cellChildren(cellIndex, column2, data)
}
);
})
);
};
const cellChildren = (_cellIndex, column2, data) => {
return column2.renderCell(data);
};
const wrappedRowRender = (row, $index) => {
const store = props2.store;
const { isRowExpanded, assertRowKey } = store;
const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey: rowKey2 } = store.states;
const columns2 = store.states.columns.value;
const hasExpandColumn = columns2.some(({ type }) => type === "expand");
if (hasExpandColumn) {
const expanded = isRowExpanded(row);
const tr = rowRender(row, $index, void 0, expanded);
const renderExpanded = parent == null ? void 0 : parent.renderExpanded;
if (!renderExpanded) {
console.error("[Element Error]renderExpanded is required.");
return tr;
}
const rows = [[tr]];
if (parent.props.preserveExpandedContent || expanded) {
rows[0].push(
h(
"tr",
{
key: `expanded-row__${tr.key}`,
style: { display: expanded ? "" : "none" }
},
[
h(
"td",
{
colspan: columns2.length,
class: `${ns.e("cell")} ${ns.e("expanded-cell")}`
},
[renderExpanded({ row, $index, store, expanded })]
)
]
)
);
}
return rows;
} else if (Object.keys(treeData.value).length) {
assertRowKey();
const key = getRowIdentity(row, rowKey2.value);
let cur = treeData.value[key];
let treeRowData = null;
if (cur) {
treeRowData = {
expanded: cur.expanded,
level: cur.level,
display: true,
noLazyChildren: void 0,
loading: void 0
};
if (isBoolean(cur.lazy)) {
if (treeRowData && isBoolean(cur.loaded) && cur.loaded) {
treeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
treeRowData.loading = cur.loading;
}
}
const tmp = [rowRender(row, $index, treeRowData != null ? treeRowData : void 0)];
if (cur) {
let i = 0;
const traverse = (children, parent2) => {
if (!(children && children.length && parent2)) return;
children.forEach((node) => {
const innerTreeRowData = {
display: parent2.display && parent2.expanded,
level: parent2.level + 1,
expanded: false,
noLazyChildren: false,
loading: false
};
const childKey = getRowIdentity(node, rowKey2.value);
if (isPropAbsent(childKey)) {
throw new Error("For nested data item, row-key is required.");
}
cur = { ...treeData.value[childKey] };
if (cur) {
innerTreeRowData.expanded = cur.expanded;
cur.level = cur.level || innerTreeRowData.level;
cur.display = !!(cur.expanded && innerTreeRowData.display);
if (isBoolean(cur.lazy)) {
if (isBoolean(cur.loaded) && cur.loaded) {
innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
}
innerTreeRowData.loading = cur.loading;
}
}
i++;
tmp.push(rowRender(node, $index + i, innerTreeRowData));
if (cur) {
const nodes2 = lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value];
traverse(nodes2, cur);
}
});
};
cur.display = true;
const nodes = lazyTreeNodeMap.value[key] || row[childrenColumnName.value];
traverse(nodes, cur);
}
return tmp;
} else {
return rowRender(row, $index, void 0);
}
};
return {
wrappedRowRender,
tooltipContent,
tooltipTrigger
};
}
// node_modules/element-plus/es/components/table/src/table-body/defaults.mjs
var defaultProps2 = {
store: {
required: true,
type: Object
},
stripe: Boolean,
tooltipEffect: String,
tooltipOptions: {
type: Object
},
context: {
default: () => ({}),
type: Object
},
rowClassName: [String, Function],
rowStyle: [Object, Function],
fixed: {
type: String,
default: ""
},
highlight: Boolean
};
// node_modules/element-plus/es/components/table/src/table-body/index.mjs
var TableBody = defineComponent({
name: "ElTableBody",
props: defaultProps2,
setup(props2) {
var _a;
const instance = getCurrentInstance();
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender(props2);
const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
const hoveredCellList = [];
watch((_a = props2.store) == null ? void 0 : _a.states.hoverRow, (newVal, oldVal) => {
var _a2, _b;
const el = instance == null ? void 0 : instance.vnode.el;
const rows = Array.from((el == null ? void 0 : el.children) || []).filter(
(e) => e == null ? void 0 : e.classList.contains(`${ns.e("row")}`)
);
let rowNum = newVal;
const childNodes = (_a2 = rows[rowNum]) == null ? void 0 : _a2.childNodes;
if (childNodes == null ? void 0 : childNodes.length) {
let control = 0;
const indexes = Array.from(childNodes).reduce((acc, item, index) => {
var _a3, _b2;
if (((_a3 = childNodes[index]) == null ? void 0 : _a3.colSpan) > 1) {
control = (_b2 = childNodes[index]) == null ? void 0 : _b2.colSpan;
}
if (item.nodeName !== "TD" && control === 0) {
acc.push(index);
}
control > 0 && control--;
return acc;
}, []);
indexes.forEach((rowIndex) => {
var _a3;
rowNum = newVal;
while (rowNum > 0) {
const preChildNodes = (_a3 = rows[rowNum - 1]) == null ? void 0 : _a3.childNodes;
if (preChildNodes[rowIndex] && preChildNodes[rowIndex].nodeName === "TD" && preChildNodes[rowIndex].rowSpan > 1) {
addClass(preChildNodes[rowIndex], "hover-cell");
hoveredCellList.push(preChildNodes[rowIndex]);
break;
}
rowNum--;
}
});
} else {
hoveredCellList.forEach((item) => removeClass(item, "hover-cell"));
hoveredCellList.length = 0;
}
if (!((_b = props2.store) == null ? void 0 : _b.states.isComplex.value) || !isClient) return;
rAF(() => {
const oldRow = rows[oldVal];
const newRow = rows[newVal];
if (oldRow && !oldRow.classList.contains("hover-fixed-row")) {
removeClass(oldRow, "hover-row");
}
if (newRow) {
addClass(newRow, "hover-row");
}
});
});
onUnmounted(() => {
var _a2;
(_a2 = removePopper) == null ? void 0 : _a2();
});
return {
ns,
onColumnsChange,
onScrollableChange,
wrappedRowRender,
tooltipContent,
tooltipTrigger
};
},
render() {
const { wrappedRowRender, store } = this;
const data = (store == null ? void 0 : store.states.data.value) || [];
return h("tbody", { tabIndex: -1 }, [
data.reduce((acc, row) => {
return acc.concat(wrappedRowRender(row, acc.length));
}, [])
]);
}
});
// node_modules/element-plus/es/components/table/src/table-footer/mapState-helper.mjs
function useMapState() {
const table = inject(TABLE_INJECTION_KEY);
const store = table == null ? void 0 : table.store;
const leftFixedLeafCount = computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.fixedLeafColumnsLength.value) != null ? _a : 0;
});
const rightFixedLeafCount = computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a : 0;
});
const columnsCount = computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.columns.value.length) != null ? _a : 0;
});
const leftFixedCount = computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.fixedColumns.value.length) != null ? _a : 0;
});
const rightFixedCount = computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a : 0;
});
return {
leftFixedLeafCount,
rightFixedLeafCount,
columnsCount,
leftFixedCount,
rightFixedCount,
columns: computed(() => {
var _a;
return (_a = store == null ? void 0 : store.states.columns.value) != null ? _a : [];
})
};
}
// node_modules/element-plus/es/components/table/src/table-footer/style-helper.mjs
function useStyle2(props2) {
const { columns: columns2 } = useMapState();
const ns = useNamespace("table");
const getCellClasses = (columns22, cellIndex) => {
const column2 = columns22[cellIndex];
const classes = [
ns.e("cell"),
column2.id,
column2.align,
column2.labelClassName,
...getFixedColumnsClass(ns.b(), cellIndex, column2.fixed, props2.store)
];
if (column2.className) {
classes.push(column2.className);
}
if (!column2.children) {
classes.push(ns.is("leaf"));
}
return classes;
};
const getCellStyles = (column2, cellIndex) => {
const fixedStyle = getFixedColumnOffset(
cellIndex,
column2.fixed,
props2.store
);
ensurePosition(fixedStyle, "left");
ensurePosition(fixedStyle, "right");
return fixedStyle;
};
return {
getCellClasses,
getCellStyles,
columns: columns2
};
}
// node_modules/element-plus/es/components/table/src/table-footer/index.mjs
var TableFooter = defineComponent({
name: "ElTableFooter",
props: {
fixed: {
type: String,
default: ""
},
store: {
required: true,
type: Object
},
summaryMethod: Function,
sumText: String,
border: Boolean,
defaultSort: {
type: Object,
default: () => {
return {
prop: "",
order: ""
};
}
}
},
setup(props2) {
const parent = inject(TABLE_INJECTION_KEY);
const ns = useNamespace("table");
const { getCellClasses, getCellStyles, columns: columns2 } = useStyle2(
props2
);
const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent);
return {
ns,
onScrollableChange,
onColumnsChange,
getCellClasses,
getCellStyles,
columns: columns2
};
},
render() {
const { columns: columns2, getCellStyles, getCellClasses, summaryMethod, sumText } = this;
const data = this.store.states.data.value;
let sums = [];
if (summaryMethod) {
sums = summaryMethod({
columns: columns2,
data
});
} else {
columns2.forEach((column2, index) => {
if (index === 0) {
sums[index] = sumText;
return;
}
const values = data.map((item) => Number(item[column2.property]));
const precisions = [];
let notNumber = true;
values.forEach((value) => {
if (!Number.isNaN(+value)) {
notNumber = false;
const decimal = `${value}`.split(".")[1];
precisions.push(decimal ? decimal.length : 0);
}
});
const precision = Math.max.apply(null, precisions);
if (!notNumber) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!Number.isNaN(+value)) {
return Number.parseFloat(
(prev + curr).toFixed(Math.min(precision, 20))
);
} else {
return prev;
}
}, 0);
} else {
sums[index] = "";
}
});
}
return h(
h("tfoot", [
h("tr", {}, [
...columns2.map(
(column2, cellIndex) => h(
"td",
{
key: cellIndex,
colspan: column2.colSpan,
rowspan: column2.rowSpan,
class: getCellClasses(columns2, cellIndex),
style: getCellStyles(column2, cellIndex)
},
[
h(
"div",
{
class: ["cell", column2.labelClassName]
},
[sums[cellIndex]]
)
]
)
)
])
])
);
}
});
// node_modules/element-plus/es/components/table/src/table/utils-helper.mjs
function useUtils2(store) {
const setCurrentRow = (row) => {
store.commit("setCurrentRow", row);
};
const getSelectionRows = () => {
return store.getSelectionRows();
};
const toggleRowSelection = (row, selected, ignoreSelectable = true) => {
store.toggleRowSelection(row, selected, false, ignoreSelectable);
store.updateAllSelected();
};
const clearSelection = () => {
store.clearSelection();
};
const clearFilter = (columnKeys) => {
store.clearFilter(columnKeys);
};
const toggleAllSelection = () => {
store.commit("toggleAllSelection");
};
const toggleRowExpansion = (row, expanded) => {
store.toggleRowExpansionAdapter(row, expanded);
};
const clearSort = () => {
store.clearSort();
};
const sort = (prop, order) => {
store.commit("sort", { prop, order });
};
const updateKeyChildren = (key, data) => {
store.updateKeyChildren(key, data);
};
return {
setCurrentRow,
getSelectionRows,
toggleRowSelection,
clearSelection,
clearFilter,
toggleAllSelection,
toggleRowExpansion,
clearSort,
sort,
updateKeyChildren
};
}
// node_modules/element-plus/es/components/table/src/table/style-helper.mjs
function useStyle3(props2, layout2, store, table) {
const isHidden2 = ref(false);
const renderExpanded = ref(null);
const resizeProxyVisible = ref(false);
const setDragVisible = (visible) => {
resizeProxyVisible.value = visible;
};
const resizeState = ref({
width: null,
height: null,
headerHeight: null
});
const isGroup = ref(false);
const scrollbarViewStyle = {
display: "inline-block",
verticalAlign: "middle"
};
const tableWidth = ref();
const tableScrollHeight = ref(0);
const bodyScrollHeight = ref(0);
const headerScrollHeight = ref(0);
const footerScrollHeight = ref(0);
const appendScrollHeight = ref(0);
watch(
() => props2.height,
(value) => {
layout2.setHeight(value != null ? value : null);
},
{ immediate: true }
);
watch(
() => props2.maxHeight,
(value) => {
layout2.setMaxHeight(value != null ? value : null);
},
{ immediate: true }
);
watch(
() => [props2.currentRowKey, store.states.rowKey],
([currentRowKey, rowKey2]) => {
if (!unref(rowKey2) || !unref(currentRowKey)) return;
store.setCurrentRowKey(`${currentRowKey}`);
},
{
immediate: true
}
);
watch(
() => props2.data,
(data) => {
table.store.commit("setData", data);
},
{
immediate: true,
deep: true
}
);
watchEffect(() => {
if (props2.expandRowKeys) {
store.setExpandRowKeysAdapter(props2.expandRowKeys);
}
});
const handleMouseLeave = () => {
table.store.commit("setHoverRow", null);
if (table.hoverState) table.hoverState = null;
};
const handleHeaderFooterMousewheel = (_event2, data) => {
const { pixelX, pixelY } = data;
if (Math.abs(pixelX) >= Math.abs(pixelY)) {
table.refs.bodyWrapper.scrollLeft += data.pixelX / 5;
}
};
const shouldUpdateHeight = computed(() => {
return props2.height || props2.maxHeight || store.states.fixedColumns.value.length > 0 || store.states.rightFixedColumns.value.length > 0;
});
const tableBodyStyles = computed(() => {
return {
width: layout2.bodyWidth.value ? `${layout2.bodyWidth.value}px` : ""
};
});
const doLayout = () => {
if (shouldUpdateHeight.value) {
layout2.updateElsHeight();
}
layout2.updateColumnsWidth();
if (typeof window === "undefined") return;
requestAnimationFrame(syncPosition);
};
onMounted(async () => {
await nextTick();
store.updateColumns();
bindEvents();
requestAnimationFrame(doLayout);
const el = table.vnode.el;
const tableHeader = table.refs.headerWrapper;
if (props2.flexible && el && el.parentElement) {
el.parentElement.style.minWidth = "0";
}
resizeState.value = {
width: tableWidth.value = el.offsetWidth,
height: el.offsetHeight,
headerHeight: props2.showHeader && tableHeader ? tableHeader.offsetHeight : null
};
store.states.columns.value.forEach((column2) => {
if (column2.filteredValue && column2.filteredValue.length) {
table.store.commit("filterChange", {
column: column2,
values: column2.filteredValue,
silent: true
});
}
});
table.$ready = true;
});
const setScrollClassByEl = (el, className) => {
if (!el) return;
const classList = Array.from(el.classList).filter(
(item) => !item.startsWith("is-scrolling-")
);
classList.push(layout2.scrollX.value ? className : "is-scrolling-none");
el.className = classList.join(" ");
};
const setScrollClass = (className) => {
const { tableWrapper } = table.refs;
setScrollClassByEl(tableWrapper, className);
};
const hasScrollClass = (className) => {
const { tableWrapper } = table.refs;
return !!(tableWrapper && tableWrapper.classList.contains(className));
};
const syncPosition = function() {
if (!table.refs.scrollBarRef) return;
if (!layout2.scrollX.value) {
const scrollingNoneClass = "is-scrolling-none";
if (!hasScrollClass(scrollingNoneClass)) {
setScrollClass(scrollingNoneClass);
}
return;
}
const scrollContainer = table.refs.scrollBarRef.wrapRef;
if (!scrollContainer) return;
const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
const { headerWrapper, footerWrapper } = table.refs;
if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
const maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
if (scrollLeft >= maxScrollLeftPosition) {
setScrollClass("is-scrolling-right");
} else if (scrollLeft === 0) {
setScrollClass("is-scrolling-left");
} else {
setScrollClass("is-scrolling-middle");
}
};
const bindEvents = () => {
if (!table.refs.scrollBarRef) return;
if (table.refs.scrollBarRef.wrapRef) {
useEventListener(
table.refs.scrollBarRef.wrapRef,
"scroll",
syncPosition,
{
passive: true
}
);
}
if (props2.fit) {
useResizeObserver(table.vnode.el, resizeListener);
} else {
useEventListener(window, "resize", resizeListener);
}
useResizeObserver(table.refs.tableInnerWrapper, () => {
var _a, _b;
resizeListener();
(_b = (_a = table.refs) == null ? void 0 : _a.scrollBarRef) == null ? void 0 : _b.update();
});
};
const resizeListener = () => {
var _a, _b, _c, _d;
const el = table.vnode.el;
if (!table.$ready || !el) return;
let shouldUpdateLayout = false;
const {
width: oldWidth,
height: oldHeight,
headerHeight: oldHeaderHeight
} = resizeState.value;
const width = tableWidth.value = el.offsetWidth;
if (oldWidth !== width) {
shouldUpdateLayout = true;
}
const height = el.offsetHeight;
if ((props2.height || shouldUpdateHeight.value) && oldHeight !== height) {
shouldUpdateLayout = true;
}
const tableHeader = props2.tableLayout === "fixed" ? table.refs.headerWrapper : (_a = table.refs.tableHeaderRef) == null ? void 0 : _a.$el;
if (props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) !== oldHeaderHeight) {
shouldUpdateLayout = true;
}
tableScrollHeight.value = ((_b = table.refs.tableWrapper) == null ? void 0 : _b.scrollHeight) || 0;
headerScrollHeight.value = (tableHeader == null ? void 0 : tableHeader.scrollHeight) || 0;
footerScrollHeight.value = ((_c = table.refs.footerWrapper) == null ? void 0 : _c.offsetHeight) || 0;
appendScrollHeight.value = ((_d = table.refs.appendWrapper) == null ? void 0 : _d.offsetHeight) || 0;
bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value - appendScrollHeight.value;
if (shouldUpdateLayout) {
resizeState.value = {
width,
height,
headerHeight: props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) || 0
};
doLayout();
}
};
const tableSize = useFormSize();
const bodyWidth = computed(() => {
const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout2;
return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : "";
});
const tableLayout = computed(() => {
if (props2.maxHeight) return "fixed";
return props2.tableLayout;
});
const emptyBlockStyle = computed(() => {
if (props2.data && props2.data.length) return;
let height = "100%";
if (props2.height && bodyScrollHeight.value) {
height = `${bodyScrollHeight.value}px`;
}
const width = tableWidth.value;
return {
width: width ? `${width}px` : "",
height
};
});
const scrollbarStyle = computed(() => {
if (props2.height) {
return {
height: "100%"
};
}
if (props2.maxHeight) {
if (!Number.isNaN(Number(props2.maxHeight))) {
return {
maxHeight: `${+props2.maxHeight - headerScrollHeight.value - footerScrollHeight.value}px`
};
} else {
return {
maxHeight: `calc(${props2.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)`
};
}
}
return {};
});
return {
isHidden: isHidden2,
renderExpanded,
setDragVisible,
isGroup,
handleMouseLeave,
handleHeaderFooterMousewheel,
tableSize,
emptyBlockStyle,
resizeProxyVisible,
bodyWidth,
resizeState,
doLayout,
tableBodyStyles,
tableLayout,
scrollbarViewStyle,
scrollbarStyle
};
}
// node_modules/element-plus/es/components/table/src/table/key-render-helper.mjs
function useKeyRender(table) {
let observer;
const initWatchDom = () => {
const el = table.vnode.el;
const columnsWrapper = el.querySelector(".hidden-columns");
const config = { childList: true, subtree: true };
const updateOrderFns = table.store.states.updateOrderFns;
observer = new MutationObserver(() => {
updateOrderFns.forEach((fn2) => fn2());
});
observer.observe(columnsWrapper, config);
};
onMounted(() => {
initWatchDom();
});
onUnmounted(() => {
observer == null ? void 0 : observer.disconnect();
});
}
// node_modules/element-plus/es/components/table/src/table/defaults.mjs
var defaultProps3 = {
/**
* @description table data
*/
data: {
type: Array,
default: () => []
},
/**
* @description size of Table
*/
size: useSizeProp,
width: [String, Number],
/**
* @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles
*/
height: [String, Number],
/**
* @description table's max-height. The legal value is a number or the height in px
*/
maxHeight: [String, Number],
/**
* @description whether width of column automatically fits its container
*/
fit: {
type: Boolean,
default: true
},
/**
* @description whether Table is striped
*/
stripe: Boolean,
/**
* @description whether Table has vertical border
*/
border: Boolean,
/**
* @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used
*/
rowKey: [String, Function],
/**
* @description whether Table header is visible
*/
showHeader: {
type: Boolean,
default: true
},
/**
* @description whether to display a summary row
*/
showSummary: Boolean,
/**
* @description displayed text for the first column of summary row
*/
sumText: String,
/**
* @description custom summary method
*/
summaryMethod: Function,
/**
* @description function that returns custom class names for a row, or a string assigning class names for every row
*/
rowClassName: [String, Function],
/**
* @description function that returns custom style for a row, or an object assigning custom style for every row
*/
rowStyle: [Object, Function],
/**
* @description function that returns custom class names for a cell, or a string assigning class names for every cell
*/
cellClassName: [String, Function],
/**
* @description function that returns custom style for a cell, or an object assigning custom style for every cell
*/
cellStyle: [Object, Function],
/**
* @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header
*/
headerRowClassName: [String, Function],
/**
* @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header
*/
headerRowStyle: [Object, Function],
/**
* @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header
*/
headerCellClassName: [String, Function],
/**
* @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header
*/
headerCellStyle: [Object, Function],
/**
* @description whether current row is highlighted
*/
highlightCurrentRow: Boolean,
/**
* @description key of current row, a set only prop
*/
currentRowKey: [String, Number],
/**
* @description displayed text when data is empty. You can customize this area with `#empty`
*/
emptyText: String,
/**
* @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop
*/
expandRowKeys: Array,
/**
* @description whether expand all rows by default, works when the table has a column type="expand" or contains tree structure data
*/
defaultExpandAll: Boolean,
/**
* @description enable expandable rows, works when the table has a column type="expand"
*/
rowExpandable: {
type: Function
},
/**
* @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order
*/
defaultSort: Object,
/**
* @description the `effect` of the overflow tooltip
*/
tooltipEffect: String,
/**
* @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)
*/
tooltipOptions: Object,
/**
* @description method that returns rowspan and colspan
*/
spanMethod: Function,
/**
* @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected
*/
selectOnIndeterminate: {
type: Boolean,
default: true
},
/**
* @description horizontal indentation of tree data
*/
indent: {
type: Number,
default: 16
},
/**
* @description configuration for rendering nested data
*/
treeProps: {
type: Object,
default: () => {
return {
hasChildren: "hasChildren",
children: "children",
checkStrictly: false
};
}
},
/**
* @description whether to lazy loading data
*/
lazy: Boolean,
/**
* @description method for loading child row data, only works when `lazy` is true
*/
load: Function,
style: {
type: [String, Object, Array],
default: () => ({})
},
className: {
type: String,
default: ""
},
/**
* @description sets the algorithm used to lay out table cells, rows, and columns
*/
tableLayout: {
type: String,
default: "fixed"
},
/**
* @description always show scrollbar
*/
scrollbarAlwaysOn: Boolean,
/**
* @description ensure main axis minimum-size doesn't follow the content
*/
flexible: Boolean,
/**
* @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns
*/
showOverflowTooltip: [Boolean, Object],
/**
* @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
*/
tooltipFormatter: Function,
appendFilterPanelTo: String,
scrollbarTabindex: {
type: [Number, String],
default: void 0
},
/**
* @description whether to allow drag the last column
*/
allowDragLastColumn: {
type: Boolean,
default: true
},
/**
* @description whether to preserve expanded row content in DOM when collapsed
*/
preserveExpandedContent: Boolean,
/**
* @description whether to use native scrollbars
*/
nativeScrollbar: Boolean
};
// node_modules/element-plus/es/components/table/src/h-helper.mjs
function hColgroup(props2) {
const isAuto = props2.tableLayout === "auto";
let columns2 = props2.columns || [];
if (isAuto) {
if (columns2.every(({ width }) => isUndefined(width))) {
columns2 = [];
}
}
const getPropsData = (column2) => {
const propsData = {
key: `${props2.tableLayout}_${column2.id}`,
style: {},
name: void 0
};
if (isAuto) {
propsData.style = {
width: `${column2.width}px`
};
} else {
propsData.name = column2.id;
}
return propsData;
};
return h(
"colgroup",
{},
columns2.map((column2) => h("col", getPropsData(column2)))
);
}
hColgroup.props = ["columns", "tableLayout"];
// node_modules/element-plus/es/components/table/src/composables/use-scrollbar.mjs
var useScrollbar = () => {
const scrollBarRef = ref();
const scrollTo2 = (options, yCoord) => {
const scrollbar = scrollBarRef.value;
if (scrollbar) {
scrollbar.scrollTo(options, yCoord);
}
};
const setScrollPosition = (position, offset3) => {
const scrollbar = scrollBarRef.value;
if (scrollbar && isNumber(offset3) && ["Top", "Left"].includes(position)) {
scrollbar[`setScroll${position}`](offset3);
}
};
const setScrollTop = (top) => setScrollPosition("Top", top);
const setScrollLeft = (left) => setScrollPosition("Left", left);
return {
scrollBarRef,
scrollTo: scrollTo2,
setScrollTop,
setScrollLeft
};
};
// node_modules/normalize-wheel-es/dist/index.mjs
var v = false;
var o;
var f;
var s;
var u;
var d;
var N2;
var l;
var p;
var m;
var w;
var D;
var x;
var E;
var M;
var F;
function a() {
if (!v) {
v = true;
var e = navigator.userAgent, n = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e), i = /(Mac OS X)|(Windows)|(Linux)/.exec(e);
if (x = /\b(iPhone|iP[ao]d)/.exec(e), E = /\b(iP[ao]d)/.exec(e), w = /Android/i.exec(e), M = /FBAN\/\w+;/i.exec(e), F = /Mobile/i.exec(e), D = !!/Win64/.exec(e), n) {
o = n[1] ? parseFloat(n[1]) : n[5] ? parseFloat(n[5]) : NaN, o && document && document.documentMode && (o = document.documentMode);
var r = /(?:Trident\/(\d+.\d+))/.exec(e);
N2 = r ? parseFloat(r[1]) + 4 : o, f = n[2] ? parseFloat(n[2]) : NaN, s = n[3] ? parseFloat(n[3]) : NaN, u = n[4] ? parseFloat(n[4]) : NaN, u ? (n = /(?:Chrome\/(\d+\.\d+))/.exec(e), d = n && n[1] ? parseFloat(n[1]) : NaN) : d = NaN;
} else o = f = s = d = u = NaN;
if (i) {
if (i[1]) {
var t = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);
l = t ? parseFloat(t[1].replace("_", ".")) : true;
} else l = false;
p = !!i[2], m = !!i[3];
} else l = p = m = false;
}
}
var _ = { ie: function() {
return a() || o;
}, ieCompatibilityMode: function() {
return a() || N2 > o;
}, ie64: function() {
return _.ie() && D;
}, firefox: function() {
return a() || f;
}, opera: function() {
return a() || s;
}, webkit: function() {
return a() || u;
}, safari: function() {
return _.webkit();
}, chrome: function() {
return a() || d;
}, windows: function() {
return a() || p;
}, osx: function() {
return a() || l;
}, linux: function() {
return a() || m;
}, iphone: function() {
return a() || x;
}, mobile: function() {
return a() || x || E || w || F;
}, nativeApp: function() {
return a() || M;
}, android: function() {
return a() || w;
}, ipad: function() {
return a() || E;
} };
var A = _;
var c = !!(typeof window < "u" && window.document && window.document.createElement);
var U = { canUseDOM: c, canUseWorkers: typeof Worker < "u", canUseEventListeners: c && !!(window.addEventListener || window.attachEvent), canUseViewport: c && !!window.screen, isInWorker: !c };
var h2 = U;
var X;
h2.canUseDOM && (X = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== true);
function S(e, n) {
if (!h2.canUseDOM || n && !("addEventListener" in document)) return false;
var i = "on" + e, r = i in document;
if (!r) {
var t = document.createElement("div");
t.setAttribute(i, "return;"), r = typeof t[i] == "function";
}
return !r && X && e === "wheel" && (r = document.implementation.hasFeature("Events.wheel", "3.0")), r;
}
var b = S;
var O = 10;
var I2 = 40;
var P2 = 800;
function T2(e) {
var n = 0, i = 0, r = 0, t = 0;
return "detail" in e && (i = e.detail), "wheelDelta" in e && (i = -e.wheelDelta / 120), "wheelDeltaY" in e && (i = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (n = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (n = i, i = 0), r = n * O, t = i * O, "deltaY" in e && (t = e.deltaY), "deltaX" in e && (r = e.deltaX), (r || t) && e.deltaMode && (e.deltaMode == 1 ? (r *= I2, t *= I2) : (r *= P2, t *= P2)), r && !n && (n = r < 1 ? -1 : 1), t && !i && (i = t < 1 ? -1 : 1), { spinX: n, spinY: i, pixelX: r, pixelY: t };
}
T2.getEventType = function() {
return A.firefox() ? "DOMMouseScroll" : b("wheel") ? "wheel" : "mousewheel";
};
var Y2 = T2;
// node_modules/element-plus/es/directives/mousewheel/index.mjs
var SCOPE8 = "_Mousewheel";
var mousewheel = function(element, callback) {
if (element && element.addEventListener) {
removeWheelHandler(element);
const fn2 = function(event) {
const normalized = Y2(event);
callback && Reflect.apply(callback, this, [event, normalized]);
};
element[SCOPE8] = { wheelHandler: fn2 };
element.addEventListener("wheel", fn2, { passive: true });
}
};
var removeWheelHandler = (element) => {
var _a;
if ((_a = element[SCOPE8]) == null ? void 0 : _a.wheelHandler) {
element.removeEventListener("wheel", element[SCOPE8].wheelHandler);
element[SCOPE8] = null;
}
};
var Mousewheel = {
beforeMount(el, binding) {
mousewheel(el, binding.value);
},
unmounted(el) {
removeWheelHandler(el);
},
updated(el, binding) {
if (binding.value !== binding.oldValue) {
mousewheel(el, binding.value);
}
}
};
// node_modules/element-plus/es/components/table/src/table.vue2.mjs
var tableIdSeed = 1;
var _sfc_main128 = defineComponent({
name: "ElTable",
directives: {
Mousewheel
},
components: {
TableHeader,
TableBody,
TableFooter,
ElScrollbar,
hColgroup
},
props: defaultProps3,
emits: [
"select",
"select-all",
"selection-change",
"cell-mouse-enter",
"cell-mouse-leave",
"cell-contextmenu",
"cell-click",
"cell-dblclick",
"row-click",
"row-contextmenu",
"row-dblclick",
"header-click",
"header-contextmenu",
"sort-change",
"filter-change",
"current-change",
"header-dragend",
"expand-change",
"scroll"
],
setup(props2) {
const { t } = useLocale();
const ns = useNamespace("table");
const table = getCurrentInstance();
provide(TABLE_INJECTION_KEY, table);
const store = createStore(table, props2);
table.store = store;
const layout2 = new TableLayout({
store: table.store,
table,
fit: props2.fit,
showHeader: props2.showHeader
});
table.layout = layout2;
const isEmpty2 = computed(() => (store.states.data.value || []).length === 0);
const {
setCurrentRow,
getSelectionRows,
toggleRowSelection,
clearSelection,
clearFilter,
toggleAllSelection,
toggleRowExpansion,
clearSort,
sort,
updateKeyChildren
} = useUtils2(store);
const {
isHidden: isHidden2,
renderExpanded,
setDragVisible,
isGroup,
handleMouseLeave,
handleHeaderFooterMousewheel,
tableSize,
emptyBlockStyle,
resizeProxyVisible,
bodyWidth,
resizeState,
doLayout,
tableBodyStyles,
tableLayout,
scrollbarViewStyle,
scrollbarStyle
} = useStyle3(props2, layout2, store, table);
const { scrollBarRef, scrollTo: scrollTo2, setScrollLeft, setScrollTop } = useScrollbar();
const debouncedUpdateLayout = debounce_default(doLayout, 50);
const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;
table.tableId = tableId;
table.state = {
isGroup,
resizeState,
doLayout,
debouncedUpdateLayout
};
const computedSumText = computed(
() => {
var _a;
return (_a = props2.sumText) != null ? _a : t("el.table.sumText");
}
);
const computedEmptyText = computed(() => {
var _a;
return (_a = props2.emptyText) != null ? _a : t("el.table.emptyText");
});
const columns2 = computed(() => {
return convertToRows(store.states.originColumns.value)[0];
});
useKeyRender(table);
onBeforeUnmount(() => {
debouncedUpdateLayout.cancel();
});
return {
ns,
layout: layout2,
store,
columns: columns2,
handleHeaderFooterMousewheel,
handleMouseLeave,
tableId,
tableSize,
isHidden: isHidden2,
isEmpty: isEmpty2,
renderExpanded,
resizeProxyVisible,
resizeState,
isGroup,
bodyWidth,
tableBodyStyles,
emptyBlockStyle,
debouncedUpdateLayout,
/**
* @description used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection
*/
setCurrentRow,
/**
* @description returns the currently selected rows
*/
getSelectionRows,
/**
* @description used in multiple selection Table, toggle if a certain row is selected. With the second parameter, you can directly set if this row is selected
*/
toggleRowSelection,
/**
* @description used in multiple selection Table, clear user selection
*/
clearSelection,
/**
* @description clear filters of the columns whose `columnKey` are passed in. If no params, clear all filters
*/
clearFilter,
/**
* @description used in multiple selection Table, toggle select all and deselect all
*/
toggleAllSelection,
/**
* @description used in expandable Table or tree Table, toggle if a certain row is expanded. With the second parameter, you can directly set if this row is expanded or collapsed
*/
toggleRowExpansion,
/**
* @description clear sorting, restore data to the original order
*/
clearSort,
/**
* @description refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout
*/
doLayout,
/**
* @description sort Table manually. Property `prop` is used to set sort column, property `order` is used to set sort order
*/
sort,
/**
* @description used in lazy Table, must set `rowKey`, update key children
*/
updateKeyChildren,
t,
setDragVisible,
context: table,
computedSumText,
computedEmptyText,
tableLayout,
scrollbarViewStyle,
scrollbarStyle,
scrollBarRef,
/**
* @description scrolls to a particular set of coordinates
*/
scrollTo: scrollTo2,
/**
* @description set horizontal scroll position
*/
setScrollLeft,
/**
* @description set vertical scroll position
*/
setScrollTop,
/**
* @description whether to allow drag the last column
*/
allowDragLastColumn: props2.allowDragLastColumn
};
}
});
// node_modules/element-plus/es/components/table/src/table.vue.mjs
var _hoisted_168 = ["data-prefix"];
var _hoisted_237 = {
ref: "hiddenColumns",
class: "hidden-columns"
};
function _sfc_render19(_ctx, _cache, $props, $setup, $data, $options) {
const _component_hColgroup = resolveComponent("hColgroup");
const _component_table_header = resolveComponent("table-header");
const _component_table_body = resolveComponent("table-body");
const _component_table_footer = resolveComponent("table-footer");
const _component_el_scrollbar = resolveComponent("el-scrollbar");
const _directive_mousewheel = resolveDirective("mousewheel");
return openBlock(), createElementBlock("div", {
ref: "tableWrapper",
class: normalizeClass([
{
[_ctx.ns.m("fit")]: _ctx.fit,
[_ctx.ns.m("striped")]: _ctx.stripe,
[_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
[_ctx.ns.m("hidden")]: _ctx.isHidden,
[_ctx.ns.m("group")]: _ctx.isGroup,
[_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
[_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
[_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
[_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
[_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
"has-footer": _ctx.showSummary
},
_ctx.ns.m(_ctx.tableSize),
_ctx.className,
_ctx.ns.b(),
_ctx.ns.m(`layout-${_ctx.tableLayout}`)
]),
style: normalizeStyle(_ctx.style),
"data-prefix": _ctx.ns.namespace.value,
onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args))
}, [
createBaseVNode(
"div",
{
ref: "tableInnerWrapper",
class: normalizeClass(_ctx.ns.e("inner-wrapper"))
},
[
createBaseVNode(
"div",
_hoisted_237,
[
renderSlot(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
),
_ctx.showHeader && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "headerWrapper",
class: normalizeClass(_ctx.ns.e("header-wrapper"))
},
[
createBaseVNode(
"table",
{
ref: "tableHeader",
class: normalizeClass(_ctx.ns.e("header")),
style: normalizeStyle(_ctx.tableBodyStyles),
border: "0",
cellpadding: "0",
cellspacing: "0"
},
[
createVNode(_component_hColgroup, {
columns: _ctx.store.states.columns.value,
"table-layout": _ctx.tableLayout
}, null, 8, ["columns", "table-layout"]),
createVNode(_component_table_header, {
ref: "tableHeaderRef",
border: _ctx.border,
"default-sort": _ctx.defaultSort,
store: _ctx.store,
"append-filter-panel-to": _ctx.appendFilterPanelTo,
"allow-drag-last-column": _ctx.allowDragLastColumn,
onSetDragVisible: _ctx.setDragVisible
}, null, 8, ["border", "default-sort", "store", "append-filter-panel-to", "allow-drag-last-column", "onSetDragVisible"])
],
6
/* CLASS, STYLE */
)
],
2
/* CLASS */
)), [
[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
]) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
ref: "bodyWrapper",
class: normalizeClass(_ctx.ns.e("body-wrapper"))
},
[
createVNode(_component_el_scrollbar, {
ref: "scrollBarRef",
"view-style": _ctx.scrollbarViewStyle,
"wrap-style": _ctx.scrollbarStyle,
always: _ctx.scrollbarAlwaysOn,
tabindex: _ctx.scrollbarTabindex,
native: _ctx.nativeScrollbar,
onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event))
}, {
default: withCtx(() => [
createBaseVNode(
"table",
{
ref: "tableBody",
class: normalizeClass(_ctx.ns.e("body")),
cellspacing: "0",
cellpadding: "0",
border: "0",
style: normalizeStyle({
width: _ctx.bodyWidth,
tableLayout: _ctx.tableLayout
})
},
[
createVNode(_component_hColgroup, {
columns: _ctx.store.states.columns.value,
"table-layout": _ctx.tableLayout
}, null, 8, ["columns", "table-layout"]),
_ctx.showHeader && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_header, {
key: 0,
ref: "tableHeaderRef",
class: normalizeClass(_ctx.ns.e("body-header")),
border: _ctx.border,
"default-sort": _ctx.defaultSort,
store: _ctx.store,
"append-filter-panel-to": _ctx.appendFilterPanelTo,
onSetDragVisible: _ctx.setDragVisible
}, null, 8, ["class", "border", "default-sort", "store", "append-filter-panel-to", "onSetDragVisible"])) : createCommentVNode("v-if", true),
createVNode(_component_table_body, {
context: _ctx.context,
highlight: _ctx.highlightCurrentRow,
"row-class-name": _ctx.rowClassName,
"tooltip-effect": _ctx.tooltipEffect,
"tooltip-options": _ctx.tooltipOptions,
"row-style": _ctx.rowStyle,
store: _ctx.store,
stripe: _ctx.stripe
}, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "tooltip-options", "row-style", "store", "stripe"]),
_ctx.showSummary && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_footer, {
key: 1,
class: normalizeClass(_ctx.ns.e("body-footer")),
border: _ctx.border,
"default-sort": _ctx.defaultSort,
store: _ctx.store,
"sum-text": _ctx.computedSumText,
"summary-method": _ctx.summaryMethod
}, null, 8, ["class", "border", "default-sort", "store", "sum-text", "summary-method"])) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
),
_ctx.isEmpty ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "emptyBlock",
style: normalizeStyle(_ctx.emptyBlockStyle),
class: normalizeClass(_ctx.ns.e("empty-block"))
},
[
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.ns.e("empty-text"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => [
createTextVNode(
toDisplayString(_ctx.computedEmptyText),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
],
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true),
_ctx.$slots.append ? (openBlock(), createElementBlock(
"div",
{
key: 1,
ref: "appendWrapper",
class: normalizeClass(_ctx.ns.e("append-wrapper"))
},
[
renderSlot(_ctx.$slots, "append")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["view-style", "wrap-style", "always", "tabindex", "native"])
],
2
/* CLASS */
),
_ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock(
"div",
{
key: 1,
ref: "footerWrapper",
class: normalizeClass(_ctx.ns.e("footer-wrapper"))
},
[
createBaseVNode(
"table",
{
class: normalizeClass(_ctx.ns.e("footer")),
cellspacing: "0",
cellpadding: "0",
border: "0",
style: normalizeStyle(_ctx.tableBodyStyles)
},
[
createVNode(_component_hColgroup, {
columns: _ctx.store.states.columns.value,
"table-layout": _ctx.tableLayout
}, null, 8, ["columns", "table-layout"]),
createVNode(_component_table_footer, {
border: _ctx.border,
"default-sort": _ctx.defaultSort,
store: _ctx.store,
"sum-text": _ctx.computedSumText,
"summary-method": _ctx.summaryMethod
}, null, 8, ["border", "default-sort", "store", "sum-text", "summary-method"])
],
6
/* CLASS, STYLE */
)
],
2
/* CLASS */
)), [
[vShow, !_ctx.isEmpty],
[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
]) : createCommentVNode("v-if", true),
_ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock(
"div",
{
key: 2,
class: normalizeClass(_ctx.ns.e("border-left-patch"))
},
null,
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
withDirectives(createBaseVNode(
"div",
{
ref: "resizeProxy",
class: normalizeClass(_ctx.ns.e("column-resize-proxy"))
},
null,
2
/* CLASS */
), [
[vShow, _ctx.resizeProxyVisible]
])
], 46, _hoisted_168);
}
var Table = _export_sfc(_sfc_main128, [["render", _sfc_render19]]);
// node_modules/element-plus/es/components/table/src/config.mjs
var defaultClassNames = {
selection: "table-column--selection",
expand: "table__expand-column"
};
var cellStarts = {
default: {
order: ""
},
selection: {
width: 48,
minWidth: 48,
realWidth: 48,
order: ""
},
expand: {
width: 48,
minWidth: 48,
realWidth: 48,
order: ""
},
index: {
width: 48,
minWidth: 48,
realWidth: 48,
order: ""
}
};
var getDefaultClassName = (type) => {
return defaultClassNames[type] || "";
};
var cellForced = {
selection: {
renderHeader({ store }) {
var _a;
function isDisabled() {
return store.states.data.value && store.states.data.value.length === 0;
}
return h(ElCheckbox, {
disabled: isDisabled(),
size: store.states.tableSize.value,
indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value,
"onUpdate:modelValue": (_a = store.toggleAllSelection) != null ? _a : void 0,
modelValue: store.states.isAllSelected.value,
ariaLabel: store.t("el.table.selectAllLabel")
});
},
renderCell({
row,
column: column2,
store,
$index
}) {
return h(ElCheckbox, {
disabled: column2.selectable ? !column2.selectable.call(null, row, $index) : false,
size: store.states.tableSize.value,
onChange: () => {
store.commit("rowSelectedChanged", row);
},
onClick: (event) => event.stopPropagation(),
modelValue: store.isSelected(row),
ariaLabel: store.t("el.table.selectRowLabel")
});
},
sortable: false,
resizable: false
},
index: {
renderHeader({
column: column2
}) {
return column2.label || "#";
},
renderCell({
column: column2,
$index
}) {
let i = $index + 1;
const index = column2.index;
if (isNumber(index)) {
i = $index + index;
} else if (isFunction(index)) {
i = index($index);
}
return h("div", {}, [i]);
},
sortable: false
},
expand: {
renderHeader({
column: column2
}) {
return column2.label || "";
},
renderCell({
column: column2,
row,
store,
expanded,
$index
}) {
var _a, _b, _c;
const { ns } = store;
const classes = [ns.e("expand-icon")];
if (!column2.renderExpand && expanded) {
classes.push(ns.em("expand-icon", "expanded"));
}
const callback = function(e) {
e.stopPropagation();
store.toggleRowExpansion(row);
};
const isRowExpandable = (_c = (_b = (_a = store.states.rowExpandable).value) == null ? void 0 : _b.call(_a, row, $index)) != null ? _c : true;
if (!isRowExpandable) {
classes.push(ns.is("disabled"));
}
return h(
"button",
{
type: "button",
disabled: !isRowExpandable,
"aria-label": store.t(
expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"
),
"aria-expanded": expanded,
class: classes,
onClick: callback
},
{
default: () => {
if (column2.renderExpand) {
return [
column2.renderExpand({
expanded,
expandable: isRowExpandable
})
];
}
return [
h(ElIcon, null, {
default: () => {
return [h(arrow_right_default)];
}
})
];
}
}
);
},
sortable: false,
resizable: false
}
};
function defaultRenderCell({
row,
column: column2,
$index
}) {
var _a;
const property = column2.property;
const value = property && getProp(row, property).value;
if (column2 && column2.formatter) {
return column2.formatter(row, column2, value, $index);
}
return ((_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) || "";
}
function treeCellPrefix({
row,
treeNode,
store
}, createPlaceholder = false) {
const { ns } = store;
if (!treeNode) {
if (createPlaceholder) {
return [
h("span", {
class: ns.e("placeholder")
})
];
}
return null;
}
const ele = [];
const callback = function(e) {
e.stopPropagation();
if (treeNode.loading) {
return;
}
store.loadOrToggle(row);
};
if (treeNode.indent) {
ele.push(
h("span", {
class: ns.e("indent"),
style: { "padding-left": `${treeNode.indent}px` }
})
);
}
if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) {
const expandClasses = [
ns.e("expand-icon"),
treeNode.expanded ? ns.em("expand-icon", "expanded") : ""
];
let icon = arrow_right_default;
if (treeNode.loading) {
icon = loading_default;
}
ele.push(
h(
"button",
{
type: "button",
"aria-label": store.t(
treeNode.expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"
),
"aria-expanded": treeNode.expanded,
class: expandClasses,
onClick: callback
},
{
default: () => {
return [
h(
ElIcon,
{ class: ns.is("loading", treeNode.loading) },
{
default: () => [h(icon)]
}
)
];
}
}
)
);
} else {
ele.push(
h("span", {
class: ns.e("placeholder")
})
);
}
return ele;
}
// node_modules/element-plus/es/components/table/src/table-column/watcher-helper.mjs
function getAllAliases(props2, aliases) {
return props2.reduce((prev, cur) => {
prev[cur] = cur;
return prev;
}, aliases);
}
function useWatcher2(owner, props_) {
const instance = getCurrentInstance();
const registerComplexWatchers = () => {
const props2 = ["fixed"];
const aliases = {
realWidth: "width",
realMinWidth: "minWidth"
};
const allAliases = getAllAliases(props2, aliases);
Object.keys(allAliases).forEach((key) => {
const columnKey = aliases[key];
if (hasOwn(props_, columnKey)) {
watch(
() => props_[columnKey],
(newVal) => {
let value = newVal;
if (columnKey === "width" && key === "realWidth") {
value = parseWidth(newVal);
}
if (columnKey === "minWidth" && key === "realMinWidth") {
value = parseMinWidth(newVal);
}
instance.columnConfig.value[columnKey] = value;
instance.columnConfig.value[key] = value;
const updateColumns = columnKey === "fixed";
owner.value.store.scheduleLayout(updateColumns);
}
);
}
});
};
const registerNormalWatchers = () => {
const props2 = [
"label",
"filters",
"filterMultiple",
"filteredValue",
"sortable",
"index",
"formatter",
"className",
"labelClassName",
"filterClassName",
"showOverflowTooltip",
"tooltipFormatter",
"resizable"
];
const parentProps = ["showOverflowTooltip"];
const aliases = {
property: "prop",
align: "realAlign",
headerAlign: "realHeaderAlign"
};
const allAliases = getAllAliases(props2, aliases);
Object.keys(allAliases).forEach((key) => {
const columnKey = aliases[key];
if (hasOwn(props_, columnKey)) {
watch(
() => props_[columnKey],
(newVal) => {
instance.columnConfig.value[key] = newVal;
if (key === "filters" || key === "filterMethod") {
instance.columnConfig.value["filterable"] = !!(instance.columnConfig.value["filters"] || instance.columnConfig.value["filterMethod"]);
}
}
);
}
});
parentProps.forEach((key) => {
if (hasOwn(owner.value.props, key)) {
watch(
() => owner.value.props[key],
(newVal) => {
if (instance.columnConfig.value.type === "selection") return;
if (!isUndefined(props_[key])) return;
instance.columnConfig.value[key] = newVal;
}
);
}
});
};
return {
registerComplexWatchers,
registerNormalWatchers
};
}
// node_modules/element-plus/es/components/table/src/table-column/render-helper.mjs
function useRender2(props2, slots, owner) {
const instance = getCurrentInstance();
const columnId = ref("");
const isSubColumn = ref(false);
const realAlign = ref();
const realHeaderAlign = ref();
const ns = useNamespace("table");
watchEffect(() => {
realAlign.value = props2.align ? `is-${props2.align}` : null;
realAlign.value;
});
watchEffect(() => {
realHeaderAlign.value = props2.headerAlign ? `is-${props2.headerAlign}` : realAlign.value;
realHeaderAlign.value;
});
const columnOrTableParent = computed(() => {
let parent = instance.vnode.vParent || instance.parent;
while (parent && !parent.tableId && !parent.columnId) {
parent = parent.vnode.vParent || parent.parent;
}
return parent;
});
const hasTreeColumn = computed(() => {
const { store } = instance.parent;
if (!store) return false;
const { treeData } = store.states;
const treeDataValue = treeData.value;
return treeDataValue && Object.keys(treeDataValue).length > 0;
});
const realWidth = ref(parseWidth(props2.width));
const realMinWidth = ref(parseMinWidth(props2.minWidth));
const setColumnWidth = (column2) => {
if (realWidth.value) column2.width = realWidth.value;
if (realMinWidth.value) {
column2.minWidth = realMinWidth.value;
}
if (!realWidth.value && realMinWidth.value) {
column2.width = void 0;
}
if (!column2.minWidth) {
column2.minWidth = 80;
}
column2.realWidth = Number(
isUndefined(column2.width) ? column2.minWidth : column2.width
);
return column2;
};
const setColumnForcedProps = (column2) => {
const type = column2.type;
const source = cellForced[type] || {};
Object.keys(source).forEach((prop) => {
const value = source[prop];
if (prop !== "className" && !isUndefined(value)) {
column2[prop] = value;
}
});
const className = getDefaultClassName(type);
if (className) {
const forceClass = `${unref(ns.namespace)}-${className}`;
column2.className = column2.className ? `${column2.className} ${forceClass}` : forceClass;
}
return column2;
};
const checkSubColumn = (children) => {
if (isArray(children)) {
children.forEach((child) => check(child));
} else {
check(children);
}
function check(item) {
var _a;
if (((_a = item == null ? void 0 : item.type) == null ? void 0 : _a.name) === "ElTableColumn") {
item.vParent = instance;
}
}
};
const setColumnRenders = (column2) => {
if (props2.renderHeader) {
debugWarn(
"TableColumn",
"Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."
);
} else if (column2.type !== "selection") {
column2.renderHeader = (scope) => {
instance.columnConfig.value["label"];
if (slots.header) {
const slotResult = slots.header(scope);
if (ensureValidVNode(slotResult)) {
return h(Fragment, slotResult);
}
}
return createTextVNode(column2.label);
};
}
if (slots["filter-icon"]) {
column2.renderFilterIcon = (scope) => {
return renderSlot(slots, "filter-icon", scope);
};
}
if (slots.expand) {
column2.renderExpand = (scope) => {
return renderSlot(slots, "expand", scope);
};
}
let originRenderCell = column2.renderCell;
if (column2.type === "expand") {
column2.renderCell = (data) => h(
"div",
{
class: "cell"
},
[originRenderCell(data)]
);
owner.value.renderExpanded = (row) => {
return slots.default ? slots.default(row) : slots.default;
};
} else {
originRenderCell = originRenderCell || defaultRenderCell;
column2.renderCell = (data) => {
let children = null;
if (slots.default) {
const vnodes = slots.default(data);
children = vnodes.some((v2) => v2.type !== Comment) ? vnodes : originRenderCell(data);
} else {
children = originRenderCell(data);
}
const { columns: columns2 } = owner.value.store.states;
const firstUserColumnIndex = columns2.value.findIndex(
(item) => item.type === "default"
);
const shouldCreatePlaceholder = hasTreeColumn.value && data.cellIndex === firstUserColumnIndex;
const prefix = treeCellPrefix(data, shouldCreatePlaceholder);
const props22 = {
class: "cell",
style: {}
};
if (column2.showOverflowTooltip) {
props22.class = `${props22.class} ${unref(ns.namespace)}-tooltip`;
props22.style = {
width: `${(data.column.realWidth || Number(data.column.width)) - 1}px`
};
}
checkSubColumn(children);
return h("div", props22, [prefix, children]);
};
}
return column2;
};
const getPropsData = (...propsKey) => {
return propsKey.reduce(
(prev, cur) => {
if (isArray(cur)) {
cur.forEach((key) => {
prev[key] = props2[key];
});
}
return prev;
},
{}
);
};
const getColumnElIndex = (children, child) => {
return Array.prototype.indexOf.call(children, child);
};
const updateColumnOrder = () => {
owner.value.store.commit("updateColumnOrder", instance.columnConfig.value);
};
return {
columnId,
realAlign,
isSubColumn,
realHeaderAlign,
columnOrTableParent,
setColumnWidth,
setColumnForcedProps,
setColumnRenders,
getPropsData,
getColumnElIndex,
updateColumnOrder
};
}
// node_modules/element-plus/es/components/table/src/table-column/defaults.mjs
var defaultProps4 = {
/**
* @description type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon
*/
type: {
type: String,
default: "default"
},
/**
* @description column label
*/
label: String,
/**
* @description class name of cells in the column
*/
className: String,
/**
* @description class name of the label of this column
*/
labelClassName: String,
/**
* @description
*/
property: String,
/**
* @description field name. You can also use its alias: `property`
*/
prop: String,
/**
* @description column width
*/
width: {
type: [String, Number],
default: ""
},
/**
* @description column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion
*/
minWidth: {
type: [String, Number],
default: ""
},
/**
* @description render function for table header of this column
*/
renderHeader: Function,
/**
* @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
*/
sortable: {
type: [Boolean, String],
default: false
},
/**
* @description sorting method, works when `sortable` is `true`. Should return a number, just like Array.sort
*/
sortMethod: Function,
/**
* @description specify which property to sort by, works when `sortable` is `true` and `sort-method` is `undefined`. If set to an Array, the column will sequentially sort by the next property if the previous one is equal
*/
sortBy: [String, Function, Array],
/**
* @description whether column width can be resized, works when `border` of `el-table` is `true`
*/
resizable: {
type: Boolean,
default: true
},
/**
* @description column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered
*/
columnKey: String,
/**
* @description alignment, the value should be 'left' \/ 'center' \/ 'right'
*/
align: String,
/**
* @description alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \/ 'center' \/ 'right'
*/
headerAlign: String,
/**
* @description whether to hide extra content and show them in a tooltip when hovering on the cell
*/
showOverflowTooltip: {
type: [Boolean, Object],
default: void 0
},
/**
* @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
*/
tooltipFormatter: Function,
/**
* @description whether column is fixed at left / right. Will be fixed at left if `true`
*/
fixed: [Boolean, String],
/**
* @description function that formats cell content
*/
formatter: Function,
/**
* @description function that determines if a certain row can be selected, works when `type` is 'selection'
*/
selectable: Function,
/**
* @description whether to reserve selection after data refreshing, works when `type` is 'selection'. Note that `row-key` is required for this to work
*/
reserveSelection: Boolean,
/**
* @description data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true`
*/
filterMethod: Function,
/**
* @description filter value for selected data, might be useful when table header is rendered with `render-header`
*/
filteredValue: Array,
/**
* @description an array of data filtering options. For each element in this array, `text` and `value` are required
*/
filters: Array,
/**
* @description placement for the filter dropdown
*/
filterPlacement: String,
/**
* @description whether data filtering supports multiple options
*/
filterMultiple: {
type: Boolean,
default: true
},
/**
* @description className for the filter dropdown
*/
filterClassName: String,
/**
* @description customize indices for each row, works on columns with `type=index`
*/
index: [Number, Function],
/**
* @description the order of the sorting strategies used when sorting the data, works when `sortable` is `true`. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the array
*/
sortOrders: {
type: Array,
default: () => {
return ["ascending", "descending", null];
},
validator: (val) => {
return val.every(
(order) => ["ascending", "descending", null].includes(order)
);
}
}
};
// node_modules/element-plus/es/components/table/src/table-column/index.mjs
var columnIdSeed = 1;
var ElTableColumn = defineComponent({
name: "ElTableColumn",
components: {
ElCheckbox
},
props: defaultProps4,
setup(props2, { slots }) {
const instance = getCurrentInstance();
const columnConfig = ref({});
const owner = computed(() => {
let parent2 = instance.parent;
while (parent2 && !parent2.tableId) {
parent2 = parent2.parent;
}
return parent2;
});
const { registerNormalWatchers, registerComplexWatchers } = useWatcher2(
owner,
props2
);
const {
columnId,
isSubColumn,
realHeaderAlign,
columnOrTableParent,
setColumnWidth,
setColumnForcedProps,
setColumnRenders,
getPropsData,
getColumnElIndex,
realAlign,
updateColumnOrder
} = useRender2(props2, slots, owner);
const parent = columnOrTableParent.value;
columnId.value = `${"tableId" in parent && parent.tableId || "columnId" in parent && parent.columnId}_column_${columnIdSeed++}`;
onBeforeMount(() => {
isSubColumn.value = owner.value !== parent;
const type = props2.type || "default";
const sortable = props2.sortable === "" ? true : props2.sortable;
const showOverflowTooltip = type === "selection" ? false : isUndefined(props2.showOverflowTooltip) ? parent.props.showOverflowTooltip : props2.showOverflowTooltip;
const tooltipFormatter = isUndefined(props2.tooltipFormatter) ? parent.props.tooltipFormatter : props2.tooltipFormatter;
const defaults = {
...cellStarts[type],
id: columnId.value,
type,
property: props2.prop || props2.property,
align: realAlign,
headerAlign: realHeaderAlign,
showOverflowTooltip,
tooltipFormatter,
// filter 相关属性
filterable: props2.filters || props2.filterMethod,
filteredValue: [],
filterPlacement: "",
filterClassName: "",
isColumnGroup: false,
isSubColumn: false,
filterOpened: false,
// sort 相关属性
sortable,
// index 列
index: props2.index,
//
rawColumnKey: instance.vnode.key
};
const basicProps = [
"columnKey",
"label",
"className",
"labelClassName",
"type",
"renderHeader",
"formatter",
"fixed",
"resizable"
];
const sortProps = ["sortMethod", "sortBy", "sortOrders"];
const selectProps2 = ["selectable", "reserveSelection"];
const filterProps = [
"filterMethod",
"filters",
"filterMultiple",
"filterOpened",
"filteredValue",
"filterPlacement",
"filterClassName"
];
let column2 = getPropsData(basicProps, sortProps, selectProps2, filterProps);
column2 = mergeOptions(defaults, column2);
const chains = compose(
setColumnRenders,
setColumnWidth,
setColumnForcedProps
);
column2 = chains(column2);
columnConfig.value = column2;
registerNormalWatchers();
registerComplexWatchers();
});
onMounted(() => {
var _a, _b;
const parent2 = columnOrTableParent.value;
const children = isSubColumn.value ? (_a = parent2.vnode.el) == null ? void 0 : _a.children : (_b = parent2.refs.hiddenColumns) == null ? void 0 : _b.children;
const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el);
columnConfig.value.getColumnIndex = getColumnIndex;
const columnIndex = getColumnIndex();
columnIndex > -1 && owner.value.store.commit(
"insertColumn",
columnConfig.value,
isSubColumn.value ? "columnConfig" in parent2 && parent2.columnConfig.value : null,
updateColumnOrder
);
});
onBeforeUnmount(() => {
const getColumnIndex = columnConfig.value.getColumnIndex;
const columnIndex = getColumnIndex ? getColumnIndex() : -1;
columnIndex > -1 && owner.value.store.commit(
"removeColumn",
columnConfig.value,
isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null,
updateColumnOrder
);
});
instance.columnId = columnId.value;
instance.columnConfig = columnConfig;
return;
},
render() {
var _a, _b, _c;
try {
const renderDefault = (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, {
row: {},
column: {},
$index: -1
});
const children = [];
if (isArray(renderDefault)) {
for (const childNode of renderDefault) {
if (((_c = childNode.type) == null ? void 0 : _c.name) === "ElTableColumn" || childNode.shapeFlag & 2) {
children.push(childNode);
} else if (childNode.type === Fragment && isArray(childNode.children)) {
childNode.children.forEach((vnode2) => {
if ((vnode2 == null ? void 0 : vnode2.patchFlag) !== 1024 && !isString(vnode2 == null ? void 0 : vnode2.children)) {
children.push(vnode2);
}
});
}
}
}
const vnode = h("div", children);
return vnode;
} catch (e) {
return h("div", []);
}
}
});
// node_modules/element-plus/es/components/table/index.mjs
var ElTable = withInstall(Table, {
TableColumn: ElTableColumn
});
var ElTableColumn2 = withNoopInstall(ElTableColumn);
// node_modules/element-plus/es/components/table-v2/src/constants.mjs
var SortOrder = ((SortOrder2) => {
SortOrder2["ASC"] = "asc";
SortOrder2["DESC"] = "desc";
return SortOrder2;
})(SortOrder || {});
var Alignment = ((Alignment2) => {
Alignment2["LEFT"] = "left";
Alignment2["CENTER"] = "center";
Alignment2["RIGHT"] = "right";
return Alignment2;
})(Alignment || {});
var FixedDir = ((FixedDir2) => {
FixedDir2["LEFT"] = "left";
FixedDir2["RIGHT"] = "right";
return FixedDir2;
})(FixedDir || {});
var oppositeOrderMap = {
[
"asc"
/* ASC */
]: "desc",
[
"desc"
/* DESC */
]: "asc"
/* ASC */
};
// node_modules/element-plus/es/components/table-v2/src/private.mjs
var placeholderSign = /* @__PURE__ */ Symbol("placeholder");
// node_modules/element-plus/es/components/table-v2/src/composables/utils.mjs
var calcColumnStyle = (column2, fixedColumn, fixed) => {
var _a, _b, _c;
const flex = {
flexGrow: 0,
flexShrink: 0,
...fixed ? {} : {
flexGrow: (_a = column2.flexGrow) != null ? _a : 0,
flexShrink: (_b = column2.flexShrink) != null ? _b : 1
}
};
const style = {
...(_c = column2.style) != null ? _c : {},
...flex,
flexBasis: "auto",
width: column2.width
};
if (!fixedColumn) {
if (column2.maxWidth) style.maxWidth = column2.maxWidth;
if (column2.minWidth) style.minWidth = column2.minWidth;
}
return style;
};
// node_modules/element-plus/es/components/table-v2/src/composables/use-columns.mjs
function useColumns(props2, columns2, fixed) {
const _columns = computed(
() => unref(columns2).map((column2, index) => {
var _a, _b;
return {
...column2,
key: (_b = (_a = column2.key) != null ? _a : column2.dataKey) != null ? _b : index
};
})
);
const visibleColumns = computed(() => {
return unref(_columns).filter((column2) => !column2.hidden);
});
const fixedColumnsOnLeft = computed(
() => unref(visibleColumns).filter(
(column2) => column2.fixed === "left" || column2.fixed === true
)
);
const fixedColumnsOnRight = computed(
() => unref(visibleColumns).filter((column2) => column2.fixed === "right")
);
const normalColumns = computed(
() => unref(visibleColumns).filter((column2) => !column2.fixed)
);
const mainColumns = computed(() => {
const ret = [];
unref(fixedColumnsOnLeft).forEach((column2) => {
ret.push({
...column2,
placeholderSign
});
});
unref(normalColumns).forEach((column2) => {
ret.push(column2);
});
unref(fixedColumnsOnRight).forEach((column2) => {
ret.push({
...column2,
placeholderSign
});
});
return ret;
});
const hasFixedColumns = computed(() => {
return unref(fixedColumnsOnLeft).length || unref(fixedColumnsOnRight).length;
});
const columnsStyles = computed(() => {
return unref(_columns).reduce(
(style, column2) => {
style[column2.key] = calcColumnStyle(column2, unref(fixed), props2.fixed);
return style;
},
{}
);
});
const columnsTotalWidth = computed(() => {
return unref(visibleColumns).reduce(
(width, column2) => width + column2.width,
0
);
});
const getColumn = (key) => {
return unref(_columns).find((column2) => column2.key === key);
};
const getColumnStyle = (key) => {
return unref(columnsStyles)[key];
};
const updateColumnWidth = (column2, width) => {
column2.width = width;
};
function onColumnSorted(e) {
var _a;
const { key } = e.currentTarget.dataset;
if (!key) return;
const { sortState, sortBy } = props2;
let order = SortOrder.ASC;
if (isObject(sortState)) {
order = oppositeOrderMap[sortState[key]];
} else {
order = oppositeOrderMap[sortBy.order];
}
(_a = props2.onColumnSort) == null ? void 0 : _a.call(props2, { column: getColumn(key), key, order });
}
return {
columns: _columns,
columnsStyles,
columnsTotalWidth,
fixedColumnsOnLeft,
fixedColumnsOnRight,
hasFixedColumns,
mainColumns,
normalColumns,
visibleColumns,
getColumn,
getColumnStyle,
updateColumnWidth,
onColumnSorted
};
}
// node_modules/element-plus/es/components/table-v2/src/composables/use-scrollbar.mjs
var useScrollbar2 = (props2, {
mainTableRef,
leftTableRef,
rightTableRef,
onMaybeEndReached
}) => {
const scrollPos = ref({ scrollLeft: 0, scrollTop: 0 });
function doScroll(params) {
var _a, _b, _c;
const { scrollTop } = params;
(_a = mainTableRef.value) == null ? void 0 : _a.scrollTo(params);
(_b = leftTableRef.value) == null ? void 0 : _b.scrollToTop(scrollTop);
(_c = rightTableRef.value) == null ? void 0 : _c.scrollToTop(scrollTop);
}
function scrollTo2(params) {
scrollPos.value = params;
doScroll(params);
}
function scrollToTop(scrollTop) {
scrollPos.value.scrollTop = scrollTop;
doScroll(unref(scrollPos));
}
function scrollToLeft(scrollLeft) {
var _a, _b;
scrollPos.value.scrollLeft = scrollLeft;
(_b = (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, unref(scrollPos));
}
function onScroll(params) {
var _a;
scrollTo2(params);
(_a = props2.onScroll) == null ? void 0 : _a.call(props2, params);
}
function onVerticalScroll({ scrollTop }) {
const { scrollTop: currentScrollTop } = unref(scrollPos);
if (scrollTop !== currentScrollTop) scrollToTop(scrollTop);
}
function scrollToRow(row, strategy = "auto") {
var _a;
(_a = mainTableRef.value) == null ? void 0 : _a.scrollToRow(row, strategy);
}
watch(
() => unref(scrollPos).scrollTop,
(cur, prev) => {
if (cur > prev) onMaybeEndReached();
}
);
return {
scrollPos,
scrollTo: scrollTo2,
scrollToLeft,
scrollToTop,
scrollToRow,
onScroll,
onVerticalScroll
};
};
// node_modules/element-plus/es/components/table-v2/src/composables/use-row.mjs
var useRow = (props2, {
mainTableRef,
leftTableRef,
rightTableRef,
tableInstance,
ns,
isScrolling
}) => {
const vm = getCurrentInstance();
const { emit } = vm;
const isResetting = shallowRef(false);
const expandedRowKeys = ref(props2.defaultExpandedRowKeys || []);
const lastRenderedRowIndex = ref(-1);
const resetIndex = shallowRef(null);
const rowHeights = ref({});
const pendingRowHeights = ref({});
const leftTableHeights = shallowRef({});
const mainTableHeights = shallowRef({});
const rightTableHeights = shallowRef({});
const isDynamic = computed(() => isNumber(props2.estimatedRowHeight));
function onRowsRendered(params) {
var _a;
(_a = props2.onRowsRendered) == null ? void 0 : _a.call(props2, params);
if (params.rowCacheEnd > unref(lastRenderedRowIndex)) {
lastRenderedRowIndex.value = params.rowCacheEnd;
}
}
function onRowHovered({ hovered, rowKey: rowKey2 }) {
if (isScrolling.value) {
return;
}
const tableRoot = tableInstance.vnode.el;
const rows = tableRoot.querySelectorAll(`[rowkey="${String(rowKey2)}"]`);
rows.forEach((row) => {
if (hovered) {
row.classList.add(ns.is("hovered"));
} else {
row.classList.remove(ns.is("hovered"));
}
});
}
function onRowExpanded({
expanded,
rowData,
rowIndex,
rowKey: rowKey2
}) {
var _a, _b;
const _expandedRowKeys = [...unref(expandedRowKeys)];
const currentKeyIndex = _expandedRowKeys.indexOf(rowKey2);
if (expanded) {
if (currentKeyIndex === -1) _expandedRowKeys.push(rowKey2);
} else {
if (currentKeyIndex > -1) _expandedRowKeys.splice(currentKeyIndex, 1);
}
expandedRowKeys.value = _expandedRowKeys;
emit("update:expandedRowKeys", _expandedRowKeys);
(_a = props2.onRowExpand) == null ? void 0 : _a.call(props2, {
expanded,
rowData,
rowIndex,
rowKey: rowKey2
});
(_b = props2.onExpandedRowsChange) == null ? void 0 : _b.call(props2, _expandedRowKeys);
const tableRoot = tableInstance.vnode.el;
const hoverRow = tableRoot.querySelector(
`.${ns.is("hovered")}[rowkey="${String(rowKey2)}"]`
);
if (hoverRow) {
nextTick(() => onRowHovered({ hovered: true, rowKey: rowKey2 }));
}
}
const flushingRowHeights = debounce_default(() => {
var _a, _b, _c, _d;
isResetting.value = true;
rowHeights.value = { ...unref(rowHeights), ...unref(pendingRowHeights) };
resetAfterIndex(unref(resetIndex), false);
pendingRowHeights.value = {};
resetIndex.value = null;
(_a = mainTableRef.value) == null ? void 0 : _a.forceUpdate();
(_b = leftTableRef.value) == null ? void 0 : _b.forceUpdate();
(_c = rightTableRef.value) == null ? void 0 : _c.forceUpdate();
(_d = vm.proxy) == null ? void 0 : _d.$forceUpdate();
isResetting.value = false;
}, 0);
function resetAfterIndex(index, forceUpdate = false) {
if (!unref(isDynamic)) return;
[mainTableRef, leftTableRef, rightTableRef].forEach((tableRef) => {
const table = unref(tableRef);
if (table) table.resetAfterRowIndex(index, forceUpdate);
});
}
function resetHeights(rowKey2, height, rowIdx) {
const resetIdx = unref(resetIndex);
if (resetIdx === null) {
resetIndex.value = rowIdx;
} else {
if (resetIdx > rowIdx) {
resetIndex.value = rowIdx;
}
}
pendingRowHeights.value[rowKey2] = height;
}
function onRowHeightChange({ rowKey: rowKey2, height, rowIndex }, fixedDir) {
if (!fixedDir) {
mainTableHeights.value[rowKey2] = height;
} else {
if (fixedDir === FixedDir.RIGHT) {
rightTableHeights.value[rowKey2] = height;
} else {
leftTableHeights.value[rowKey2] = height;
}
}
const maximumHeight = Math.max(
...[leftTableHeights, rightTableHeights, mainTableHeights].map(
(records) => records.value[rowKey2] || 0
)
);
if (unref(rowHeights)[rowKey2] !== maximumHeight) {
resetHeights(rowKey2, maximumHeight, rowIndex);
flushingRowHeights();
}
}
return {
expandedRowKeys,
lastRenderedRowIndex,
isDynamic,
isResetting,
rowHeights,
resetAfterIndex,
onRowExpanded,
onRowHovered,
onRowsRendered,
onRowHeightChange
};
};
// node_modules/element-plus/es/components/table-v2/src/composables/use-data.mjs
var useData = (props2, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
const depthMap = ref({});
const flattenedData = computed(() => {
const depths = {};
const { data: data2, rowKey: rowKey2 } = props2;
const _expandedRowKeys = unref(expandedRowKeys);
if (!_expandedRowKeys || !_expandedRowKeys.length) return data2;
const array = [];
const keysSet = /* @__PURE__ */ new Set();
_expandedRowKeys.forEach((x2) => keysSet.add(x2));
let copy = data2.slice();
copy.forEach((x2) => depths[x2[rowKey2]] = 0);
while (copy.length > 0) {
const item = copy.shift();
array.push(item);
if (keysSet.has(item[rowKey2]) && isArray(item.children) && item.children.length > 0) {
copy = [...item.children, ...copy];
item.children.forEach(
(child) => depths[child[rowKey2]] = depths[item[rowKey2]] + 1
);
}
}
depthMap.value = depths;
return array;
});
const data = computed(() => {
const { data: data2, expandColumnKey: expandColumnKey2 } = props2;
return expandColumnKey2 ? unref(flattenedData) : data2;
});
watch(data, (val, prev) => {
if (val !== prev) {
lastRenderedRowIndex.value = -1;
resetAfterIndex(0, true);
}
});
return {
data,
depthMap
};
};
// node_modules/element-plus/es/components/table-v2/src/utils.mjs
var sumReducer = (sum2, num) => sum2 + num;
var sum = (listLike) => {
return isArray(listLike) ? listLike.reduce(sumReducer, 0) : listLike;
};
var tryCall = (fLike, params, defaultRet = {}) => {
return isFunction(fLike) ? fLike(params) : fLike != null ? fLike : defaultRet;
};
var enforceUnit = (style) => {
["width", "maxWidth", "minWidth", "height"].forEach((key) => {
style[key] = addUnit(style[key]);
});
return style;
};
var componentToSlot = (ComponentLike) => isVNode(ComponentLike) ? (props2) => h(ComponentLike, props2) : ComponentLike;
// node_modules/element-plus/es/components/table-v2/src/composables/use-styles.mjs
var useStyles2 = (props2, {
columnsTotalWidth,
rowsHeight,
fixedColumnsOnLeft,
fixedColumnsOnRight
}) => {
const bodyWidth = computed(() => {
const { fixed, width, vScrollbarSize } = props2;
const ret = width - vScrollbarSize;
return fixed ? Math.max(Math.round(unref(columnsTotalWidth)), ret) : ret;
});
const mainTableHeight = computed(() => {
const { height = 0, maxHeight = 0, footerHeight: footerHeight2, hScrollbarSize } = props2;
if (maxHeight > 0) {
const _fixedRowsHeight = unref(fixedRowsHeight);
const _rowsHeight = unref(rowsHeight);
const _headerHeight = unref(headerHeight);
const total2 = _headerHeight + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
return Math.min(total2, maxHeight - footerHeight2);
}
return height - footerHeight2;
});
const fixedTableHeight = computed(() => {
const { maxHeight } = props2;
const tableHeight = unref(mainTableHeight);
if (isNumber(maxHeight) && maxHeight > 0) return tableHeight;
const totalHeight = unref(rowsHeight) + unref(headerHeight) + unref(fixedRowsHeight);
return Math.min(tableHeight, totalHeight);
});
const mapColumn = (column2) => column2.width;
const leftTableWidth = computed(
() => sum(unref(fixedColumnsOnLeft).map(mapColumn))
);
const rightTableWidth = computed(
() => sum(unref(fixedColumnsOnRight).map(mapColumn))
);
const headerHeight = computed(() => sum(props2.headerHeight));
const fixedRowsHeight = computed(() => {
var _a;
return (((_a = props2.fixedData) == null ? void 0 : _a.length) || 0) * props2.rowHeight;
});
const windowHeight = computed(() => {
return unref(mainTableHeight) - unref(headerHeight) - unref(fixedRowsHeight);
});
const rootStyle = computed(() => {
const { style = {}, height, width } = props2;
return enforceUnit({
...style,
height,
width
});
});
const footerHeight = computed(
() => enforceUnit({ height: props2.footerHeight })
);
const emptyStyle = computed(() => ({
top: addUnit(unref(headerHeight)),
bottom: addUnit(props2.footerHeight),
width: addUnit(props2.width)
}));
return {
bodyWidth,
fixedTableHeight,
mainTableHeight,
leftTableWidth,
rightTableWidth,
windowHeight,
footerHeight,
emptyStyle,
rootStyle,
headerHeight
};
};
// node_modules/element-plus/es/components/table-v2/src/use-table.mjs
function useTable(props2) {
const mainTableRef = ref();
const leftTableRef = ref();
const rightTableRef = ref();
const {
columns: columns2,
columnsStyles,
columnsTotalWidth,
fixedColumnsOnLeft,
fixedColumnsOnRight,
hasFixedColumns,
mainColumns,
onColumnSorted
} = useColumns(props2, toRef(props2, "columns"), toRef(props2, "fixed"));
const {
scrollTo: scrollTo2,
scrollToLeft,
scrollToTop,
scrollToRow,
onScroll,
onVerticalScroll,
scrollPos
} = useScrollbar2(props2, {
mainTableRef,
leftTableRef,
rightTableRef,
onMaybeEndReached
});
const ns = useNamespace("table-v2");
const instance = getCurrentInstance();
const isScrolling = shallowRef(false);
const {
expandedRowKeys,
lastRenderedRowIndex,
isDynamic,
isResetting,
rowHeights,
resetAfterIndex,
onRowExpanded,
onRowHeightChange,
onRowHovered,
onRowsRendered
} = useRow(props2, {
mainTableRef,
leftTableRef,
rightTableRef,
tableInstance: instance,
ns,
isScrolling
});
const { data, depthMap } = useData(props2, {
expandedRowKeys,
lastRenderedRowIndex,
resetAfterIndex
});
const rowsHeight = computed(() => {
const { estimatedRowHeight, rowHeight } = props2;
const _data = unref(data);
if (isNumber(estimatedRowHeight)) {
return Object.values(unref(rowHeights)).reduce(
(acc, curr) => acc + curr,
0
);
}
return _data.length * rowHeight;
});
const {
bodyWidth,
fixedTableHeight,
mainTableHeight,
leftTableWidth,
rightTableWidth,
windowHeight,
footerHeight,
emptyStyle,
rootStyle,
headerHeight
} = useStyles2(props2, {
columnsTotalWidth,
fixedColumnsOnLeft,
fixedColumnsOnRight,
rowsHeight
});
const containerRef = ref();
const showEmpty = computed(() => {
const noData = unref(data).length === 0;
return isArray(props2.fixedData) ? props2.fixedData.length === 0 && noData : noData;
});
function getRowHeight(rowIndex) {
const { estimatedRowHeight, rowHeight, rowKey: rowKey2 } = props2;
if (!estimatedRowHeight) return rowHeight;
return unref(rowHeights)[unref(data)[rowIndex][rowKey2]] || estimatedRowHeight;
}
const isEndReached = ref(false);
function onMaybeEndReached() {
const { onEndReached } = props2;
if (!onEndReached) return;
const { scrollTop } = unref(scrollPos);
const _totalHeight = unref(rowsHeight);
const clientHeight = unref(windowHeight);
const remainDistance = _totalHeight - (scrollTop + clientHeight) + props2.hScrollbarSize;
if (!isEndReached.value && unref(lastRenderedRowIndex) >= 0 && _totalHeight <= scrollTop + unref(mainTableHeight) - unref(headerHeight)) {
isEndReached.value = true;
onEndReached(remainDistance);
} else {
isEndReached.value = false;
}
}
watch(
() => unref(rowsHeight),
() => isEndReached.value = false
);
watch(
() => props2.expandedRowKeys,
(val) => expandedRowKeys.value = val,
{
deep: true
}
);
return {
// models
columns: columns2,
containerRef,
mainTableRef,
leftTableRef,
rightTableRef,
// states
isDynamic,
isResetting,
isScrolling,
hasFixedColumns,
// records
columnsStyles,
columnsTotalWidth,
data,
expandedRowKeys,
depthMap,
fixedColumnsOnLeft,
fixedColumnsOnRight,
mainColumns,
// metadata
bodyWidth,
emptyStyle,
rootStyle,
footerHeight,
mainTableHeight,
fixedTableHeight,
leftTableWidth,
rightTableWidth,
// flags
showEmpty,
// methods
getRowHeight,
// event handlers
onColumnSorted,
onRowHovered,
onRowExpanded,
onRowsRendered,
onRowHeightChange,
// use scrollbars
scrollTo: scrollTo2,
scrollToLeft,
scrollToTop,
scrollToRow,
onScroll,
onVerticalScroll
};
}
// node_modules/element-plus/es/components/table-v2/src/tokens.mjs
var TableV2InjectionKey = /* @__PURE__ */ Symbol("tableV2");
var TABLE_V2_GRID_INJECTION_KEY = "tableV2GridScrollLeft";
// node_modules/element-plus/es/components/table-v2/src/common.mjs
var classType = String;
var columns = {
type: definePropType(Array),
required: true
};
var column = {
type: definePropType(Object)
};
var fixedDataType = {
type: definePropType(Array)
};
var dataType = {
...fixedDataType,
required: true
};
var expandColumnKey = String;
var expandKeys = {
type: definePropType(Array),
default: () => mutable([])
};
var requiredNumber = {
type: Number,
required: true
};
var rowKey = {
type: definePropType([String, Number, Symbol]),
default: "id"
};
var styleType = {
type: definePropType(Object)
};
// node_modules/element-plus/es/components/table-v2/src/row.mjs
var tableV2RowProps = buildProps({
class: String,
columns,
columnsStyles: {
type: definePropType(Object),
required: true
},
depth: Number,
expandColumnKey,
estimatedRowHeight: {
...virtualizedGridProps.estimatedRowHeight,
default: void 0
},
isScrolling: Boolean,
onRowExpand: {
type: definePropType(Function)
},
onRowHover: {
type: definePropType(Function)
},
onRowHeightChange: {
type: definePropType(Function)
},
rowData: {
type: definePropType(Object),
required: true
},
rowEventHandlers: {
type: definePropType(Object)
},
rowIndex: {
type: Number,
required: true
},
/**
* Unique item key
*/
rowKey,
style: {
type: definePropType(Object)
}
});
// node_modules/element-plus/es/components/table-v2/src/header.mjs
var requiredNumberType = {
type: Number,
required: true
};
var tableV2HeaderProps = buildProps({
class: String,
columns,
fixedHeaderData: {
type: definePropType(Array)
},
headerData: {
type: definePropType(Array),
required: true
},
headerHeight: {
type: definePropType([Number, Array]),
default: 50
},
rowWidth: requiredNumberType,
rowHeight: {
type: Number,
default: 50
},
height: requiredNumberType,
width: requiredNumberType
});
// node_modules/element-plus/es/components/table-v2/src/grid.mjs
var tableV2GridProps = buildProps({
columns,
data: dataType,
fixedData: fixedDataType,
estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
/**
* Size related attributes
*/
width: requiredNumber,
height: requiredNumber,
headerWidth: requiredNumber,
headerHeight: tableV2HeaderProps.headerHeight,
bodyWidth: requiredNumber,
rowHeight: requiredNumber,
/**
* Special attributes
*/
cache: virtualizedListProps.cache,
useIsScrolling: Boolean,
scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,
scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,
scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,
/**
* CSS attributes
*/
class: classType,
style: styleType,
containerStyle: styleType,
getRowHeight: {
type: definePropType(Function),
required: true
},
rowKey: tableV2RowProps.rowKey,
/**
* Event handlers
*/
onRowsRendered: {
type: definePropType(Function)
},
onScroll: {
type: definePropType(Function)
}
});
// node_modules/element-plus/es/components/table-v2/src/table.mjs
var tableV2Props = buildProps({
cache: tableV2GridProps.cache,
estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
rowKey,
// Header attributes
headerClass: {
type: definePropType([
String,
Function
])
},
headerProps: {
type: definePropType([
Object,
Function
])
},
headerCellProps: {
type: definePropType([
Object,
Function
])
},
headerHeight: tableV2HeaderProps.headerHeight,
/**
* Footer attributes
*/
footerHeight: {
type: Number,
default: 0
},
/**
* Row attributes
*/
rowClass: {
type: definePropType([String, Function])
},
rowProps: {
type: definePropType([Object, Function])
},
rowHeight: {
type: Number,
default: 50
},
/**
* Cell attributes
*/
cellProps: {
type: definePropType([
Object,
Function
])
},
/**
* Data models
*/
columns,
data: dataType,
dataGetter: {
type: definePropType(Function)
},
fixedData: fixedDataType,
/**
* Expanded keys
*/
expandColumnKey: tableV2RowProps.expandColumnKey,
expandedRowKeys: expandKeys,
defaultExpandedRowKeys: expandKeys,
/**
* Attributes
*/
class: classType,
// disabled: Boolean,
fixed: Boolean,
style: {
type: definePropType(Object)
},
width: requiredNumber,
height: requiredNumber,
maxHeight: Number,
useIsScrolling: Boolean,
indentSize: {
type: Number,
default: 12
},
iconSize: {
type: Number,
default: 12
},
hScrollbarSize: virtualizedGridProps.hScrollbarSize,
vScrollbarSize: virtualizedGridProps.vScrollbarSize,
scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,
/**
* Sorting
*/
sortBy: {
type: definePropType(Object),
default: () => ({})
},
sortState: {
type: definePropType(Object),
default: void 0
},
/**
* Handlers
*/
onColumnSort: {
type: definePropType(Function)
},
onExpandedRowsChange: {
type: definePropType(Function)
},
onEndReached: {
type: definePropType(Function)
},
onRowExpand: tableV2RowProps.onRowExpand,
onScroll: tableV2GridProps.onScroll,
onRowsRendered: tableV2GridProps.onRowsRendered,
rowEventHandlers: tableV2RowProps.rowEventHandlers
});
// node_modules/element-plus/es/components/virtual-list/src/hooks/use-grid-wheel.mjs
var useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => {
let frameHandle = null;
let xOffset = 0;
let yOffset = 0;
const hasReachedEdge = (x2, y) => {
const xEdgeReached = x2 < 0 && atXStartEdge.value || x2 > 0 && atXEndEdge.value;
const yEdgeReached = y < 0 && atYStartEdge.value || y > 0 && atYEndEdge.value;
return xEdgeReached || yEdgeReached;
};
const onWheel = (e) => {
cAF(frameHandle);
let x2 = e.deltaX;
let y = e.deltaY;
if (Math.abs(x2) > Math.abs(y)) {
y = 0;
} else {
x2 = 0;
}
if (e.shiftKey && y !== 0) {
x2 = y;
y = 0;
}
if (hasReachedEdge(x2, y)) return;
xOffset += x2;
yOffset += y;
e.preventDefault();
frameHandle = rAF(() => {
onWheelDelta(xOffset, yOffset);
xOffset = 0;
yOffset = 0;
});
};
return {
hasReachedEdge,
onWheel
};
};
// node_modules/element-plus/es/components/virtual-list/src/hooks/use-grid-touch.mjs
var useGridTouch = (windowRef, states, scrollTo2, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight) => {
const touchStartX = ref(0);
const touchStartY = ref(0);
let frameHandle;
let deltaX = 0;
let deltaY = 0;
const handleTouchStart = (event) => {
cAF(frameHandle);
touchStartX.value = event.touches[0].clientX;
touchStartY.value = event.touches[0].clientY;
deltaX = 0;
deltaY = 0;
};
const handleTouchMove = (event) => {
event.preventDefault();
cAF(frameHandle);
deltaX += touchStartX.value - event.touches[0].clientX;
deltaY += touchStartY.value - event.touches[0].clientY;
touchStartX.value = event.touches[0].clientX;
touchStartY.value = event.touches[0].clientY;
frameHandle = rAF(() => {
const maxScrollLeft = estimatedTotalWidth.value - unref(parsedWidth);
const maxScrollTop = estimatedTotalHeight.value - unref(parsedHeight);
const safeScrollLeft = Math.min(
states.value.scrollLeft + deltaX,
maxScrollLeft
);
const safeScrollTop = Math.min(
states.value.scrollTop + deltaY,
maxScrollTop
);
scrollTo2({
scrollLeft: safeScrollLeft,
scrollTop: safeScrollTop
});
deltaX = 0;
deltaY = 0;
});
};
useEventListener(windowRef, "touchstart", handleTouchStart, {
passive: true
});
useEventListener(windowRef, "touchmove", handleTouchMove, {
passive: false
});
return {
touchStartX,
touchStartY,
handleTouchStart,
handleTouchMove
};
};
// node_modules/element-plus/es/components/virtual-list/src/builders/build-grid.mjs
var createGrid = ({
name,
clearCache,
getColumnPosition,
getColumnStartIndexForOffset,
getColumnStopIndexForStartIndex,
getEstimatedTotalHeight: getEstimatedTotalHeight2,
getEstimatedTotalWidth: getEstimatedTotalWidth2,
getColumnOffset,
getRowOffset,
getRowPosition,
getRowStartIndexForOffset,
getRowStopIndexForStartIndex,
initCache,
injectToInstance,
validateProps
}) => {
return defineComponent({
name: name != null ? name : "ElVirtualList",
props: virtualizedGridProps,
emits: [ITEM_RENDER_EVT, SCROLL_EVT],
setup(props2, { emit, expose, slots }) {
const ns = useNamespace("vl");
validateProps(props2);
const instance = getCurrentInstance();
const cache2 = ref(initCache(props2, instance));
injectToInstance == null ? void 0 : injectToInstance(instance, cache2);
const windowRef = ref();
const hScrollbar = ref();
const vScrollbar = ref();
const innerRef = ref();
const states = ref({
isScrolling: false,
scrollLeft: isNumber(props2.initScrollLeft) ? props2.initScrollLeft : 0,
scrollTop: isNumber(props2.initScrollTop) ? props2.initScrollTop : 0,
updateRequested: false,
xAxisScrollDir: FORWARD,
yAxisScrollDir: FORWARD
});
const getItemStyleCache = useCache();
const parsedHeight = computed(
() => Number.parseInt(`${props2.height}`, 10)
);
const parsedWidth = computed(() => Number.parseInt(`${props2.width}`, 10));
const columnsToRender = computed(() => {
const { totalColumn, totalRow, columnCache } = props2;
const { isScrolling, xAxisScrollDir, scrollLeft } = unref(states);
if (totalColumn === 0 || totalRow === 0) {
return [0, 0, 0, 0];
}
const startIndex = getColumnStartIndexForOffset(
props2,
scrollLeft,
unref(cache2)
);
const stopIndex = getColumnStopIndexForStartIndex(
props2,
startIndex,
scrollLeft,
unref(cache2)
);
const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1;
const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1;
return [
Math.max(0, startIndex - cacheBackward),
Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)),
startIndex,
stopIndex
];
});
const rowsToRender = computed(() => {
const { totalColumn, totalRow, rowCache } = props2;
const { isScrolling, yAxisScrollDir, scrollTop } = unref(states);
if (totalColumn === 0 || totalRow === 0) {
return [0, 0, 0, 0];
}
const startIndex = getRowStartIndexForOffset(
props2,
scrollTop,
unref(cache2)
);
const stopIndex = getRowStopIndexForStartIndex(
props2,
startIndex,
scrollTop,
unref(cache2)
);
const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1;
const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1;
return [
Math.max(0, startIndex - cacheBackward),
Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)),
startIndex,
stopIndex
];
});
const estimatedTotalHeight = computed(
() => getEstimatedTotalHeight2(props2, unref(cache2))
);
const estimatedTotalWidth = computed(
() => getEstimatedTotalWidth2(props2, unref(cache2))
);
const windowStyle = computed(() => {
var _a;
return [
{
position: "relative",
overflow: "hidden",
WebkitOverflowScrolling: "touch",
willChange: "transform"
},
{
direction: props2.direction,
height: isNumber(props2.height) ? `${props2.height}px` : props2.height,
width: isNumber(props2.width) ? `${props2.width}px` : props2.width
},
(_a = props2.style) != null ? _a : {}
];
});
const innerStyle = computed(() => {
const width = `${unref(estimatedTotalWidth)}px`;
const height = `${unref(estimatedTotalHeight)}px`;
return {
height,
pointerEvents: unref(states).isScrolling ? "none" : void 0,
width,
// fix scrolling issues in Firefox.
margin: 0,
boxSizing: "border-box"
};
});
const emitEvents = () => {
const { totalColumn, totalRow } = props2;
if (totalColumn > 0 && totalRow > 0) {
const [
columnCacheStart,
columnCacheEnd,
columnVisibleStart,
columnVisibleEnd
] = unref(columnsToRender);
const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = unref(rowsToRender);
emit(ITEM_RENDER_EVT, {
columnCacheStart,
columnCacheEnd,
rowCacheStart,
rowCacheEnd,
columnVisibleStart,
columnVisibleEnd,
rowVisibleStart,
rowVisibleEnd
});
}
const {
scrollLeft,
scrollTop,
updateRequested,
xAxisScrollDir,
yAxisScrollDir
} = unref(states);
emit(SCROLL_EVT, {
xAxisScrollDir,
scrollLeft,
yAxisScrollDir,
scrollTop,
updateRequested
});
};
const onScroll = (e) => {
const {
clientHeight,
clientWidth,
scrollHeight,
scrollLeft,
scrollTop,
scrollWidth
} = e.currentTarget;
const _states = unref(states);
if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) {
return;
}
let _scrollLeft = scrollLeft;
if (isRTL(props2.direction)) {
switch (getRTLOffsetType()) {
case RTL_OFFSET_NAG:
_scrollLeft = -scrollLeft;
break;
case RTL_OFFSET_POS_DESC:
_scrollLeft = scrollWidth - clientWidth - scrollLeft;
break;
}
}
states.value = {
..._states,
isScrolling: true,
scrollLeft: _scrollLeft,
scrollTop: Math.max(
0,
Math.min(scrollTop, scrollHeight - clientHeight)
),
updateRequested: true,
xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft),
yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop)
};
nextTick(() => resetIsScrolling());
onUpdated2();
emitEvents();
};
const onVerticalScroll = (distance, totalSteps) => {
const height = unref(parsedHeight);
const offset3 = (estimatedTotalHeight.value - height) / totalSteps * distance;
scrollTo2({
scrollTop: Math.min(estimatedTotalHeight.value - height, offset3)
});
};
const onHorizontalScroll = (distance, totalSteps) => {
const width = unref(parsedWidth);
const offset3 = (estimatedTotalWidth.value - width) / totalSteps * distance;
scrollTo2({
scrollLeft: Math.min(estimatedTotalWidth.value - width, offset3)
});
};
const { onWheel } = useGridWheel(
{
atXStartEdge: computed(() => states.value.scrollLeft <= 0),
atXEndEdge: computed(
() => states.value.scrollLeft >= estimatedTotalWidth.value - unref(parsedWidth)
),
atYStartEdge: computed(() => states.value.scrollTop <= 0),
atYEndEdge: computed(
() => states.value.scrollTop >= estimatedTotalHeight.value - unref(parsedHeight)
)
},
(x2, y) => {
var _a, _b, _c, _d;
(_b = (_a = hScrollbar.value) == null ? void 0 : _a.onMouseUp) == null ? void 0 : _b.call(_a);
(_d = (_c = vScrollbar.value) == null ? void 0 : _c.onMouseUp) == null ? void 0 : _d.call(_c);
const width = unref(parsedWidth);
const height = unref(parsedHeight);
scrollTo2({
scrollLeft: Math.min(
states.value.scrollLeft + x2,
estimatedTotalWidth.value - width
),
scrollTop: Math.min(
states.value.scrollTop + y,
estimatedTotalHeight.value - height
)
});
}
);
useEventListener(windowRef, "wheel", onWheel, {
passive: false
});
const scrollTo2 = ({
scrollLeft = states.value.scrollLeft,
scrollTop = states.value.scrollTop
}) => {
scrollLeft = Math.max(scrollLeft, 0);
scrollTop = Math.max(scrollTop, 0);
const _states = unref(states);
if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) {
return;
}
states.value = {
..._states,
xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft),
yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop),
scrollLeft,
scrollTop,
updateRequested: true
};
nextTick(() => resetIsScrolling());
onUpdated2();
emitEvents();
};
const { touchStartX, touchStartY, handleTouchStart, handleTouchMove } = useGridTouch(
windowRef,
states,
scrollTo2,
estimatedTotalWidth,
estimatedTotalHeight,
parsedWidth,
parsedHeight
);
const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => {
const _states = unref(states);
columnIdx = Math.max(0, Math.min(columnIdx, props2.totalColumn - 1));
rowIndex = Math.max(0, Math.min(rowIndex, props2.totalRow - 1));
const scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
const _cache = unref(cache2);
const estimatedHeight = getEstimatedTotalHeight2(props2, _cache);
const estimatedWidth = getEstimatedTotalWidth2(props2, _cache);
scrollTo2({
scrollLeft: getColumnOffset(
props2,
columnIdx,
alignment,
_states.scrollLeft,
_cache,
estimatedWidth > props2.width ? scrollBarWidth2 : 0
),
scrollTop: getRowOffset(
props2,
rowIndex,
alignment,
_states.scrollTop,
_cache,
estimatedHeight > props2.height ? scrollBarWidth2 : 0
)
});
};
const getItemStyle = (rowIndex, columnIndex) => {
const { columnWidth, direction: direction2, rowHeight } = props2;
const itemStyleCache = getItemStyleCache.value(
clearCache && columnWidth,
clearCache && rowHeight,
clearCache && direction2
);
const key = `${rowIndex},${columnIndex}`;
if (hasOwn(itemStyleCache, key)) {
return itemStyleCache[key];
} else {
const [, left] = getColumnPosition(props2, columnIndex, unref(cache2));
const _cache = unref(cache2);
const rtl = isRTL(direction2);
const [height, top] = getRowPosition(props2, rowIndex, _cache);
const [width] = getColumnPosition(props2, columnIndex, _cache);
itemStyleCache[key] = {
position: "absolute",
left: rtl ? void 0 : `${left}px`,
right: rtl ? `${left}px` : void 0,
top: `${top}px`,
height: `${height}px`,
width: `${width}px`
};
return itemStyleCache[key];
}
};
const resetIsScrolling = () => {
states.value.isScrolling = false;
nextTick(() => {
getItemStyleCache.value(-1, null, null);
});
};
onMounted(() => {
if (!isClient) return;
const { initScrollLeft, initScrollTop } = props2;
const windowElement = unref(windowRef);
if (windowElement) {
if (isNumber(initScrollLeft)) {
windowElement.scrollLeft = initScrollLeft;
}
if (isNumber(initScrollTop)) {
windowElement.scrollTop = initScrollTop;
}
}
emitEvents();
});
const onUpdated2 = () => {
const { direction: direction2 } = props2;
const { scrollLeft, scrollTop, updateRequested } = unref(states);
const windowElement = unref(windowRef);
if (updateRequested && windowElement) {
if (direction2 === RTL) {
switch (getRTLOffsetType()) {
case RTL_OFFSET_NAG: {
windowElement.scrollLeft = -scrollLeft;
break;
}
case RTL_OFFSET_POS_ASC: {
windowElement.scrollLeft = scrollLeft;
break;
}
default: {
const { clientWidth, scrollWidth } = windowElement;
windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft;
break;
}
}
} else {
windowElement.scrollLeft = Math.max(0, scrollLeft);
}
windowElement.scrollTop = Math.max(0, scrollTop);
}
};
const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy;
expose({
windowRef,
innerRef,
getItemStyleCache,
touchStartX,
touchStartY,
handleTouchStart,
handleTouchMove,
scrollTo: scrollTo2,
scrollToItem,
states,
resetAfterColumnIndex,
resetAfterRowIndex,
resetAfter
});
const renderScrollbars = () => {
const {
scrollbarAlwaysOn,
scrollbarStartGap,
scrollbarEndGap,
totalColumn,
totalRow
} = props2;
const width = unref(parsedWidth);
const height = unref(parsedHeight);
const estimatedWidth = unref(estimatedTotalWidth);
const estimatedHeight = unref(estimatedTotalHeight);
const { scrollLeft, scrollTop } = unref(states);
const horizontalScrollbar = h(ScrollBar, {
ref: hScrollbar,
alwaysOn: scrollbarAlwaysOn,
startGap: scrollbarStartGap,
endGap: scrollbarEndGap,
class: ns.e("horizontal"),
clientSize: width,
layout: "horizontal",
onScroll: onHorizontalScroll,
ratio: width * 100 / estimatedWidth,
scrollFrom: scrollLeft / (estimatedWidth - width),
total: totalRow,
visible: true
});
const verticalScrollbar = h(ScrollBar, {
ref: vScrollbar,
alwaysOn: scrollbarAlwaysOn,
startGap: scrollbarStartGap,
endGap: scrollbarEndGap,
class: ns.e("vertical"),
clientSize: height,
layout: "vertical",
onScroll: onVerticalScroll,
ratio: height * 100 / estimatedHeight,
scrollFrom: scrollTop / (estimatedHeight - height),
total: totalColumn,
visible: true
});
return {
horizontalScrollbar,
verticalScrollbar
};
};
const renderItems = () => {
var _a;
const [columnStart, columnEnd] = unref(columnsToRender);
const [rowStart, rowEnd] = unref(rowsToRender);
const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props2;
const children = [];
if (totalRow > 0 && totalColumn > 0) {
for (let row = rowStart; row <= rowEnd; row++) {
for (let column2 = columnStart; column2 <= columnEnd; column2++) {
const key = itemKey({ columnIndex: column2, data, rowIndex: row });
children.push(
h(
Fragment,
{ key },
(_a = slots.default) == null ? void 0 : _a.call(slots, {
columnIndex: column2,
data,
isScrolling: useIsScrolling ? unref(states).isScrolling : void 0,
style: getItemStyle(row, column2),
rowIndex: row
})
)
);
}
}
}
return children;
};
const renderInner = () => {
const Inner = resolveDynamicComponent(props2.innerElement);
const children = renderItems();
return [
h(
Inner,
mergeProps(props2.innerProps, {
style: unref(innerStyle),
ref: innerRef
}),
!isString(Inner) ? {
default: () => children
} : children
)
];
};
const renderWindow = () => {
const Container = resolveDynamicComponent(
props2.containerElement
);
const { horizontalScrollbar, verticalScrollbar } = renderScrollbars();
const Inner = renderInner();
return h(
"div",
{
key: 0,
class: ns.e("wrapper"),
role: props2.role
},
[
h(
Container,
{
class: props2.className,
style: unref(windowStyle),
onScroll,
ref: windowRef
},
!isString(Container) ? { default: () => Inner } : Inner
),
horizontalScrollbar,
verticalScrollbar
]
);
};
return renderWindow;
}
});
};
// node_modules/element-plus/es/components/virtual-list/src/components/dynamic-size-grid.mjs
var { max, min, floor } = Math;
var SCOPE9 = "ElDynamicSizeGrid";
var ACCESS_SIZER_KEY_MAP = {
column: "columnWidth",
row: "rowHeight"
};
var ACCESS_LAST_VISITED_KEY_MAP = {
column: "lastVisitedColumnIndex",
row: "lastVisitedRowIndex"
};
var getItemFromCache2 = (props2, index, gridCache, type) => {
const [cachedItems, sizer, lastVisited] = [
gridCache[type],
props2[ACCESS_SIZER_KEY_MAP[type]],
gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
];
if (index > lastVisited) {
let offset3 = 0;
if (lastVisited >= 0) {
const item = cachedItems[lastVisited];
offset3 = item.offset + item.size;
}
for (let i = lastVisited + 1; i <= index; i++) {
const size2 = sizer(i);
cachedItems[i] = {
offset: offset3,
size: size2
};
offset3 += size2;
}
gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index;
}
return cachedItems[index];
};
var bs2 = (props2, gridCache, low, high, offset3, type) => {
while (low <= high) {
const mid = low + floor((high - low) / 2);
const currentOffset = getItemFromCache2(props2, mid, gridCache, type).offset;
if (currentOffset === offset3) {
return mid;
} else if (currentOffset < offset3) {
low = mid + 1;
} else {
high = mid - 1;
}
}
return max(0, low - 1);
};
var es2 = (props2, gridCache, idx, offset3, type) => {
const total2 = type === "column" ? props2.totalColumn : props2.totalRow;
let exponent = 1;
while (idx < total2 && getItemFromCache2(props2, idx, gridCache, type).offset < offset3) {
idx += exponent;
exponent *= 2;
}
return bs2(props2, gridCache, floor(idx / 2), min(idx, total2 - 1), offset3, type);
};
var findItem2 = (props2, gridCache, offset3, type) => {
const [cache2, lastVisitedIndex] = [
gridCache[type],
gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
];
const lastVisitedItemOffset = lastVisitedIndex > 0 ? cache2[lastVisitedIndex].offset : 0;
if (lastVisitedItemOffset >= offset3) {
return bs2(props2, gridCache, 0, lastVisitedIndex, offset3, type);
}
return es2(props2, gridCache, max(0, lastVisitedIndex), offset3, type);
};
var getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
let sizeOfVisitedRows = 0;
if (lastVisitedRowIndex >= totalRow) {
lastVisitedRowIndex = totalRow - 1;
}
if (lastVisitedRowIndex >= 0) {
const item = row[lastVisitedRowIndex];
sizeOfVisitedRows = item.offset + item.size;
}
const unvisitedItems = totalRow - lastVisitedRowIndex - 1;
const sizeOfUnvisitedItems = unvisitedItems * estimatedRowHeight;
return sizeOfVisitedRows + sizeOfUnvisitedItems;
};
var getEstimatedTotalWidth = ({ totalColumn }, { column: column2, estimatedColumnWidth, lastVisitedColumnIndex }) => {
let sizeOfVisitedColumns = 0;
if (lastVisitedColumnIndex > totalColumn) {
lastVisitedColumnIndex = totalColumn - 1;
}
if (lastVisitedColumnIndex >= 0) {
const item = column2[lastVisitedColumnIndex];
sizeOfVisitedColumns = item.offset + item.size;
}
const unvisitedItems = totalColumn - lastVisitedColumnIndex - 1;
const sizeOfUnvisitedItems = unvisitedItems * estimatedColumnWidth;
return sizeOfVisitedColumns + sizeOfUnvisitedItems;
};
var ACCESS_ESTIMATED_SIZE_KEY_MAP = {
column: getEstimatedTotalWidth,
row: getEstimatedTotalHeight
};
var getOffset2 = (props2, index, alignment, scrollOffset, cache2, type, scrollBarWidth2) => {
const [size2, estimatedSizeAssociates] = [
type === "row" ? props2.height : props2.width,
ACCESS_ESTIMATED_SIZE_KEY_MAP[type]
];
const item = getItemFromCache2(props2, index, cache2, type);
const estimatedSize = estimatedSizeAssociates(props2, cache2);
const maxOffset = max(0, min(estimatedSize - size2, item.offset));
const minOffset = max(0, item.offset - size2 + scrollBarWidth2 + item.size);
if (alignment === SMART_ALIGNMENT) {
if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
alignment = AUTO_ALIGNMENT;
} else {
alignment = CENTERED_ALIGNMENT;
}
}
switch (alignment) {
case START_ALIGNMENT: {
return maxOffset;
}
case END_ALIGNMENT: {
return minOffset;
}
case CENTERED_ALIGNMENT: {
return Math.round(minOffset + (maxOffset - minOffset) / 2);
}
case AUTO_ALIGNMENT:
default: {
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
return scrollOffset;
} else if (minOffset > maxOffset) {
return minOffset;
} else if (scrollOffset < minOffset) {
return minOffset;
} else {
return maxOffset;
}
}
}
};
var DynamicSizeGrid = createGrid({
name: "ElDynamicSizeGrid",
getColumnPosition: (props2, idx, cache2) => {
const item = getItemFromCache2(props2, idx, cache2, "column");
return [item.size, item.offset];
},
getRowPosition: (props2, idx, cache2) => {
const item = getItemFromCache2(props2, idx, cache2, "row");
return [item.size, item.offset];
},
getColumnOffset: (props2, columnIndex, alignment, scrollLeft, cache2, scrollBarWidth2) => getOffset2(
props2,
columnIndex,
alignment,
scrollLeft,
cache2,
"column",
scrollBarWidth2
),
getRowOffset: (props2, rowIndex, alignment, scrollTop, cache2, scrollBarWidth2) => getOffset2(
props2,
rowIndex,
alignment,
scrollTop,
cache2,
"row",
scrollBarWidth2
),
getColumnStartIndexForOffset: (props2, scrollLeft, cache2) => findItem2(props2, cache2, scrollLeft, "column"),
getColumnStopIndexForStartIndex: (props2, startIndex, scrollLeft, cache2) => {
const item = getItemFromCache2(props2, startIndex, cache2, "column");
const maxOffset = scrollLeft + props2.width;
let offset3 = item.offset + item.size;
let stopIndex = startIndex;
while (stopIndex < props2.totalColumn - 1 && offset3 < maxOffset) {
stopIndex++;
offset3 += getItemFromCache2(props2, startIndex, cache2, "column").size;
}
return stopIndex;
},
getEstimatedTotalHeight,
getEstimatedTotalWidth,
getRowStartIndexForOffset: (props2, scrollTop, cache2) => findItem2(props2, cache2, scrollTop, "row"),
getRowStopIndexForStartIndex: (props2, startIndex, scrollTop, cache2) => {
const { totalRow, height } = props2;
const item = getItemFromCache2(props2, startIndex, cache2, "row");
const maxOffset = scrollTop + height;
let offset3 = item.size + item.offset;
let stopIndex = startIndex;
while (stopIndex < totalRow - 1 && offset3 < maxOffset) {
stopIndex++;
offset3 += getItemFromCache2(props2, stopIndex, cache2, "row").size;
}
return stopIndex;
},
injectToInstance: (instance, cache2) => {
const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => {
var _a, _b;
forceUpdate = isUndefined(forceUpdate) ? true : forceUpdate;
if (isNumber(columnIndex)) {
cache2.value.lastVisitedColumnIndex = Math.min(
cache2.value.lastVisitedColumnIndex,
columnIndex - 1
);
}
if (isNumber(rowIndex)) {
cache2.value.lastVisitedRowIndex = Math.min(
cache2.value.lastVisitedRowIndex,
rowIndex - 1
);
}
(_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache.value(-1, null, null);
if (forceUpdate) (_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
};
const resetAfterColumnIndex = (columnIndex, forceUpdate) => {
resetAfter(
{
columnIndex
},
forceUpdate
);
};
const resetAfterRowIndex = (rowIndex, forceUpdate) => {
resetAfter(
{
rowIndex
},
forceUpdate
);
};
Object.assign(instance.proxy, {
resetAfterColumnIndex,
resetAfterRowIndex,
resetAfter
});
},
initCache: ({
estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE,
estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE
}) => {
const cache2 = {
column: {},
estimatedColumnWidth,
estimatedRowHeight,
lastVisitedColumnIndex: -1,
lastVisitedRowIndex: -1,
row: {}
};
return cache2;
},
clearCache: false,
validateProps: ({ columnWidth, rowHeight }) => {
if (true) {
if (!isFunction(columnWidth)) {
throwError(
SCOPE9,
`
"columnWidth" must be passed as function,
instead ${typeof columnWidth} was given.
`
);
}
if (!isFunction(rowHeight)) {
throwError(
SCOPE9,
`
"rowHeight" must be passed as function,
instead ${typeof rowHeight} was given.
`
);
}
}
}
});
// node_modules/element-plus/es/components/virtual-list/src/components/fixed-size-grid.mjs
var SCOPE10 = "ElFixedSizeGrid";
var FixedSizeGrid = createGrid({
name: "ElFixedSizeGrid",
getColumnPosition: ({ columnWidth }, index) => [
columnWidth,
index * columnWidth
],
getRowPosition: ({ rowHeight }, index) => [
rowHeight,
index * rowHeight
],
getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow,
getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn,
getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _2, scrollBarWidth2) => {
width = Number(width);
const lastColumnOffset = Math.max(
0,
totalColumn * columnWidth - width
);
const maxOffset = Math.min(
lastColumnOffset,
columnIndex * columnWidth
);
const minOffset = Math.max(
0,
columnIndex * columnWidth - width + scrollBarWidth2 + columnWidth
);
if (alignment === "smart") {
if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) {
alignment = AUTO_ALIGNMENT;
} else {
alignment = CENTERED_ALIGNMENT;
}
}
switch (alignment) {
case START_ALIGNMENT:
return maxOffset;
case END_ALIGNMENT:
return minOffset;
case CENTERED_ALIGNMENT: {
const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
if (middleOffset < Math.ceil(width / 2)) {
return 0;
} else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) {
return lastColumnOffset;
} else {
return middleOffset;
}
}
case AUTO_ALIGNMENT:
default:
if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
return scrollLeft;
} else if (minOffset > maxOffset) {
return minOffset;
} else if (scrollLeft < minOffset) {
return minOffset;
} else {
return maxOffset;
}
}
},
getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _2, scrollBarWidth2) => {
height = Number(height);
const lastRowOffset = Math.max(0, totalRow * rowHeight - height);
const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
const minOffset = Math.max(
0,
rowIndex * rowHeight - height + scrollBarWidth2 + rowHeight
);
if (align === SMART_ALIGNMENT) {
if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) {
align = AUTO_ALIGNMENT;
} else {
align = CENTERED_ALIGNMENT;
}
}
switch (align) {
case START_ALIGNMENT:
return maxOffset;
case END_ALIGNMENT:
return minOffset;
case CENTERED_ALIGNMENT: {
const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
if (middleOffset < Math.ceil(height / 2)) {
return 0;
} else if (middleOffset > lastRowOffset + Math.floor(height / 2)) {
return lastRowOffset;
} else {
return middleOffset;
}
}
case AUTO_ALIGNMENT:
default:
if (scrollTop >= minOffset && scrollTop <= maxOffset) {
return scrollTop;
} else if (minOffset > maxOffset) {
return minOffset;
} else if (scrollTop < minOffset) {
return minOffset;
} else {
return maxOffset;
}
}
},
getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(
0,
Math.min(
totalColumn - 1,
Math.floor(scrollLeft / columnWidth)
)
),
getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => {
const left = startIndex * columnWidth;
const visibleColumnsCount = Math.ceil(
(width + scrollLeft - left) / columnWidth
);
return Math.max(
0,
Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1)
);
},
getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(
0,
Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))
),
getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => {
const top = startIndex * rowHeight;
const numVisibleRows = Math.ceil(
(height + scrollTop - top) / rowHeight
);
return Math.max(
0,
Math.min(
totalRow - 1,
startIndex + numVisibleRows - 1
// -1 is because stop index is inclusive
)
);
},
/**
* Fixed size grid does not need this cache
* Using any to bypass it, TODO: Using type inference to fix this.
*/
initCache: () => void 0,
clearCache: true,
validateProps: ({ columnWidth, rowHeight }) => {
if (true) {
if (!isNumber(columnWidth)) {
throwError(
SCOPE10,
`
"columnWidth" must be passed as number,
instead ${typeof columnWidth} was given.
`
);
}
if (!isNumber(rowHeight)) {
throwError(
SCOPE10,
`
"columnWidth" must be passed as number,
instead ${typeof rowHeight} was given.
`
);
}
}
}
});
// node_modules/element-plus/es/components/table-v2/src/components/header.mjs
var COMPONENT_NAME18 = "ElTableV2Header";
var TableV2Header = defineComponent({
name: COMPONENT_NAME18,
props: tableV2HeaderProps,
setup(props2, {
slots,
expose
}) {
const ns = useNamespace("table-v2");
const scrollLeftInfo = inject(TABLE_V2_GRID_INJECTION_KEY);
const headerRef = ref();
const headerStyle = computed(() => enforceUnit({
width: props2.width,
height: props2.height
}));
const rowStyle = computed(() => enforceUnit({
width: props2.rowWidth,
height: props2.height
}));
const headerHeights = computed(() => castArray_default(unref(props2.headerHeight)));
const scrollToLeft = (left) => {
const headerEl = unref(headerRef);
nextTick(() => {
(headerEl == null ? void 0 : headerEl.scroll) && headerEl.scroll({
left
});
});
};
const renderFixedRows = () => {
const fixedRowClassName = ns.e("fixed-header-row");
const {
columns: columns2,
fixedHeaderData,
rowHeight
} = props2;
return fixedHeaderData == null ? void 0 : fixedHeaderData.map((fixedRowData, fixedRowIndex) => {
var _a;
const style = enforceUnit({
height: rowHeight,
width: "100%"
});
return (_a = slots.fixed) == null ? void 0 : _a.call(slots, {
class: fixedRowClassName,
columns: columns2,
rowData: fixedRowData,
rowIndex: -(fixedRowIndex + 1),
style
});
});
};
const renderDynamicRows = () => {
const dynamicRowClassName = ns.e("dynamic-header-row");
const {
columns: columns2
} = props2;
return unref(headerHeights).map((rowHeight, rowIndex) => {
var _a;
const style = enforceUnit({
width: "100%",
height: rowHeight
});
return (_a = slots.dynamic) == null ? void 0 : _a.call(slots, {
class: dynamicRowClassName,
columns: columns2,
headerIndex: rowIndex,
style
});
});
};
onUpdated(() => {
if (scrollLeftInfo == null ? void 0 : scrollLeftInfo.value) {
scrollToLeft(scrollLeftInfo.value);
}
});
expose({
/**
* @description scroll to position based on the provided value
*/
scrollToLeft
});
return () => {
if (props2.height <= 0) return;
return createVNode("div", {
"ref": headerRef,
"class": props2.class,
"style": unref(headerStyle),
"role": "rowgroup"
}, [createVNode("div", {
"style": unref(rowStyle),
"class": ns.e("header")
}, [renderDynamicRows(), renderFixedRows()])]);
};
}
});
// node_modules/element-plus/es/components/table-v2/src/table-grid.mjs
var COMPONENT_NAME19 = "ElTableV2Grid";
var useTableGrid = (props2) => {
const headerRef = ref();
const bodyRef = ref();
const scrollLeft = ref(0);
const totalHeight = computed(() => {
const {
data,
rowHeight,
estimatedRowHeight
} = props2;
if (estimatedRowHeight) {
return;
}
return data.length * rowHeight;
});
const fixedRowHeight = computed(() => {
const {
fixedData,
rowHeight
} = props2;
return ((fixedData == null ? void 0 : fixedData.length) || 0) * rowHeight;
});
const headerHeight = computed(() => sum(props2.headerHeight));
const gridHeight = computed(() => {
const {
height
} = props2;
return Math.max(0, height - unref(headerHeight) - unref(fixedRowHeight));
});
const hasHeader = computed(() => {
return unref(headerHeight) + unref(fixedRowHeight) > 0;
});
const itemKey = ({
data,
rowIndex
}) => data[rowIndex][props2.rowKey];
function onItemRendered({
rowCacheStart,
rowCacheEnd,
rowVisibleStart,
rowVisibleEnd
}) {
var _a;
(_a = props2.onRowsRendered) == null ? void 0 : _a.call(props2, {
rowCacheStart,
rowCacheEnd,
rowVisibleStart,
rowVisibleEnd
});
}
function resetAfterRowIndex(index, forceUpdate2) {
var _a;
(_a = bodyRef.value) == null ? void 0 : _a.resetAfterRowIndex(index, forceUpdate2);
}
function scrollTo2(leftOrOptions, top) {
const header$ = unref(headerRef);
const body$ = unref(bodyRef);
if (isObject(leftOrOptions)) {
header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions.scrollLeft);
scrollLeft.value = leftOrOptions.scrollLeft;
body$ == null ? void 0 : body$.scrollTo(leftOrOptions);
} else {
header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions);
scrollLeft.value = leftOrOptions;
body$ == null ? void 0 : body$.scrollTo({
scrollLeft: leftOrOptions,
scrollTop: top
});
}
}
function scrollToTop(scrollTop) {
var _a;
(_a = unref(bodyRef)) == null ? void 0 : _a.scrollTo({
scrollTop
});
}
function scrollToRow(row, strategy) {
const body = unref(bodyRef);
if (!body) return;
const prevScrollLeft = scrollLeft.value;
body.scrollToItem(row, 0, strategy);
if (prevScrollLeft) {
scrollTo2({
scrollLeft: prevScrollLeft
});
}
}
function forceUpdate() {
var _a, _b;
(_a = unref(bodyRef)) == null ? void 0 : _a.$forceUpdate();
(_b = unref(headerRef)) == null ? void 0 : _b.$forceUpdate();
}
watch(() => props2.bodyWidth, () => {
var _a;
if (isNumber(props2.estimatedRowHeight)) (_a = bodyRef.value) == null ? void 0 : _a.resetAfter({
columnIndex: 0
}, false);
});
return {
bodyRef,
forceUpdate,
fixedRowHeight,
gridHeight,
hasHeader,
headerHeight,
headerRef,
totalHeight,
itemKey,
onItemRendered,
resetAfterRowIndex,
scrollTo: scrollTo2,
scrollToTop,
scrollToRow,
scrollLeft
};
};
var TableGrid = defineComponent({
name: COMPONENT_NAME19,
props: tableV2GridProps,
setup(props2, {
slots,
expose
}) {
const {
ns
} = inject(TableV2InjectionKey);
const {
bodyRef,
fixedRowHeight,
gridHeight,
hasHeader,
headerRef,
headerHeight,
totalHeight,
forceUpdate,
itemKey,
onItemRendered,
resetAfterRowIndex,
scrollTo: scrollTo2,
scrollToTop,
scrollToRow,
scrollLeft
} = useTableGrid(props2);
provide(TABLE_V2_GRID_INJECTION_KEY, scrollLeft);
onActivated(async () => {
var _a;
await nextTick();
const scrollTop = (_a = bodyRef.value) == null ? void 0 : _a.states.scrollTop;
scrollTop && scrollToTop(Math.round(scrollTop) + 1);
});
expose({
forceUpdate,
/**
* @description fetch total height
*/
totalHeight,
/**
* @description scroll to a position
*/
scrollTo: scrollTo2,
/**
* @description scroll vertically to position y
*/
scrollToTop,
/**
* @description scroll to a given row
* @params row {Number} which row to scroll to
* @params strategy {ScrollStrategy} use what strategy to scroll to
*/
scrollToRow,
/**
* @description reset rendered state after row index
*/
resetAfterRowIndex
});
const getColumnWidth = () => props2.bodyWidth;
return () => {
const {
cache: cache2,
columns: columns2,
data,
fixedData,
useIsScrolling,
scrollbarAlwaysOn,
scrollbarEndGap,
scrollbarStartGap,
style,
rowHeight,
bodyWidth,
estimatedRowHeight,
headerWidth,
height,
width,
getRowHeight,
onScroll
} = props2;
const isDynamicRowEnabled = isNumber(estimatedRowHeight);
const Grid = isDynamicRowEnabled ? DynamicSizeGrid : FixedSizeGrid;
const _headerHeight = unref(headerHeight);
return createVNode("div", {
"role": "table",
"class": [ns.e("table"), props2.class],
"style": style
}, [createVNode(Grid, {
"ref": bodyRef,
"data": data,
"useIsScrolling": useIsScrolling,
"itemKey": itemKey,
"columnCache": 0,
"columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth,
"totalColumn": 1,
"totalRow": data.length,
"rowCache": cache2,
"rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight,
"width": width,
"height": unref(gridHeight),
"class": ns.e("body"),
"role": "rowgroup",
"scrollbarStartGap": scrollbarStartGap,
"scrollbarEndGap": scrollbarEndGap,
"scrollbarAlwaysOn": scrollbarAlwaysOn,
"onScroll": onScroll,
"onItemRendered": onItemRendered,
"perfMode": false
}, {
default: (params) => {
var _a;
const rowData = data[params.rowIndex];
return (_a = slots.row) == null ? void 0 : _a.call(slots, {
...params,
columns: columns2,
rowData
});
}
}), unref(hasHeader) && createVNode(TableV2Header, {
"ref": headerRef,
"class": ns.e("header-wrapper"),
"columns": columns2,
"headerData": data,
"headerHeight": props2.headerHeight,
"fixedHeaderData": fixedData,
"rowWidth": headerWidth,
"rowHeight": rowHeight,
"width": width,
"height": Math.min(_headerHeight + unref(fixedRowHeight), height)
}, {
dynamic: slots.header,
fixed: slots.row
})]);
};
}
});
// node_modules/element-plus/es/components/table-v2/src/renderers/main-table.mjs
function _isSlot3(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var MainTable = (props2, {
slots
}) => {
const {
mainTableRef,
...rest
} = props2;
return createVNode(TableGrid, mergeProps({
"ref": mainTableRef
}, rest), _isSlot3(slots) ? slots : {
default: () => [slots]
});
};
// node_modules/element-plus/es/components/table-v2/src/renderers/left-table.mjs
function _isSlot4(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var LeftTable = (props2, {
slots
}) => {
if (!props2.columns.length) return;
const {
leftTableRef,
...rest
} = props2;
return createVNode(TableGrid, mergeProps({
"ref": leftTableRef
}, rest), _isSlot4(slots) ? slots : {
default: () => [slots]
});
};
// node_modules/element-plus/es/components/table-v2/src/renderers/right-table.mjs
function _isSlot5(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var RightTable = (props2, {
slots
}) => {
if (!props2.columns.length) return;
const {
rightTableRef,
...rest
} = props2;
return createVNode(TableGrid, mergeProps({
"ref": rightTableRef
}, rest), _isSlot5(slots) ? slots : {
default: () => [slots]
});
};
// node_modules/element-plus/es/components/table-v2/src/components/row.mjs
var useTableRow = (props2) => {
const {
isScrolling
} = inject(TableV2InjectionKey);
const measured = ref(false);
const rowRef = ref();
const measurable = computed(() => {
return isNumber(props2.estimatedRowHeight) && props2.rowIndex >= 0;
});
const doMeasure = (isInit = false) => {
const $rowRef = unref(rowRef);
if (!$rowRef) return;
const {
columns: columns2,
onRowHeightChange,
rowKey: rowKey2,
rowIndex,
style
} = props2;
const {
height
} = $rowRef.getBoundingClientRect();
measured.value = true;
nextTick(() => {
if (isInit || height !== Number.parseInt(style.height)) {
const firstColumn = columns2[0];
const isPlaceholder = (firstColumn == null ? void 0 : firstColumn.placeholderSign) === placeholderSign;
onRowHeightChange == null ? void 0 : onRowHeightChange({
rowKey: rowKey2,
height,
rowIndex
}, firstColumn && !isPlaceholder && firstColumn.fixed);
}
});
};
const eventHandlers = computed(() => {
const {
rowData,
rowIndex,
rowKey: rowKey2,
onRowHover
} = props2;
const handlers2 = props2.rowEventHandlers || {};
const eventHandlers2 = {};
Object.entries(handlers2).forEach(([eventName, handler]) => {
if (isFunction(handler)) {
eventHandlers2[eventName] = (event) => {
handler({
event,
rowData,
rowIndex,
rowKey: rowKey2
});
};
}
});
if (onRowHover) {
[{
name: "onMouseleave",
hovered: false
}, {
name: "onMouseenter",
hovered: true
}].forEach(({
name,
hovered
}) => {
const existedHandler = eventHandlers2[name];
eventHandlers2[name] = (event) => {
onRowHover({
event,
hovered,
rowData,
rowIndex,
rowKey: rowKey2
});
existedHandler == null ? void 0 : existedHandler(event);
};
});
}
return eventHandlers2;
});
const onExpand = (expanded) => {
const {
onRowExpand,
rowData,
rowIndex,
rowKey: rowKey2
} = props2;
onRowExpand == null ? void 0 : onRowExpand({
expanded,
rowData,
rowIndex,
rowKey: rowKey2
});
};
onMounted(() => {
if (unref(measurable)) {
doMeasure(true);
}
});
return {
isScrolling,
measurable,
measured,
rowRef,
eventHandlers,
onExpand
};
};
var COMPONENT_NAME20 = "ElTableV2TableRow";
var TableV2Row = defineComponent({
name: COMPONENT_NAME20,
props: tableV2RowProps,
setup(props2, {
expose,
slots,
attrs
}) {
const {
eventHandlers,
isScrolling,
measurable,
measured,
rowRef,
onExpand
} = useTableRow(props2);
expose({
/**
* @description manually dispatching expand action on row.
*/
onExpand
});
return () => {
const {
columns: columns2,
columnsStyles,
expandColumnKey: expandColumnKey2,
depth,
rowData,
rowIndex,
style
} = props2;
let ColumnCells = columns2.map((column2, columnIndex) => {
const expandable = isArray(rowData.children) && rowData.children.length > 0 && column2.key === expandColumnKey2;
return slots.cell({
column: column2,
columns: columns2,
columnIndex,
depth,
style: columnsStyles[column2.key],
rowData,
rowIndex,
isScrolling: unref(isScrolling),
expandIconProps: expandable ? {
rowData,
rowIndex,
onExpand
} : void 0
});
});
if (slots.row) {
ColumnCells = slots.row({
cells: ColumnCells.map((node) => {
if (isArray(node) && node.length === 1) {
return node[0];
}
return node;
}),
style,
columns: columns2,
depth,
rowData,
rowIndex,
isScrolling: unref(isScrolling)
});
}
if (unref(measurable)) {
const {
height,
...exceptHeightStyle
} = style || {};
const _measured = unref(measured);
return createVNode("div", mergeProps({
"ref": rowRef,
"class": props2.class,
"style": _measured ? style : exceptHeightStyle,
"role": "row"
}, attrs, unref(eventHandlers)), [ColumnCells]);
}
return createVNode("div", mergeProps(attrs, {
"ref": rowRef,
"class": props2.class,
"style": style,
"role": "row"
}, unref(eventHandlers)), [ColumnCells]);
};
}
});
// node_modules/element-plus/es/components/table-v2/src/renderers/row.mjs
function _isSlot6(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var RowRenderer = (props2, {
slots
}) => {
const {
columns: columns2,
columnsStyles,
depthMap,
expandColumnKey: expandColumnKey2,
expandedRowKeys,
estimatedRowHeight,
hasFixedColumns,
rowData,
rowIndex,
style,
isScrolling,
rowProps: rowProps2,
rowClass,
rowKey: rowKey2,
rowEventHandlers,
ns,
onRowHovered,
onRowExpanded
} = props2;
const rowKls = tryCall(rowClass, {
columns: columns2,
rowData,
rowIndex
}, "");
const additionalProps = tryCall(rowProps2, {
columns: columns2,
rowData,
rowIndex
});
const _rowKey = rowData[rowKey2];
const depth = depthMap[_rowKey] || 0;
const canExpand = Boolean(expandColumnKey2);
const isFixedRow = rowIndex < 0;
const kls = [ns.e("row"), rowKls, ns.is("expanded", canExpand && expandedRowKeys.includes(_rowKey)), ns.is("fixed", !depth && isFixedRow), ns.is("customized", Boolean(slots.row)), {
[ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0
}];
const onRowHover = hasFixedColumns ? onRowHovered : void 0;
const _rowProps = {
...additionalProps,
columns: columns2,
columnsStyles,
class: kls,
depth,
expandColumnKey: expandColumnKey2,
estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
isScrolling,
rowIndex,
rowData,
rowKey: _rowKey,
rowEventHandlers,
style
};
const handlerMouseEnter = (e) => {
onRowHover == null ? void 0 : onRowHover({
hovered: true,
rowKey: _rowKey,
event: e,
rowData,
rowIndex
});
};
const handlerMouseLeave = (e) => {
onRowHover == null ? void 0 : onRowHover({
hovered: false,
rowKey: _rowKey,
event: e,
rowData,
rowIndex
});
};
return createVNode(TableV2Row, mergeProps(_rowProps, {
"onRowExpand": onRowExpanded,
"onMouseenter": handlerMouseEnter,
"onMouseleave": handlerMouseLeave,
"rowkey": _rowKey
}), _isSlot6(slots) ? slots : {
default: () => [slots]
});
};
// node_modules/element-plus/es/components/table-v2/src/components/cell.mjs
var TableV2Cell = (props2, {
slots
}) => {
var _a;
const {
cellData,
style
} = props2;
const displayText = ((_a = cellData == null ? void 0 : cellData.toString) == null ? void 0 : _a.call(cellData)) || "";
const defaultSlot = renderSlot(slots, "default", props2, () => [displayText]);
return createVNode("div", {
"class": props2.class,
"title": displayText,
"style": style
}, [defaultSlot]);
};
TableV2Cell.displayName = "ElTableV2Cell";
TableV2Cell.inheritAttrs = false;
// node_modules/element-plus/es/components/table-v2/src/components/expand-icon.mjs
var ExpandIcon = (props2) => {
const {
expanded,
expandable,
onExpand,
style,
size: size2,
ariaLabel
} = props2;
const expandIconProps = {
onClick: expandable ? () => onExpand(!expanded) : void 0,
ariaLabel,
ariaExpanded: expanded,
class: props2.class
};
return createVNode("button", mergeProps(expandIconProps, {
"type": "button"
}), [createVNode(ElIcon, {
"size": size2,
"style": style
}, {
default: () => [createVNode(arrow_right_default, null, null)]
})]);
};
ExpandIcon.inheritAttrs = false;
// node_modules/element-plus/es/components/table-v2/src/renderers/cell.mjs
var CellRenderer = ({
// renderer props
columns: columns2,
column: column2,
columnIndex,
depth,
expandIconProps,
isScrolling,
rowData,
rowIndex,
// from use-table
style,
expandedRowKeys,
ns,
t,
// derived props
cellProps: _cellProps,
expandColumnKey: expandColumnKey2,
indentSize,
iconSize,
rowKey: rowKey2
}, {
slots
}) => {
const cellStyle = enforceUnit(style);
if (column2.placeholderSign === placeholderSign) {
return createVNode("div", {
"class": ns.em("row-cell", "placeholder"),
"style": cellStyle
}, null);
}
const {
cellRenderer,
dataKey,
dataGetter
} = column2;
const cellData = isFunction(dataGetter) ? dataGetter({
columns: columns2,
column: column2,
columnIndex,
rowData,
rowIndex
}) : get_default(rowData, dataKey != null ? dataKey : "");
const extraCellProps = tryCall(_cellProps, {
cellData,
columns: columns2,
column: column2,
columnIndex,
rowIndex,
rowData
});
const cellProps = {
class: ns.e("cell-text"),
columns: columns2,
column: column2,
columnIndex,
cellData,
isScrolling,
rowData,
rowIndex
};
const columnCellRenderer = componentToSlot(cellRenderer);
const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(TableV2Cell, cellProps, null)]);
const kls = [ns.e("row-cell"), column2.class, column2.align === Alignment.CENTER && ns.is("align-center"), column2.align === Alignment.RIGHT && ns.is("align-right")];
const expandable = rowIndex >= 0 && expandColumnKey2 && column2.key === expandColumnKey2;
const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey2]);
let IconOrPlaceholder;
const iconStyle = `margin-inline-start: ${depth * indentSize}px;`;
if (expandable) {
if (isObject(expandIconProps)) {
IconOrPlaceholder = createVNode(ExpandIcon, mergeProps(expandIconProps, {
"class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
"size": iconSize,
"expanded": expanded,
"ariaLabel": t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
"style": iconStyle,
"expandable": true
}), null);
} else {
IconOrPlaceholder = createVNode("div", {
"style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ")
}, null);
}
}
return createVNode("div", mergeProps({
"class": kls,
"style": cellStyle
}, extraCellProps, {
"role": "cell"
}), [IconOrPlaceholder, Cell]);
};
CellRenderer.inheritAttrs = false;
// node_modules/element-plus/es/components/table-v2/src/header-row.mjs
var tableV2HeaderRowProps = buildProps({
class: String,
columns,
columnsStyles: {
type: definePropType(Object),
required: true
},
headerIndex: Number,
style: { type: definePropType(Object) }
});
// node_modules/element-plus/es/components/table-v2/src/components/header-row.mjs
var TableV2HeaderRow = defineComponent({
name: "ElTableV2HeaderRow",
props: tableV2HeaderRowProps,
setup(props2, {
slots
}) {
return () => {
const {
columns: columns2,
columnsStyles,
headerIndex,
style
} = props2;
let Cells = columns2.map((column2, columnIndex) => {
return slots.cell({
columns: columns2,
column: column2,
columnIndex,
headerIndex,
style: columnsStyles[column2.key]
});
});
if (slots.header) {
Cells = slots.header({
cells: Cells.map((node) => {
if (isArray(node) && node.length === 1) {
return node[0];
}
return node;
}),
columns: columns2,
headerIndex
});
}
return createVNode("div", {
"class": props2.class,
"style": style,
"role": "row"
}, [Cells]);
};
}
});
// node_modules/element-plus/es/components/table-v2/src/renderers/header.mjs
function _isSlot7(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var HeaderRenderer = ({
columns: columns2,
columnsStyles,
headerIndex,
style,
// derived from root
headerClass,
headerProps,
ns
}, {
slots
}) => {
const param = {
columns: columns2,
headerIndex
};
const kls = [ns.e("header-row"), tryCall(headerClass, param, ""), ns.is("customized", Boolean(slots.header))];
const extraProps = {
...tryCall(headerProps, param),
columnsStyles,
class: kls,
columns: columns2,
headerIndex,
style
};
return createVNode(TableV2HeaderRow, extraProps, _isSlot7(slots) ? slots : {
default: () => [slots]
});
};
// node_modules/element-plus/es/components/table-v2/src/components/header-cell.mjs
var HeaderCell = (props2, {
slots
}) => renderSlot(slots, "default", props2, () => {
var _a, _b;
return [createVNode("div", {
"class": props2.class,
"title": (_a = props2.column) == null ? void 0 : _a.title
}, [(_b = props2.column) == null ? void 0 : _b.title])];
});
HeaderCell.displayName = "ElTableV2HeaderCell";
HeaderCell.inheritAttrs = false;
// node_modules/element-plus/es/components/table-v2/src/components/sort-icon.mjs
var SortIcon = (props2) => {
const {
sortOrder
} = props2;
return createVNode("button", {
"type": "button",
"aria-label": props2.ariaLabel,
"class": props2.class
}, [createVNode(ElIcon, {
"size": 14
}, {
default: () => [sortOrder === SortOrder.ASC ? createVNode(sort_up_default, null, null) : createVNode(sort_down_default, null, null)]
})]);
};
// node_modules/element-plus/es/components/table-v2/src/renderers/header-cell.mjs
var HeaderCellRenderer = (props2, {
slots
}) => {
const {
column: column2,
ns,
t,
style,
onColumnSorted
} = props2;
const cellStyle = enforceUnit(style);
if (column2.placeholderSign === placeholderSign) {
return createVNode("div", {
"class": ns.em("header-row-cell", "placeholder"),
"style": cellStyle
}, null);
}
const {
headerCellRenderer,
headerClass,
sortable
} = column2;
const cellProps = {
...props2,
class: ns.e("header-cell-text")
};
const columnCellRenderer = componentToSlot(headerCellRenderer);
const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(HeaderCell, cellProps, null)]);
const {
sortBy,
sortState,
headerCellProps
} = props2;
let sorting, sortOrder, ariaSort;
if (sortState) {
const order = sortState[column2.key];
sorting = Boolean(oppositeOrderMap[order]);
sortOrder = sorting ? order : SortOrder.ASC;
} else {
sorting = column2.key === sortBy.key;
sortOrder = sorting ? sortBy.order : SortOrder.ASC;
}
if (sortOrder === SortOrder.ASC) {
ariaSort = "ascending";
} else if (sortOrder === SortOrder.DESC) {
ariaSort = "descending";
} else {
ariaSort = void 0;
}
const cellKls = [ns.e("header-cell"), tryCall(headerClass, props2, ""), column2.align === Alignment.CENTER && ns.is("align-center"), column2.align === Alignment.RIGHT && ns.is("align-right"), sortable && ns.is("sortable")];
const cellWrapperProps = {
...tryCall(headerCellProps, props2),
onClick: column2.sortable ? onColumnSorted : void 0,
ariaSort: sortable ? ariaSort : void 0,
class: cellKls,
style: cellStyle,
["data-key"]: column2.key
};
return createVNode("div", mergeProps(cellWrapperProps, {
"role": "columnheader"
}), [Cell, sortable && createVNode(SortIcon, {
"class": [ns.e("sort-icon"), sorting && ns.is("sorting")],
"sortOrder": sortOrder,
"ariaLabel": t("el.table.sortLabel", {
column: column2.title || ""
})
}, null)]);
};
// node_modules/element-plus/es/components/table-v2/src/renderers/footer.mjs
var Footer = (props2, {
slots
}) => {
var _a;
return createVNode("div", {
"class": props2.class,
"style": props2.style
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
};
Footer.displayName = "ElTableV2Footer";
// node_modules/element-plus/es/components/table-v2/src/renderers/empty.mjs
var Footer2 = (props2, {
slots
}) => {
const defaultSlot = renderSlot(slots, "default", {}, () => [createVNode(ElEmpty, null, null)]);
return createVNode("div", {
"class": props2.class,
"style": props2.style
}, [defaultSlot]);
};
Footer2.displayName = "ElTableV2Empty";
// node_modules/element-plus/es/components/table-v2/src/renderers/overlay.mjs
var Overlay2 = (props2, {
slots
}) => {
var _a;
return createVNode("div", {
"class": props2.class,
"style": props2.style
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
};
Overlay2.displayName = "ElTableV2Overlay";
// node_modules/element-plus/es/components/table-v2/src/table-v2.mjs
function _isSlot8(s2) {
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
}
var COMPONENT_NAME21 = "ElTableV2";
var TableV2 = defineComponent({
name: COMPONENT_NAME21,
props: tableV2Props,
setup(props2, {
slots,
expose
}) {
const ns = useNamespace("table-v2");
const {
t
} = useLocale();
const {
columnsStyles,
fixedColumnsOnLeft,
fixedColumnsOnRight,
mainColumns,
mainTableHeight,
fixedTableHeight,
leftTableWidth,
rightTableWidth,
data,
depthMap,
expandedRowKeys,
hasFixedColumns,
mainTableRef,
leftTableRef,
rightTableRef,
isDynamic,
isResetting,
isScrolling,
bodyWidth,
emptyStyle,
rootStyle,
footerHeight,
showEmpty,
// exposes
scrollTo: scrollTo2,
scrollToLeft,
scrollToTop,
scrollToRow,
getRowHeight,
onColumnSorted,
onRowHeightChange,
onRowHovered,
onRowExpanded,
onRowsRendered,
onScroll,
onVerticalScroll
} = useTable(props2);
expose({
/**
* @description scroll to a given position
* @params params {{ scrollLeft?: number, scrollTop?: number }} where to scroll to.
*/
scrollTo: scrollTo2,
/**
* @description scroll to a given position horizontally
* @params scrollLeft {Number} where to scroll to.
*/
scrollToLeft,
/**
* @description scroll to a given position vertically
* @params scrollTop { Number } where to scroll to.
*/
scrollToTop,
/**
* @description scroll to a given row
* @params row {Number} which row to scroll to
* @params @optional strategy {ScrollStrategy} use what strategy to scroll to
*/
scrollToRow
});
provide(TableV2InjectionKey, {
ns,
isResetting,
isScrolling
});
return () => {
const {
cache: cache2,
cellProps,
estimatedRowHeight,
expandColumnKey: expandColumnKey2,
fixedData,
headerHeight,
headerClass,
headerProps,
headerCellProps,
sortBy,
sortState,
rowHeight,
rowClass,
rowEventHandlers,
rowKey: rowKey2,
rowProps: rowProps2,
scrollbarAlwaysOn,
indentSize,
iconSize,
useIsScrolling,
vScrollbarSize,
width
} = props2;
const _data = unref(data);
const mainTableProps = {
cache: cache2,
class: ns.e("main"),
columns: unref(mainColumns),
data: _data,
fixedData,
estimatedRowHeight,
bodyWidth: unref(bodyWidth),
headerHeight,
headerWidth: unref(bodyWidth),
height: unref(mainTableHeight),
mainTableRef,
rowKey: rowKey2,
rowHeight,
scrollbarAlwaysOn,
scrollbarStartGap: 2,
scrollbarEndGap: vScrollbarSize,
useIsScrolling,
width,
getRowHeight,
onRowsRendered,
onScroll
};
const leftColumnsWidth = unref(leftTableWidth);
const _fixedTableHeight = unref(fixedTableHeight);
const leftTableProps = {
cache: cache2,
class: ns.e("left"),
columns: unref(fixedColumnsOnLeft),
data: _data,
fixedData,
estimatedRowHeight,
leftTableRef,
rowHeight,
bodyWidth: leftColumnsWidth,
headerWidth: leftColumnsWidth,
headerHeight,
height: _fixedTableHeight,
rowKey: rowKey2,
scrollbarAlwaysOn,
scrollbarStartGap: 2,
scrollbarEndGap: vScrollbarSize,
useIsScrolling,
width: leftColumnsWidth,
getRowHeight,
onScroll: onVerticalScroll
};
const rightColumnsWidth = unref(rightTableWidth);
const rightTableProps = {
cache: cache2,
class: ns.e("right"),
columns: unref(fixedColumnsOnRight),
data: _data,
fixedData,
estimatedRowHeight,
rightTableRef,
rowHeight,
bodyWidth: rightColumnsWidth,
headerWidth: rightColumnsWidth,
headerHeight,
height: _fixedTableHeight,
rowKey: rowKey2,
scrollbarAlwaysOn,
scrollbarStartGap: 2,
scrollbarEndGap: vScrollbarSize,
width: rightColumnsWidth,
style: `${ns.cssVarName("table-scrollbar-size")}: ${vScrollbarSize}px`,
useIsScrolling,
getRowHeight,
onScroll: onVerticalScroll
};
const _columnsStyles = unref(columnsStyles);
const tableRowProps = {
ns,
depthMap: unref(depthMap),
columnsStyles: _columnsStyles,
expandColumnKey: expandColumnKey2,
expandedRowKeys: unref(expandedRowKeys),
estimatedRowHeight,
hasFixedColumns: unref(hasFixedColumns),
rowProps: rowProps2,
rowClass,
rowKey: rowKey2,
rowEventHandlers,
onRowHovered,
onRowExpanded,
onRowHeightChange
};
const tableCellProps = {
cellProps,
expandColumnKey: expandColumnKey2,
indentSize,
iconSize,
rowKey: rowKey2,
expandedRowKeys: unref(expandedRowKeys),
ns,
t
};
const tableHeaderProps = {
ns,
headerClass,
headerProps,
columnsStyles: _columnsStyles
};
const tableHeaderCellProps = {
ns,
t,
sortBy,
sortState,
headerCellProps,
onColumnSorted
};
const tableSlots = {
row: (props22) => createVNode(RowRenderer, mergeProps(props22, tableRowProps), {
row: slots.row,
cell: (props3) => {
let _slot;
return slots.cell ? createVNode(CellRenderer, mergeProps(props3, tableCellProps, {
"style": _columnsStyles[props3.column.key]
}), _isSlot8(_slot = slots.cell(props3)) ? _slot : {
default: () => [_slot]
}) : createVNode(CellRenderer, mergeProps(props3, tableCellProps, {
"style": _columnsStyles[props3.column.key]
}), null);
}
}),
header: (props22) => createVNode(HeaderRenderer, mergeProps(props22, tableHeaderProps), {
header: slots.header,
cell: (props3) => {
let _slot2;
return slots["header-cell"] ? createVNode(HeaderCellRenderer, mergeProps(props3, tableHeaderCellProps, {
"style": _columnsStyles[props3.column.key]
}), _isSlot8(_slot2 = slots["header-cell"](props3)) ? _slot2 : {
default: () => [_slot2]
}) : createVNode(HeaderCellRenderer, mergeProps(props3, tableHeaderCellProps, {
"style": _columnsStyles[props3.column.key]
}), null);
}
})
};
const rootKls = [props2.class, ns.b(), ns.e("root"), ns.is("dynamic", unref(isDynamic))];
const footerProps = {
class: ns.e("footer"),
style: unref(footerHeight)
};
return createVNode("div", {
"class": rootKls,
"style": unref(rootStyle)
}, [createVNode(MainTable, mainTableProps, _isSlot8(tableSlots) ? tableSlots : {
default: () => [tableSlots]
}), createVNode(LeftTable, leftTableProps, _isSlot8(tableSlots) ? tableSlots : {
default: () => [tableSlots]
}), createVNode(RightTable, rightTableProps, _isSlot8(tableSlots) ? tableSlots : {
default: () => [tableSlots]
}), slots.footer && createVNode(Footer, footerProps, {
default: slots.footer
}), unref(showEmpty) && createVNode(Footer2, {
"class": ns.e("empty"),
"style": unref(emptyStyle)
}, {
default: slots.empty
}), slots.overlay && createVNode(Overlay2, {
"class": ns.e("overlay")
}, {
default: slots.overlay
})]);
};
}
});
// node_modules/element-plus/es/components/table-v2/src/auto-resizer.mjs
var autoResizerProps = buildProps({
disableWidth: Boolean,
disableHeight: Boolean,
onResize: {
type: definePropType(Function)
}
});
// node_modules/element-plus/es/components/table-v2/src/composables/use-auto-resize.mjs
var useAutoResize = (props2) => {
const sizer = ref();
const width$ = ref(0);
const height$ = ref(0);
let resizerStopper;
onMounted(() => {
resizerStopper = useResizeObserver(sizer, ([entry]) => {
const { width, height } = entry.contentRect;
const { paddingLeft, paddingRight, paddingTop, paddingBottom } = getComputedStyle(entry.target);
const left = Number.parseInt(paddingLeft) || 0;
const right = Number.parseInt(paddingRight) || 0;
const top = Number.parseInt(paddingTop) || 0;
const bottom = Number.parseInt(paddingBottom) || 0;
width$.value = width - left - right;
height$.value = height - top - bottom;
}).stop;
});
onBeforeUnmount(() => {
resizerStopper == null ? void 0 : resizerStopper();
});
watch([width$, height$], ([width, height]) => {
var _a;
(_a = props2.onResize) == null ? void 0 : _a.call(props2, {
width,
height
});
});
return {
sizer,
width: width$,
height: height$
};
};
// node_modules/element-plus/es/components/table-v2/src/components/auto-resizer.mjs
var AutoResizer = defineComponent({
name: "ElAutoResizer",
props: autoResizerProps,
setup(props2, {
slots
}) {
const ns = useNamespace("auto-resizer");
const {
height,
width,
sizer
} = useAutoResize(props2);
const style = {
width: "100%",
height: "100%"
};
return () => {
var _a;
return createVNode("div", {
"ref": sizer,
"class": ns.b(),
"style": style
}, [(_a = slots.default) == null ? void 0 : _a.call(slots, {
height: height.value,
width: width.value
})]);
};
}
});
// node_modules/element-plus/es/components/table-v2/index.mjs
var ElTableV2 = withInstall(TableV2);
var ElAutoResizer = withInstall(AutoResizer);
// node_modules/element-plus/es/components/tabs/src/constants.mjs
var tabsRootContextKey = /* @__PURE__ */ Symbol("tabsRootContextKey");
// node_modules/element-plus/es/components/tabs/src/tab-bar.mjs
var tabBarProps = buildProps({
tabs: {
type: definePropType(Array),
default: () => mutable([])
},
tabRefs: {
type: definePropType(Object),
default: () => mutable({})
}
});
// node_modules/element-plus/es/components/tabs/src/tab-bar.vue2.mjs
var COMPONENT_NAME22 = "ElTabBar";
var _sfc_main129 = defineComponent({
...{
name: COMPONENT_NAME22
},
__name: "tab-bar",
props: tabBarProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const rootTabs = inject(tabsRootContextKey);
if (!rootTabs) throwError(COMPONENT_NAME22, "");
const ns = useNamespace("tabs");
const barRef = ref();
const barStyle = ref();
const renderActiveBar = computed(
() => {
var _a;
return isUndefined(rootTabs.props.defaultValue) || Boolean((_a = barStyle.value) == null ? void 0 : _a.transform);
}
);
const getBarStyle = () => {
let offset3 = 0;
let tabSize = 0;
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
const sizeDir = sizeName === "width" ? "x" : "y";
const position = sizeDir === "x" ? "left" : "top";
props2.tabs.every((tab) => {
if (isUndefined(tab.paneName)) return false;
const $el = props2.tabRefs[tab.paneName];
if (!$el) return false;
if (!tab.active) {
return true;
}
offset3 = $el[`offset${capitalize2(position)}`];
tabSize = $el[`client${capitalize2(sizeName)}`];
const tabStyles = window.getComputedStyle($el);
if (sizeName === "width") {
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
offset3 += Number.parseFloat(tabStyles.paddingLeft);
}
return false;
});
return {
[sizeName]: `${tabSize}px`,
transform: `translate${capitalize2(sizeDir)}(${offset3}px)`
};
};
const update = () => barStyle.value = getBarStyle();
const tabObservers = [];
const observerTabs = () => {
tabObservers.forEach((observer) => observer.stop());
tabObservers.length = 0;
Object.values(props2.tabRefs).forEach((tab) => {
tabObservers.push(useResizeObserver(tab, update));
});
};
watch(
() => props2.tabs,
async () => {
await nextTick();
update();
observerTabs();
},
{ immediate: true }
);
const barObserver = useResizeObserver(barRef, () => update());
onBeforeUnmount(() => {
tabObservers.forEach((observer) => observer.stop());
tabObservers.length = 0;
barObserver.stop();
});
__expose({
/** @description tab root html element */
ref: barRef,
/** @description method to manually update tab bar style */
update
});
return (_ctx, _cache) => {
return renderActiveBar.value ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref_key: "barRef",
ref: barRef,
class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
style: normalizeStyle(barStyle.value)
},
null,
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true);
};
}
});
// node_modules/element-plus/es/components/tabs/src/tab-nav.mjs
var tabNavProps = buildProps({
panes: {
type: definePropType(Array),
default: () => mutable([])
},
currentName: {
type: [String, Number],
default: ""
},
editable: Boolean,
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
stretch: Boolean,
/**
* @description tab-nav tabindex
*/
tabindex: {
type: [String, Number],
default: void 0
}
});
var tabNavEmits = {
tabClick: (tab, tabName, ev) => ev instanceof Event,
tabRemove: (tab, ev) => ev instanceof Event
};
var COMPONENT_NAME23 = "ElTabNav";
var TabNav = defineComponent({
name: COMPONENT_NAME23,
props: tabNavProps,
emits: tabNavEmits,
setup(props2, {
expose,
emit
}) {
const rootTabs = inject(tabsRootContextKey);
if (!rootTabs) throwError(COMPONENT_NAME23, ``);
const ns = useNamespace("tabs");
const visibility = useDocumentVisibility();
const focused = useWindowFocus();
const navScroll$ = ref();
const nav$ = ref();
const el$ = ref();
const tabRefsMap = ref({});
const tabBarRef = ref();
const scrollable = ref(false);
const navOffset = ref(0);
const isFocus = ref(false);
const focusable = ref(true);
const tracker = shallowRef();
const isHorizontal2 = computed(() => ["top", "bottom"].includes(rootTabs.props.tabPosition));
const sizeName = computed(() => isHorizontal2.value ? "width" : "height");
const navStyle = computed(() => {
const dir = sizeName.value === "width" ? "X" : "Y";
return {
transform: `translate${dir}(-${navOffset.value}px)`
};
});
const {
width: navContainerWidth,
height: navContainerHeight
} = useElementSize(navScroll$);
const {
width: navWidth,
height: navHeight
} = useElementSize(nav$, {
width: 0,
height: 0
}, {
box: "border-box"
});
const navContainerSize = computed(() => isHorizontal2.value ? navContainerWidth.value : navContainerHeight.value);
const navSize = computed(() => isHorizontal2.value ? navWidth.value : navHeight.value);
const {
onWheel
} = useWheel({
atStartEdge: computed(() => navOffset.value <= 0),
atEndEdge: computed(() => navSize.value - navOffset.value <= navContainerSize.value),
layout: computed(() => isHorizontal2.value ? "horizontal" : "vertical")
}, (offset3) => {
navOffset.value = clamp_default(navOffset.value + offset3, 0, navSize.value - navContainerSize.value);
});
const scrollPrev = () => {
if (!navScroll$.value) return;
const containerSize = navScroll$.value[`offset${capitalize2(sizeName.value)}`];
const currentOffset = navOffset.value;
if (!currentOffset) return;
const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
navOffset.value = newOffset;
};
const scrollNext = () => {
if (!navScroll$.value || !nav$.value) return;
const navSize2 = nav$.value[`offset${capitalize2(sizeName.value)}`];
const containerSize = navScroll$.value[`offset${capitalize2(sizeName.value)}`];
const currentOffset = navOffset.value;
if (navSize2 - currentOffset <= containerSize) return;
const newOffset = navSize2 - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize2 - containerSize;
navOffset.value = newOffset;
};
const scrollToActiveTab = async () => {
const nav = nav$.value;
if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return;
await nextTick();
const activeTab = tabRefsMap.value[props2.currentName];
if (!activeTab) return;
const navScroll = navScroll$.value;
const activeTabBounding = activeTab.getBoundingClientRect();
const navScrollBounding = navScroll.getBoundingClientRect();
const maxOffset = isHorizontal2.value ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
const currentOffset = navOffset.value;
let newOffset = currentOffset;
if (isHorizontal2.value) {
if (activeTabBounding.left < navScrollBounding.left) {
newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
}
if (activeTabBounding.right > navScrollBounding.right) {
newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
}
} else {
if (activeTabBounding.top < navScrollBounding.top) {
newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
}
if (activeTabBounding.bottom > navScrollBounding.bottom) {
newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
}
}
newOffset = Math.max(newOffset, 0);
navOffset.value = Math.min(newOffset, maxOffset);
};
const update = () => {
var _a;
if (!nav$.value || !navScroll$.value) return;
props2.stretch && ((_a = tabBarRef.value) == null ? void 0 : _a.update());
const navSize2 = nav$.value[`offset${capitalize2(sizeName.value)}`];
const containerSize = navScroll$.value[`offset${capitalize2(sizeName.value)}`];
const currentOffset = navOffset.value;
if (containerSize < navSize2) {
scrollable.value = scrollable.value || {};
scrollable.value.prev = currentOffset;
scrollable.value.next = currentOffset + containerSize < navSize2;
if (navSize2 - currentOffset < containerSize) {
navOffset.value = navSize2 - containerSize;
}
} else {
scrollable.value = false;
if (currentOffset > 0) {
navOffset.value = 0;
}
}
};
const changeTab = (event) => {
const code = getEventCode(event);
let step2 = 0;
switch (code) {
case EVENT_CODE.left:
case EVENT_CODE.up:
step2 = -1;
break;
case EVENT_CODE.right:
case EVENT_CODE.down:
step2 = 1;
break;
default:
return;
}
const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
const currentIndex = tabList.indexOf(event.target);
let nextIndex = currentIndex + step2;
if (nextIndex < 0) {
nextIndex = tabList.length - 1;
} else if (nextIndex >= tabList.length) {
nextIndex = 0;
}
tabList[nextIndex].focus({
preventScroll: true
});
tabList[nextIndex].click();
setFocus();
};
const setFocus = () => {
if (focusable.value) isFocus.value = true;
};
const removeFocus = () => isFocus.value = false;
const setRefs = (el, key) => {
tabRefsMap.value[key] = el;
};
const focusActiveTab = async () => {
await nextTick();
const activeTab = tabRefsMap.value[props2.currentName];
activeTab == null ? void 0 : activeTab.focus({
preventScroll: true
});
};
watch(visibility, (visibility2) => {
if (visibility2 === "hidden") {
focusable.value = false;
} else if (visibility2 === "visible") {
setTimeout(() => focusable.value = true, 50);
}
});
watch(focused, (focused2) => {
if (focused2) {
setTimeout(() => focusable.value = true, 50);
} else {
focusable.value = false;
}
});
useResizeObserver(el$, () => {
rAF(update);
});
onMounted(() => setTimeout(() => scrollToActiveTab(), 0));
onUpdated(() => update());
expose({
scrollToActiveTab,
removeFocus,
focusActiveTab,
tabListRef: nav$,
tabBarRef,
scheduleRender: () => triggerRef(tracker)
});
return () => {
const scrollBtn = scrollable.value ? [createVNode("span", {
"class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
"onClick": scrollPrev
}, [createVNode(ElIcon, null, {
default: () => [createVNode(arrow_left_default, null, null)]
})]), createVNode("span", {
"class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
"onClick": scrollNext
}, [createVNode(ElIcon, null, {
default: () => [createVNode(arrow_right_default, null, null)]
})])] : null;
const tabs = props2.panes.map((pane, index) => {
var _a, _b, _c, _d, _e;
const uid2 = pane.uid;
const disabled = pane.props.disabled;
const tabName = (_b = (_a = pane.props.name) != null ? _a : pane.index) != null ? _b : `${index}`;
const closable = !disabled && (pane.isClosable || pane.props.closable !== false && props2.editable);
pane.index = `${index}`;
const btnClose = closable ? createVNode(ElIcon, {
"class": "is-icon-close",
"onClick": (ev) => emit("tabRemove", pane, ev)
}, {
default: () => [createVNode(close_default, null, null)]
}) : null;
const tabLabelContent = ((_d = (_c = pane.slots).label) == null ? void 0 : _d.call(_c)) || pane.props.label;
const tabindex = !disabled && pane.active ? (_e = props2.tabindex) != null ? _e : rootTabs.props.tabindex : -1;
return createVNode("div", {
"ref": (el) => setRefs(el, tabName),
"class": [ns.e("item"), ns.is(rootTabs.props.tabPosition), ns.is("active", pane.active), ns.is("disabled", disabled), ns.is("closable", closable), ns.is("focus", isFocus.value)],
"id": `tab-${tabName}`,
"key": `tab-${uid2}`,
"aria-controls": `pane-${tabName}`,
"role": "tab",
"aria-selected": pane.active,
"tabindex": tabindex,
"onFocus": () => setFocus(),
"onBlur": () => removeFocus(),
"onClick": (ev) => {
removeFocus();
emit("tabClick", pane, tabName, ev);
},
"onKeydown": (ev) => {
const code = getEventCode(ev);
if (closable && (code === EVENT_CODE.delete || code === EVENT_CODE.backspace)) {
emit("tabRemove", pane, ev);
}
}
}, [...[tabLabelContent, btnClose]]);
});
tracker.value;
return createVNode("div", {
"ref": el$,
"class": [ns.e("nav-wrap"), ns.is("scrollable", !!scrollable.value), ns.is(rootTabs.props.tabPosition)]
}, [scrollBtn, createVNode("div", {
"class": ns.e("nav-scroll"),
"ref": navScroll$
}, [props2.panes.length > 0 ? createVNode("div", {
"class": [ns.e("nav"), ns.is(rootTabs.props.tabPosition), ns.is("stretch", props2.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition))],
"ref": nav$,
"style": navStyle.value,
"role": "tablist",
"onKeydown": changeTab,
"onWheel": onWheel
}, [...[!props2.type ? createVNode(_sfc_main129, {
"ref": tabBarRef,
"tabs": [...props2.panes],
"tabRefs": tabRefsMap.value
}, null) : null, tabs]]) : null])]);
};
}
});
// node_modules/element-plus/es/components/tabs/src/tabs.mjs
var tabsProps = buildProps({
/**
* @description type of Tab
*/
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
/**
* @description whether Tab is closable
*/
closable: Boolean,
/**
* @description whether Tab is addable
*/
addable: Boolean,
/**
* @description binding value, name of the selected tab
*/
modelValue: {
type: [String, Number]
},
/**
* @description initial value when `model-value` is not set
*/
defaultValue: {
type: [String, Number]
},
/**
* @description whether Tab is addable and closable
*/
editable: Boolean,
/**
* @description position of tabs
*/
tabPosition: {
type: String,
values: ["top", "right", "bottom", "left"],
default: "top"
},
/**
* @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented
*/
beforeLeave: {
type: definePropType(Function),
default: () => true
},
/**
* @description whether width of tab automatically fits its container
*/
stretch: Boolean,
/**
* @description tabs tabindex
*/
tabindex: {
type: [String, Number],
default: 0
}
});
var isPaneName = (value) => isString(value) || isNumber(value);
var tabsEmits = {
[UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
tabClick: (pane, ev) => ev instanceof Event,
tabChange: (name) => isPaneName(name),
edit: (paneName, action) => ["remove", "add"].includes(action),
tabRemove: (name) => isPaneName(name),
tabAdd: () => true
};
var Tabs = defineComponent({
name: "ElTabs",
props: tabsProps,
emits: tabsEmits,
setup(props2, {
emit,
slots,
expose
}) {
var _a;
const ns = useNamespace("tabs");
const isVertical = computed(() => ["left", "right"].includes(props2.tabPosition));
const {
children: panes,
addChild: registerPane,
removeChild: unregisterPane,
ChildrenSorter: PanesSorter
} = useOrderedChildren(getCurrentInstance(), "ElTabPane");
const nav$ = ref();
const currentName = ref((_a = isUndefined(props2.modelValue) ? props2.defaultValue : props2.modelValue) != null ? _a : "0");
const setCurrentName = async (value, trigger = false) => {
var _a2, _b, _c, _d;
if (currentName.value === value || isUndefined(value)) return;
try {
let canLeave;
if (props2.beforeLeave) {
const result = props2.beforeLeave(value, currentName.value);
canLeave = result instanceof Promise ? await result : result;
} else {
canLeave = true;
}
if (canLeave !== false) {
const isFocusInsidePane = (_a2 = panes.value.find((item) => item.paneName === currentName.value)) == null ? void 0 : _a2.isFocusInsidePane();
currentName.value = value;
if (trigger) {
emit(UPDATE_MODEL_EVENT, value);
emit("tabChange", value);
}
(_c = (_b = nav$.value) == null ? void 0 : _b.removeFocus) == null ? void 0 : _c.call(_b);
if (isFocusInsidePane) {
(_d = nav$.value) == null ? void 0 : _d.focusActiveTab();
}
}
} catch (e) {
}
};
const handleTabClick = (tab, tabName, event) => {
if (tab.props.disabled) return;
emit("tabClick", tab, event);
setCurrentName(tabName, true);
};
const handleTabRemove = (pane, ev) => {
if (pane.props.disabled || isUndefined(pane.props.name)) return;
ev.stopPropagation();
emit("edit", pane.props.name, "remove");
emit("tabRemove", pane.props.name);
};
const handleTabAdd = () => {
emit("edit", void 0, "add");
emit("tabAdd");
};
const handleKeydown = (event) => {
const code = getEventCode(event);
if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(code)) handleTabAdd();
};
const swapChildren = (vnode) => {
const actualFirstChild = vnode.el.firstChild;
const firstChild = ["bottom", "right"].includes(props2.tabPosition) ? vnode.children[0].el : vnode.children[1].el;
if (actualFirstChild !== firstChild) {
actualFirstChild.before(firstChild);
}
};
watch(() => props2.modelValue, (modelValue) => setCurrentName(modelValue));
watch(currentName, async () => {
var _a2;
await nextTick();
(_a2 = nav$.value) == null ? void 0 : _a2.scrollToActiveTab();
});
provide(tabsRootContextKey, {
props: props2,
currentName,
registerPane,
unregisterPane,
nav$
});
expose({
currentName,
get tabNavRef() {
return omit_default(nav$.value, ["scheduleRender"]);
}
});
return () => {
const addSlot = slots["add-icon"];
const newButton = props2.editable || props2.addable ? createVNode("div", {
"class": [ns.e("new-tab"), isVertical.value && ns.e("new-tab-vertical")],
"tabindex": props2.tabindex,
"onClick": handleTabAdd,
"onKeydown": handleKeydown
}, [addSlot ? renderSlot(slots, "add-icon") : createVNode(ElIcon, {
"class": ns.is("icon-plus")
}, {
default: () => [createVNode(plus_default, null, null)]
})]) : null;
const tabNav = () => createVNode(TabNav, {
"ref": nav$,
"currentName": currentName.value,
"editable": props2.editable,
"type": props2.type,
"panes": panes.value,
"stretch": props2.stretch,
"onTabClick": handleTabClick,
"onTabRemove": handleTabRemove
}, null);
const header = createVNode("div", {
"class": [ns.e("header"), isVertical.value && ns.e("header-vertical"), ns.is(props2.tabPosition)]
}, [createVNode(PanesSorter, null, {
default: tabNav,
$stable: true
}), newButton]);
const panels = createVNode("div", {
"class": ns.e("content")
}, [renderSlot(slots, "default")]);
return createVNode("div", {
"class": [ns.b(), ns.m(props2.tabPosition), {
[ns.m("card")]: props2.type === "card",
[ns.m("border-card")]: props2.type === "border-card"
}],
"onVnodeMounted": swapChildren,
"onVnodeUpdated": swapChildren
}, [panels, header]);
};
}
});
// node_modules/element-plus/es/components/tabs/src/tab-pane.mjs
var tabPaneProps = buildProps({
/**
* @description title of the tab
*/
label: {
type: String,
default: ""
},
/**
* @description identifier corresponding to the name of Tabs, representing the alias of the tab-pane, the default is ordinal number of the tab-pane in the sequence, e.g. the first tab-pane is '0'
*/
name: {
type: [String, Number]
},
/**
* @description whether Tab is closable
*/
closable: {
type: Boolean,
default: void 0
},
/**
* @description whether Tab is disabled
*/
disabled: Boolean,
/**
* @description whether Tab is lazily rendered
*/
lazy: Boolean
});
// node_modules/element-plus/es/components/tabs/src/tab-pane.vue2.mjs
var _hoisted_169 = ["id", "aria-hidden", "aria-labelledby"];
var COMPONENT_NAME24 = "ElTabPane";
var _sfc_main130 = defineComponent({
...{
name: COMPONENT_NAME24
},
__name: "tab-pane",
props: tabPaneProps,
setup(__props) {
const props2 = __props;
const instance = getCurrentInstance();
const slots = useSlots();
const tabsRoot = inject(tabsRootContextKey);
if (!tabsRoot)
throwError(COMPONENT_NAME24, "usage: ");
const ns = useNamespace("tab-pane");
const paneRef = ref();
const index = ref();
const isClosable = computed(() => {
var _a;
return (_a = props2.closable) != null ? _a : tabsRoot.props.closable;
});
const active = computed(
() => {
var _a;
return tabsRoot.currentName.value === ((_a = props2.name) != null ? _a : index.value);
}
);
const loaded = ref(active.value);
const paneName = computed(() => {
var _a;
return (_a = props2.name) != null ? _a : index.value;
});
const shouldBeRender = computed(
() => !props2.lazy || loaded.value || active.value
);
const isFocusInsidePane = () => {
var _a;
return (_a = paneRef.value) == null ? void 0 : _a.contains(document.activeElement);
};
watch(active, (val) => {
if (val) loaded.value = true;
});
const pane = reactive({
uid: instance.uid,
getVnode: () => instance.vnode,
slots,
props: props2,
paneName,
active,
index,
isClosable,
isFocusInsidePane
});
tabsRoot.registerPane(pane);
onBeforeUnmount(() => {
tabsRoot.unregisterPane(pane);
});
onBeforeUpdate(() => {
var _a;
if (slots.label) (_a = tabsRoot.nav$.value) == null ? void 0 : _a.scheduleRender();
});
return (_ctx, _cache) => {
return shouldBeRender.value ? withDirectives((openBlock(), createElementBlock("div", {
key: 0,
id: `pane-${paneName.value}`,
ref_key: "paneRef",
ref: paneRef,
class: normalizeClass(unref(ns).b()),
role: "tabpanel",
"aria-hidden": !active.value,
"aria-labelledby": `tab-${paneName.value}`
}, [
renderSlot(_ctx.$slots, "default")
], 10, _hoisted_169)), [
[vShow, active.value]
]) : createCommentVNode("v-if", true);
};
}
});
// node_modules/element-plus/es/components/tabs/index.mjs
var ElTabs = withInstall(Tabs, {
TabPane: _sfc_main130
});
var ElTabPane = withNoopInstall(_sfc_main130);
// node_modules/element-plus/es/components/text/src/text.mjs
var textProps = buildProps({
/**
* @description text type
*/
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger", ""],
default: ""
},
/**
* @description text size
*/
size: {
type: String,
values: componentSizes,
default: ""
},
/**
* @description render ellipsis
*/
truncated: Boolean,
/**
* @description maximum lines
*/
lineClamp: {
type: [String, Number]
},
/**
* @description custom element tag
*/
tag: {
type: String,
default: "span"
}
});
// node_modules/element-plus/es/components/text/src/text.vue2.mjs
var _sfc_main131 = defineComponent({
...{
name: "ElText"
},
__name: "text",
props: textProps,
setup(__props) {
const props2 = __props;
const textRef = ref();
const textSize = useFormSize();
const ns = useNamespace("text");
const textKls = computed(() => [
ns.b(),
ns.m(props2.type),
ns.m(textSize.value),
ns.is("truncated", props2.truncated),
ns.is("line-clamp", !isUndefined(props2.lineClamp))
]);
const bindTitle = () => {
var _a, _b, _c, _d, _e, _f, _g;
const inheritTitle = useAttrs().title;
if (inheritTitle) return;
let shouldAddTitle = false;
const text = ((_a = textRef.value) == null ? void 0 : _a.textContent) || "";
if (props2.truncated) {
const width = (_b = textRef.value) == null ? void 0 : _b.offsetWidth;
const scrollWidth = (_c = textRef.value) == null ? void 0 : _c.scrollWidth;
if (width && scrollWidth && scrollWidth > width) {
shouldAddTitle = true;
}
} else if (!isUndefined(props2.lineClamp)) {
const height = (_d = textRef.value) == null ? void 0 : _d.offsetHeight;
const scrollHeight = (_e = textRef.value) == null ? void 0 : _e.scrollHeight;
if (height && scrollHeight && scrollHeight > height) {
shouldAddTitle = true;
}
}
if (shouldAddTitle) {
(_f = textRef.value) == null ? void 0 : _f.setAttribute("title", text);
} else {
(_g = textRef.value) == null ? void 0 : _g.removeAttribute("title");
}
};
onMounted(bindTitle);
onUpdated(bindTitle);
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
ref_key: "textRef",
ref: textRef,
class: normalizeClass(textKls.value),
style: normalizeStyle({ "-webkit-line-clamp": __props.lineClamp })
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "style"]);
};
}
});
// node_modules/element-plus/es/components/text/index.mjs
var ElText = withInstall(_sfc_main131);
// node_modules/element-plus/es/components/time-select/src/time-select.mjs
var timeSelectProps = buildProps({
/**
* @description set format of time
*/
format: {
type: String,
default: "HH:mm"
},
/**
* @description binding value
*/
modelValue: {
type: definePropType(String)
},
/**
* @description whether TimeSelect is disabled
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description whether the input is editable
*/
editable: {
type: Boolean,
default: true
},
/**
* @description Tooltip theme, built-in theme: `dark` / `light`
*/
effect: {
type: definePropType(String),
default: "light"
},
/**
* @description whether to show clear button
*/
clearable: {
type: Boolean,
default: true
},
/**
* @description size of Input
*/
size: useSizeProp,
/**
* @description placeholder in non-range mode
*/
placeholder: String,
/**
* @description start time
*/
start: {
type: String,
default: "09:00"
},
/**
* @description end time
*/
end: {
type: String,
default: "18:00"
},
/**
* @description time step
*/
step: {
type: String,
default: "00:30"
},
/**
* @description minimum time, any time before this time will be disabled
*/
minTime: {
type: definePropType(String)
},
/**
* @description maximum time, any time after this time will be disabled
*/
maxTime: {
type: definePropType(String)
},
/**
* @description whether `end` is included in options
*/
includeEndTime: Boolean,
/**
* @description same as `name` in native input
*/
name: String,
/**
* @description custom prefix icon component
*/
prefixIcon: {
type: definePropType([String, Object]),
default: () => clock_default
},
/**
* @description custom clear icon component
*/
clearIcon: {
type: definePropType([String, Object]),
default: () => circle_close_default
},
/**
* @description custom class name for TimeSelect's dropdown
*/
popperClass: {
type: String,
default: ""
},
/**
* @description custom style for TimeSelect's dropdown
*/
popperStyle: {
type: definePropType([String, Object])
},
...useEmptyValuesProps
});
// node_modules/element-plus/es/components/time-select/src/time-select.vue2.mjs
var import_dayjs19 = __toESM(require_dayjs_min(), 1);
var import_customParseFormat3 = __toESM(require_customParseFormat(), 1);
// node_modules/element-plus/es/components/time-select/src/utils.mjs
var parseTime = (time) => {
const values = (time || "").split(":");
if (values.length >= 2) {
let hours = Number.parseInt(values[0], 10);
const minutes = Number.parseInt(values[1], 10);
const timeUpper = time.toUpperCase();
if (timeUpper.includes("AM") && hours === 12) {
hours = 0;
} else if (timeUpper.includes("PM") && hours !== 12) {
hours += 12;
}
return {
hours,
minutes
};
}
return null;
};
var compareTime = (time1, time2) => {
const value1 = parseTime(time1);
if (!value1) return -1;
const value2 = parseTime(time2);
if (!value2) return -1;
const minutes1 = value1.minutes + value1.hours * 60;
const minutes2 = value2.minutes + value2.hours * 60;
if (minutes1 === minutes2) {
return 0;
}
return minutes1 > minutes2 ? 1 : -1;
};
var padTime = (time) => {
return `${time}`.padStart(2, "0");
};
var formatTime2 = (time) => {
return `${padTime(time.hours)}:${padTime(time.minutes)}`;
};
var nextTime = (time, step2) => {
const timeValue = parseTime(time);
if (!timeValue) return "";
const stepValue = parseTime(step2);
if (!stepValue) return "";
const next = {
hours: timeValue.hours,
minutes: timeValue.minutes
};
next.minutes += stepValue.minutes;
next.hours += stepValue.hours;
next.hours += Math.floor(next.minutes / 60);
next.minutes = next.minutes % 60;
return formatTime2(next);
};
// node_modules/element-plus/es/components/time-select/src/time-select.vue2.mjs
var _sfc_main132 = defineComponent({
...{
name: "ElTimeSelect"
},
__name: "time-select",
props: timeSelectProps,
emits: [CHANGE_EVENT, "blur", "focus", "clear", UPDATE_MODEL_EVENT],
setup(__props, { expose: __expose }) {
import_dayjs19.default.extend(import_customParseFormat3.default);
const { Option: ElOption2 } = ElSelect;
const props2 = __props;
const nsInput = useNamespace("input");
const select = ref();
const _disabled = useFormDisabled();
const { lang } = useLocale();
const value = computed(() => props2.modelValue);
const start = computed(() => {
const time = parseTime(props2.start);
return time ? formatTime2(time) : null;
});
const end = computed(() => {
const time = parseTime(props2.end);
return time ? formatTime2(time) : null;
});
const step2 = computed(() => {
const time = parseTime(props2.step);
return time ? formatTime2(time) : null;
});
const minTime = computed(() => {
const time = parseTime(props2.minTime || "");
return time ? formatTime2(time) : null;
});
const maxTime = computed(() => {
const time = parseTime(props2.maxTime || "");
return time ? formatTime2(time) : null;
});
const items = computed(() => {
var _a;
const result = [];
const push = (formattedValue, rawValue) => {
result.push({
value: formattedValue,
disabled: compareTime(rawValue, minTime.value || "-1:-1") <= 0 || compareTime(rawValue, maxTime.value || "100:100") >= 0
});
};
if (props2.start && props2.end && props2.step) {
let current = start.value;
let currentTime;
while (current && end.value && compareTime(current, end.value) <= 0) {
currentTime = (0, import_dayjs19.default)(current, "HH:mm").locale(lang.value).format(props2.format);
push(currentTime, current);
current = nextTime(current, step2.value);
}
if (props2.includeEndTime && end.value && ((_a = result[result.length - 1]) == null ? void 0 : _a.value) !== end.value) {
const formattedValue = (0, import_dayjs19.default)(end.value, "HH:mm").locale(lang.value).format(props2.format);
push(formattedValue, end.value);
}
}
return result;
});
const blur = () => {
var _a, _b;
(_b = (_a = select.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
};
const focus = () => {
var _a, _b;
(_b = (_a = select.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
};
__expose({
/**
* @description blur the Input component
*/
blur,
/**
* @description focus the Input component
*/
focus
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ElSelect), {
ref_key: "select",
ref: select,
"model-value": value.value,
disabled: unref(_disabled),
clearable: __props.clearable,
"clear-icon": __props.clearIcon,
size: __props.size,
effect: __props.effect,
placeholder: __props.placeholder,
"default-first-option": "",
filterable: __props.editable,
"empty-values": __props.emptyValues,
"value-on-clear": __props.valueOnClear,
"popper-class": __props.popperClass,
"popper-style": __props.popperStyle,
"onUpdate:modelValue": _cache[0] || (_cache[0] = (event) => _ctx.$emit(unref(UPDATE_MODEL_EVENT), event)),
onChange: _cache[1] || (_cache[1] = (event) => _ctx.$emit(unref(CHANGE_EVENT), event)),
onBlur: _cache[2] || (_cache[2] = (event) => _ctx.$emit("blur", event)),
onFocus: _cache[3] || (_cache[3] = (event) => _ctx.$emit("focus", event)),
onClear: _cache[4] || (_cache[4] = () => _ctx.$emit("clear"))
}, {
prefix: withCtx(() => [
__props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(nsInput).e("prefix-icon"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
]),
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(items.value, (item) => {
return openBlock(), createBlock(unref(ElOption2), {
key: item.value,
label: item.value,
value: item.value,
disabled: item.disabled
}, null, 8, ["label", "value", "disabled"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["model-value", "disabled", "clearable", "clear-icon", "size", "effect", "placeholder", "filterable", "empty-values", "value-on-clear", "popper-class", "popper-style"]);
};
}
});
// node_modules/element-plus/es/components/time-select/index.mjs
var ElTimeSelect = withInstall(_sfc_main132);
// node_modules/element-plus/es/components/timeline/src/tokens.mjs
var TIMELINE_INJECTION_KEY = "timeline";
// node_modules/element-plus/es/components/timeline/src/timeline.mjs
var timelineProps = buildProps({
/**
* @description relative position of timeline and content
*/
mode: {
type: String,
values: ["start", "alternate", "alternate-reverse", "end"],
default: "start"
},
/**
* @description whether reverse order
*/
reverse: Boolean
});
var Timeline = defineComponent({
name: "ElTimeline",
props: timelineProps,
setup(props2, { slots }) {
const ns = useNamespace("timeline");
provide(TIMELINE_INJECTION_KEY, { props: props2, slots });
const timelineKls = computed(() => [ns.b(), ns.is(props2.mode)]);
return () => {
var _a, _b;
const children = flattedChildren(
(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : []
);
return h(
"ul",
{ class: timelineKls.value },
props2.reverse ? children.reverse() : children
);
};
}
});
// node_modules/element-plus/es/components/timeline/src/timeline-item.mjs
var timelineItemProps = buildProps({
/**
* @description timestamp content
*/
timestamp: {
type: String,
default: ""
},
/**
* @description whether to show timestamp
*/
hideTimestamp: Boolean,
/**
* @description whether vertically centered
*/
center: Boolean,
/**
* @description position of timestamp
*/
placement: {
type: String,
values: ["top", "bottom"],
default: "bottom"
},
/**
* @description node type
*/
type: {
type: String,
values: ["primary", "success", "warning", "danger", "info"],
default: ""
},
/**
* @description background color of node
*/
color: {
type: String,
default: ""
},
/**
* @description node size
*/
size: {
type: String,
values: ["normal", "large"],
default: "normal"
},
/**
* @description icon component
*/
icon: {
type: iconPropType
},
/**
* @description icon is hollow
*/
hollow: Boolean
});
// node_modules/element-plus/es/components/timeline/src/timeline-item.vue2.mjs
var _sfc_main133 = defineComponent({
...{
name: "ElTimelineItem"
},
__name: "timeline-item",
props: timelineItemProps,
setup(__props) {
const props2 = __props;
const { props: timelineProps2 } = inject(
TIMELINE_INJECTION_KEY
);
const ns = useNamespace("timeline-item");
const defaultNodeKls = computed(() => [
ns.e("node"),
ns.em("node", props2.size || ""),
ns.em("node", props2.type || ""),
ns.is("hollow", props2.hollow)
]);
const timelineItemKls = computed(() => [
ns.b(),
{ [ns.e("center")]: props2.center },
ns.is(timelineProps2.mode)
]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(timelineItemKls.value)
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("tail"))
},
null,
2
/* CLASS */
),
!_ctx.$slots.dot ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(defaultNodeKls.value),
style: normalizeStyle({
backgroundColor: __props.color
})
},
[
__props.icon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("icon"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : createCommentVNode("v-if", true),
_ctx.$slots.dot ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("dot"))
},
[
renderSlot(_ctx.$slots, "dot")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("wrapper"))
},
[
!__props.hideTimestamp && __props.placement === "top" ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")])
},
toDisplayString(__props.timestamp),
3
/* TEXT, CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("content"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
!__props.hideTimestamp && __props.placement === "bottom" ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")])
},
toDisplayString(__props.timestamp),
3
/* TEXT, CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/timeline/index.mjs
var ElTimeline = withInstall(Timeline, {
TimelineItem: _sfc_main133
});
var ElTimelineItem = withNoopInstall(_sfc_main133);
// node_modules/element-plus/es/components/transfer/src/transfer.mjs
var LEFT_CHECK_CHANGE_EVENT = "left-check-change";
var RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
var transferProps = buildProps({
/**
* @description data source
*/
data: {
type: definePropType(Array),
default: () => []
},
/**
* @description custom list titles
*/
titles: {
type: definePropType(Array),
default: () => []
},
/**
* @description custom button texts
*/
buttonTexts: {
type: definePropType(Array),
default: () => []
},
/**
* @description placeholder for the filter input
*/
filterPlaceholder: String,
/**
* @description custom filter method
*/
filterMethod: {
type: definePropType(
Function
)
},
/**
* @description key array of initially checked data items of the left list
*/
leftDefaultChecked: {
type: definePropType(Array),
default: () => []
},
/**
* @description key array of initially checked data items of the right list
*/
rightDefaultChecked: {
type: definePropType(Array),
default: () => []
},
/**
* @description custom render function for data items
*/
renderContent: {
type: definePropType(Function)
},
/**
* @description binding value
*/
modelValue: {
type: definePropType(Array),
default: () => []
},
/**
* @description texts for checking status in list header
*/
format: {
type: definePropType(Object),
default: () => ({})
},
/**
* @description whether Transfer is filterable
*/
filterable: Boolean,
/**
* @description prop aliases for data source
*/
props: {
type: definePropType(Object),
default: () => mutable({
label: "label",
key: "key",
disabled: "disabled"
})
},
/**
* @description order strategy for elements in the target list. If set to `original`, the elements will keep the same order as the data source. If set to `push`, the newly added elements will be pushed to the bottom. If set to `unshift`, the newly added elements will be inserted on the top
*/
targetOrder: {
type: String,
values: ["original", "push", "unshift"],
default: "original"
},
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: Boolean,
default: true
}
});
var transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil_default(movedKeys);
var transferEmits = {
[CHANGE_EVENT]: (value, direction2, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction2),
[UPDATE_MODEL_EVENT]: (value) => isArray(value),
[LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
[RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
};
// node_modules/element-plus/es/components/transfer/src/transfer-panel.mjs
var CHECKED_CHANGE_EVENT = "checked-change";
var transferPanelProps = buildProps({
data: transferProps.data,
optionRender: {
type: definePropType(
Function
)
},
placeholder: String,
title: String,
filterable: Boolean,
format: transferProps.format,
filterMethod: transferProps.filterMethod,
defaultChecked: transferProps.leftDefaultChecked,
props: transferProps.props
});
var transferPanelEmits = {
[CHECKED_CHANGE_EVENT]: transferCheckedChangeFn
};
// node_modules/element-plus/es/components/transfer/src/composables/use-props-alias.mjs
var usePropsAlias = (props2) => {
const initProps = {
label: "label",
key: "key",
disabled: "disabled"
};
return computed(() => ({
...initProps,
...props2.props
}));
};
// node_modules/element-plus/es/components/transfer/src/composables/use-check.mjs
var useCheck = (props2, panelState, emit) => {
const propsAlias = usePropsAlias(props2);
const filteredData = computed(() => {
return props2.data.filter((item) => {
if (isFunction(props2.filterMethod)) {
return props2.filterMethod(panelState.query, item);
} else {
const label = String(
item[propsAlias.value.label] || item[propsAlias.value.key]
);
return label.toLowerCase().includes(panelState.query.toLowerCase());
}
});
});
const checkableData = computed(
() => filteredData.value.filter((item) => !item[propsAlias.value.disabled])
);
const checkedSummary = computed(() => {
const checkedLength = panelState.checked.length;
const dataLength = props2.data.length;
const { noChecked, hasChecked } = props2.format;
if (noChecked && hasChecked) {
return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
} else {
return `${checkedLength}/${dataLength}`;
}
});
const isIndeterminate = computed(() => {
const checkedLength = panelState.checked.length;
return checkedLength > 0 && checkedLength < checkableData.value.length;
});
const updateAllChecked = () => {
const checkableDataKeys = checkableData.value.map(
(item) => item[propsAlias.value.key]
);
panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item));
};
const handleAllCheckedChange = (value) => {
panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
};
watch(
() => panelState.checked,
(val, oldVal) => {
updateAllChecked();
if (panelState.checkChangeByUser) {
const movedKeys = val.concat(oldVal).filter((v2) => !val.includes(v2) || !oldVal.includes(v2));
emit(CHECKED_CHANGE_EVENT, val, movedKeys);
} else {
emit(CHECKED_CHANGE_EVENT, val);
panelState.checkChangeByUser = true;
}
}
);
watch(checkableData, () => {
updateAllChecked();
});
watch(
() => props2.data,
() => {
const checked = [];
const filteredDataKeys = filteredData.value.map(
(item) => item[propsAlias.value.key]
);
panelState.checked.forEach((item) => {
if (filteredDataKeys.includes(item)) {
checked.push(item);
}
});
panelState.checkChangeByUser = false;
panelState.checked = checked;
}
);
watch(
() => props2.defaultChecked,
(val, oldVal) => {
if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item)))
return;
const checked = [];
const checkableDataKeys = checkableData.value.map(
(item) => item[propsAlias.value.key]
);
val.forEach((item) => {
if (checkableDataKeys.includes(item)) {
checked.push(item);
}
});
panelState.checkChangeByUser = false;
panelState.checked = checked;
},
{
immediate: true
}
);
return {
filteredData,
checkableData,
checkedSummary,
isIndeterminate,
updateAllChecked,
handleAllCheckedChange
};
};
// node_modules/element-plus/es/components/transfer/src/transfer-panel.vue2.mjs
var _sfc_main134 = defineComponent({
...{
name: "ElTransferPanel"
},
__name: "transfer-panel",
props: transferPanelProps,
emits: transferPanelEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const slots = useSlots();
const OptionContent = ({ option }) => option;
const { t } = useLocale();
const ns = useNamespace("transfer");
const panelState = reactive({
checked: [],
allChecked: false,
query: "",
checkChangeByUser: true
});
const propsAlias = usePropsAlias(props2);
const {
filteredData,
checkedSummary,
isIndeterminate,
handleAllCheckedChange
} = useCheck(props2, panelState, emit);
const hasNoMatch = computed(
() => !isEmpty(panelState.query) && isEmpty(filteredData.value)
);
const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
const { checked, allChecked, query } = toRefs(panelState);
__expose({
/** @description filter keyword */
query
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b("panel"))
},
[
createBaseVNode(
"p",
{
class: normalizeClass(unref(ns).be("panel", "header"))
},
[
createVNode(unref(ElCheckbox), {
modelValue: unref(allChecked),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(allChecked) ? allChecked.value = $event : null),
indeterminate: unref(isIndeterminate),
"validate-event": false,
onChange: unref(handleAllCheckedChange)
}, {
default: withCtx(() => [
createTextVNode(
toDisplayString(__props.title) + " ",
1
/* TEXT */
),
createBaseVNode(
"span",
null,
toDisplayString(unref(checkedSummary)),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["modelValue", "indeterminate", "onChange"])
],
2
/* CLASS */
),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", hasFooter.value)])
},
[
__props.filterable ? (openBlock(), createBlock(unref(ElInput), {
key: 0,
modelValue: unref(query),
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(query) ? query.value = $event : null),
class: normalizeClass(unref(ns).be("panel", "filter")),
size: "default",
placeholder: __props.placeholder,
"prefix-icon": unref(search_default),
clearable: "",
"validate-event": false
}, null, 8, ["modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
withDirectives(createVNode(unref(ElCheckboxGroup), {
modelValue: unref(checked),
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null),
"validate-event": false,
class: normalizeClass([unref(ns).is("filterable", __props.filterable), unref(ns).be("panel", "list")])
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(unref(filteredData), (item) => {
return openBlock(), createBlock(unref(ElCheckbox), {
key: item[unref(propsAlias).key],
class: normalizeClass(unref(ns).be("panel", "item")),
value: item[unref(propsAlias).key],
disabled: item[unref(propsAlias).disabled],
"validate-event": false
}, {
default: withCtx(() => {
var _a;
return [
createVNode(OptionContent, {
option: (_a = __props.optionRender) == null ? void 0 : _a.call(__props, item)
}, null, 8, ["option"])
];
}),
_: 2
/* DYNAMIC */
}, 1032, ["class", "value", "disabled"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["modelValue", "class"]), [
[vShow, !hasNoMatch.value && !unref(isEmpty)(__props.data)]
]),
withDirectives(createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).be("panel", "empty"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => [
createTextVNode(
toDisplayString(hasNoMatch.value ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")),
1
/* TEXT */
)
])
],
2
/* CLASS */
), [
[vShow, hasNoMatch.value || unref(isEmpty)(__props.data)]
])
],
2
/* CLASS */
),
hasFooter.value ? (openBlock(), createElementBlock(
"p",
{
key: 0,
class: normalizeClass(unref(ns).be("panel", "footer"))
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/transfer/src/composables/use-computed-data.mjs
var useComputedData = (props2) => {
const propsAlias = usePropsAlias(props2);
const dataObj = computed(
() => props2.data.reduce((o2, cur) => (o2[cur[propsAlias.value.key]] = cur) && o2, {})
);
const sourceData = computed(
() => props2.data.filter(
(item) => !props2.modelValue.includes(item[propsAlias.value.key])
)
);
const targetData = computed(() => {
if (props2.targetOrder === "original") {
return props2.data.filter(
(item) => props2.modelValue.includes(item[propsAlias.value.key])
);
} else {
return props2.modelValue.reduce(
(arr, cur) => {
const val = dataObj.value[cur];
if (val) {
arr.push(val);
}
return arr;
},
[]
);
}
});
return {
sourceData,
targetData
};
};
// node_modules/element-plus/es/components/transfer/src/composables/use-move.mjs
var useMove = (props2, checkedState, emit) => {
const propsAlias = usePropsAlias(props2);
const _emit = (value, direction2, movedKeys) => {
emit(UPDATE_MODEL_EVENT, value);
emit(CHANGE_EVENT, value, direction2, movedKeys);
};
const addToLeft = () => {
const currentValue = props2.modelValue.slice();
checkedState.rightChecked.forEach((item) => {
const index = currentValue.indexOf(item);
if (index > -1) {
currentValue.splice(index, 1);
}
});
_emit(currentValue, "left", checkedState.rightChecked);
};
const addToRight = () => {
let currentValue = props2.modelValue.slice();
const itemsToBeMoved = props2.data.filter((item) => {
const itemKey = item[propsAlias.value.key];
return checkedState.leftChecked.includes(itemKey) && !props2.modelValue.includes(itemKey);
}).map((item) => item[propsAlias.value.key]);
currentValue = props2.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
if (props2.targetOrder === "original") {
currentValue = props2.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]);
}
_emit(currentValue, "right", checkedState.leftChecked);
};
return {
addToLeft,
addToRight
};
};
// node_modules/element-plus/es/components/transfer/src/composables/use-checked-change.mjs
var useCheckedChange = (checkedState, emit) => {
const onSourceCheckedChange = (val, movedKeys) => {
checkedState.leftChecked = val;
if (!movedKeys) return;
emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
};
const onTargetCheckedChange = (val, movedKeys) => {
checkedState.rightChecked = val;
if (!movedKeys) return;
emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
};
return {
onSourceCheckedChange,
onTargetCheckedChange
};
};
// node_modules/element-plus/es/components/transfer/src/transfer.vue2.mjs
var _hoisted_170 = { key: 0 };
var _hoisted_238 = { key: 0 };
var _sfc_main135 = defineComponent({
...{
name: "ElTransfer"
},
__name: "transfer",
props: transferProps,
emits: transferEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const slots = useSlots();
const { t } = useLocale();
const ns = useNamespace("transfer");
const { formItem } = useFormItem();
const checkedState = reactive({
leftChecked: [],
rightChecked: []
});
const propsAlias = usePropsAlias(props2);
const { sourceData, targetData } = useComputedData(props2);
const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(
checkedState,
emit
);
const { addToLeft, addToRight } = useMove(props2, checkedState, emit);
const leftPanel = ref();
const rightPanel = ref();
const clearQuery = (which) => {
switch (which) {
case "left":
leftPanel.value.query = "";
break;
case "right":
rightPanel.value.query = "";
break;
}
};
const hasButtonTexts = computed(() => props2.buttonTexts.length === 2);
const leftPanelTitle = computed(
() => props2.titles[0] || t("el.transfer.titles.0")
);
const rightPanelTitle = computed(
() => props2.titles[1] || t("el.transfer.titles.1")
);
const panelFilterPlaceholder = computed(
() => props2.filterPlaceholder || t("el.transfer.filterPlaceholder")
);
watch(
() => props2.modelValue,
() => {
var _a;
if (props2.validateEvent) {
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
}
}
);
const optionRender = computed(() => (option) => {
var _a;
if (props2.renderContent) return props2.renderContent(h, option);
const defaultSlotVNodes = (((_a = slots.default) == null ? void 0 : _a.call(slots, { option })) || []).filter(
(node) => node.type !== Comment
);
if (defaultSlotVNodes.length) {
return defaultSlotVNodes;
}
return h(
"span",
option[propsAlias.value.label] || option[propsAlias.value.key]
);
});
__expose({
/** @description clear the filter keyword of a certain panel */
clearQuery,
/** @description left panel ref */
leftPanel,
/** @description right panel ref */
rightPanel
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(unref(ns).b())
},
[
createVNode(_sfc_main134, {
ref_key: "leftPanel",
ref: leftPanel,
data: unref(sourceData),
"option-render": optionRender.value,
placeholder: panelFilterPlaceholder.value,
title: leftPanelTitle.value,
filterable: __props.filterable,
format: __props.format,
"filter-method": __props.filterMethod,
"default-checked": __props.leftDefaultChecked,
props: props2.props,
onCheckedChange: unref(onSourceCheckedChange)
}, {
empty: withCtx(() => [
renderSlot(_ctx.$slots, "left-empty")
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "left-footer")
]),
_: 3
/* FORWARDED */
}, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).e("buttons"))
},
[
createVNode(unref(ElButton), {
type: "primary",
class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
disabled: unref(isEmpty)(checkedState.rightChecked),
onClick: unref(addToLeft)
}, {
default: withCtx(() => [
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_left_default))
]),
_: 1
/* STABLE */
}),
!unref(isUndefined)(__props.buttonTexts[0]) ? (openBlock(), createElementBlock(
"span",
_hoisted_170,
toDisplayString(__props.buttonTexts[0]),
1
/* TEXT */
)) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
}, 8, ["class", "disabled", "onClick"]),
createVNode(unref(ElButton), {
type: "primary",
class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
disabled: unref(isEmpty)(checkedState.leftChecked),
onClick: unref(addToRight)
}, {
default: withCtx(() => [
!unref(isUndefined)(__props.buttonTexts[1]) ? (openBlock(), createElementBlock(
"span",
_hoisted_238,
toDisplayString(__props.buttonTexts[1]),
1
/* TEXT */
)) : createCommentVNode("v-if", true),
createVNode(unref(ElIcon), null, {
default: withCtx(() => [
createVNode(unref(arrow_right_default))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}, 8, ["class", "disabled", "onClick"])
],
2
/* CLASS */
),
createVNode(_sfc_main134, {
ref_key: "rightPanel",
ref: rightPanel,
data: unref(targetData),
"option-render": optionRender.value,
placeholder: panelFilterPlaceholder.value,
filterable: __props.filterable,
format: __props.format,
"filter-method": __props.filterMethod,
title: rightPanelTitle.value,
"default-checked": __props.rightDefaultChecked,
props: props2.props,
onCheckedChange: unref(onTargetCheckedChange)
}, {
empty: withCtx(() => [
renderSlot(_ctx.$slots, "right-empty")
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "right-footer")
]),
_: 3
/* FORWARDED */
}, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/transfer/index.mjs
var ElTransfer = withInstall(_sfc_main135);
// node_modules/element-plus/es/components/tree/src/model/util.mjs
var NODE_KEY = "$treeNodeId";
var markNodeData = function(node, data) {
if (!data || data[NODE_KEY]) return;
Object.defineProperty(data, NODE_KEY, {
value: node.id,
enumerable: false,
configurable: false,
writable: false
});
};
var getNodeKey = (key, data) => data == null ? void 0 : data[key || NODE_KEY];
var handleCurrentChange = (store, emit, setCurrent) => {
const preCurrentNode = store.value.currentNode;
setCurrent();
const currentNode = store.value.currentNode;
if (preCurrentNode === currentNode) return;
emit("current-change", currentNode ? currentNode.data : null, currentNode);
};
// node_modules/element-plus/es/components/tree/src/model/node.mjs
var __defProp7 = Object.defineProperty;
var __defNormalProp7 = (obj, key, value) => key in obj ? __defProp7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField7 = (obj, key, value) => __defNormalProp7(obj, typeof key !== "symbol" ? key + "" : key, value);
var getChildState = (node) => {
let all = true;
let none = true;
let allWithoutDisable = true;
let isEffectivelyChecked = true;
for (let i = 0, j = node.length; i < j; i++) {
const n = node[i];
if (n.checked !== true || n.indeterminate) {
all = false;
if (!n.disabled) {
allWithoutDisable = false;
}
}
if (n.checked !== false || n.indeterminate) {
none = false;
}
if (!n.isEffectivelyChecked) {
isEffectivelyChecked = false;
}
}
return {
all,
none,
allWithoutDisable,
half: !all && !none,
isEffectivelyChecked
};
};
var reInitChecked = function(node) {
if (node.childNodes.length === 0 || node.loading) {
node.isEffectivelyChecked = node.disabled || node.checked;
return;
}
const { all, none, half, isEffectivelyChecked } = getChildState(
node.childNodes
);
node.isEffectivelyChecked = isEffectivelyChecked;
if (all) {
node.checked = true;
node.indeterminate = false;
} else if (half) {
node.checked = false;
node.indeterminate = true;
} else if (none) {
node.checked = false;
node.indeterminate = false;
}
const parent = node.parent;
if (!parent || parent.level === 0) return;
if (!node.store.checkStrictly) {
reInitChecked(parent);
}
};
var getPropertyFromData = function(node, prop) {
const props2 = node.store.props;
const data = node.data || {};
const config = props2[prop];
if (isFunction(config)) {
return config(data, node);
} else if (isString(config)) {
return data[config];
} else if (isUndefined(config)) {
const dataProp = data[prop];
return isUndefined(dataProp) ? "" : dataProp;
}
};
var setCanFocus = function(childNodes, focus) {
childNodes.forEach((item) => {
item.canFocus = focus;
setCanFocus(item.childNodes, focus);
});
};
var nodeIdSeed = 0;
var Node3 = class _Node {
constructor(options) {
__publicField7(this, "id");
__publicField7(this, "text");
__publicField7(this, "checked");
__publicField7(this, "indeterminate");
__publicField7(this, "data");
__publicField7(this, "expanded");
__publicField7(this, "parent");
__publicField7(this, "visible");
__publicField7(this, "isCurrent");
__publicField7(this, "store");
__publicField7(this, "isLeafByUser");
__publicField7(this, "isLeaf");
__publicField7(this, "canFocus");
__publicField7(this, "level");
__publicField7(this, "loaded");
__publicField7(this, "childNodes");
__publicField7(this, "loading");
__publicField7(this, "isEffectivelyChecked", false);
this.id = nodeIdSeed++;
this.text = null;
this.checked = false;
this.indeterminate = false;
this.data = null;
this.expanded = false;
this.parent = null;
this.visible = true;
this.isCurrent = false;
this.canFocus = false;
for (const name in options) {
if (hasOwn(options, name)) {
this[name] = options[name];
}
}
this.level = 0;
this.loaded = false;
this.childNodes = [];
this.loading = false;
if (this.parent) {
this.level = this.parent.level + 1;
}
}
initialize() {
var _a;
const store = this.store;
if (!store) {
throw new Error("[Node]store is required!");
}
store.registerNode(this);
const props2 = store.props;
if (props2 && typeof props2.isLeaf !== "undefined") {
const isLeaf2 = getPropertyFromData(this, "isLeaf");
if (isBoolean(isLeaf2)) {
this.isLeafByUser = isLeaf2;
}
}
if (store.lazy !== true && this.data) {
this.setData(this.data);
if (store.defaultExpandAll) {
this.expanded = true;
this.canFocus = true;
}
} else if (this.level > 0 && store.lazy && store.defaultExpandAll && !this.isLeafByUser) {
this.expand();
}
if (!isArray(this.data)) {
markNodeData(this, this.data);
}
if (!this.data) return;
const defaultExpandedKeys = store.defaultExpandedKeys;
const key = store.key;
if (key && !isNil_default(this.key) && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) {
this.expand(null, store.autoExpandParent);
}
if (key && store.currentNodeKey !== void 0 && this.key === store.currentNodeKey) {
store.currentNode && (store.currentNode.isCurrent = false);
store.currentNode = this;
store.currentNode.isCurrent = true;
}
if (store.lazy) {
store._initDefaultCheckedNode(this);
}
this.updateLeafState();
if (this.level === 1 || ((_a = this.parent) == null ? void 0 : _a.expanded) === true) this.canFocus = true;
}
setData(data) {
if (!isArray(data)) {
markNodeData(this, data);
}
this.data = data;
this.childNodes = [];
let children;
if (this.level === 0 && isArray(this.data)) {
children = this.data;
} else {
children = getPropertyFromData(this, "children") || [];
}
for (let i = 0, j = children.length; i < j; i++) {
this.insertChild({ data: children[i] });
}
}
get label() {
return getPropertyFromData(this, "label");
}
get key() {
const nodeKey = this.store.key;
if (this.data) return this.data[nodeKey];
return null;
}
get disabled() {
return getPropertyFromData(this, "disabled");
}
get nextSibling() {
const parent = this.parent;
if (parent) {
const index = parent.childNodes.indexOf(this);
if (index > -1) {
return parent.childNodes[index + 1];
}
}
return null;
}
get previousSibling() {
const parent = this.parent;
if (parent) {
const index = parent.childNodes.indexOf(this);
if (index > -1) {
return index > 0 ? parent.childNodes[index - 1] : null;
}
}
return null;
}
contains(target2, deep = true) {
return (this.childNodes || []).some(
(child) => child === target2 || deep && child.contains(target2)
);
}
remove() {
const parent = this.parent;
if (parent) {
parent.removeChild(this);
}
}
insertChild(child, index, batch) {
if (!child) throw new Error("InsertChild error: child is required.");
if (!(child instanceof _Node)) {
if (!batch) {
const children = this.getChildren(true);
if (!(children == null ? void 0 : children.includes(child.data))) {
if (isUndefined(index) || index < 0) {
children == null ? void 0 : children.push(child.data);
} else {
children == null ? void 0 : children.splice(index, 0, child.data);
}
}
}
Object.assign(child, {
parent: this,
store: this.store
});
child = reactive(new _Node(child));
if (child instanceof _Node) {
child.initialize();
}
}
child.level = this.level + 1;
if (isUndefined(index) || index < 0) {
this.childNodes.push(child);
} else {
this.childNodes.splice(index, 0, child);
}
this.updateLeafState();
}
insertBefore(child, ref2) {
let index;
if (ref2) {
index = this.childNodes.indexOf(ref2);
}
this.insertChild(child, index);
}
insertAfter(child, ref2) {
let index;
if (ref2) {
index = this.childNodes.indexOf(ref2);
if (index !== -1) index += 1;
}
this.insertChild(child, index);
}
removeChild(child) {
const children = this.getChildren() || [];
const dataIndex = children.indexOf(child.data);
if (dataIndex > -1) {
children.splice(dataIndex, 1);
}
const index = this.childNodes.indexOf(child);
if (index > -1) {
this.store && this.store.deregisterNode(child);
child.parent = null;
this.childNodes.splice(index, 1);
}
this.updateLeafState();
}
removeChildByData(data) {
const targetNode = this.childNodes.find((child) => child.data === data);
if (targetNode) {
this.removeChild(targetNode);
}
}
expand(callback, expandParent) {
const done = () => {
if (expandParent) {
let parent = this.parent;
while (parent && parent.level > 0) {
parent.expanded = true;
parent = parent.parent;
}
}
this.expanded = true;
if (callback) callback();
setCanFocus(this.childNodes, true);
};
if (this.shouldLoadData()) {
this.loadData((data) => {
if (isArray(data)) {
if (this.checked) {
this.setChecked(true, true);
} else if (!this.store.checkStrictly) {
reInitChecked(this);
}
done();
}
});
} else {
done();
}
}
doCreateChildren(array, defaultProps6 = {}) {
array.forEach((item) => {
this.insertChild(
Object.assign({ data: item }, defaultProps6),
void 0,
true
);
});
}
collapse() {
this.expanded = false;
setCanFocus(this.childNodes, false);
}
shouldLoadData() {
return Boolean(this.store.lazy === true && this.store.load && !this.loaded);
}
updateLeafState() {
if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") {
this.isLeaf = this.isLeafByUser;
this.isEffectivelyChecked = this.isLeaf && this.disabled;
return;
}
const childNodes = this.childNodes;
if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
this.isLeaf = !childNodes || childNodes.length === 0;
this.isEffectivelyChecked = this.isLeaf && this.disabled;
return;
}
this.isLeaf = false;
}
setChecked(value, deep, recursion, passValue) {
this.indeterminate = value === "half";
this.checked = value === true;
this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked);
if (this.store.checkStrictly) return;
if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
const handleDescendants = () => {
if (deep) {
const childNodes = this.childNodes;
for (let i = 0, j = childNodes.length; i < j; i++) {
const child = childNodes[i];
passValue = passValue || value !== false;
const isCheck = child.disabled && child.isLeaf ? child.checked : passValue;
child.setChecked(isCheck, deep, true, passValue);
}
const { half, all, isEffectivelyChecked } = getChildState(childNodes);
if (!all) {
this.checked = all;
this.indeterminate = half;
}
this.isEffectivelyChecked = !this.childNodes.length ? this.disabled || this.checked : isEffectivelyChecked;
}
};
if (this.shouldLoadData()) {
this.loadData(
() => {
handleDescendants();
reInitChecked(this);
},
{
checked: value !== false
}
);
return;
} else {
handleDescendants();
}
}
const parent = this.parent;
if (!parent || parent.level === 0) return;
if (!recursion) {
reInitChecked(parent);
}
}
getChildren(forceInit = false) {
if (this.level === 0) return this.data;
const data = this.data;
if (!data) return null;
const props2 = this.store.props;
let children = "children";
if (props2) {
children = props2.children || "children";
}
if (isUndefined(data[children])) {
data[children] = null;
}
if (forceInit && !data[children]) {
data[children] = [];
}
return data[children];
}
updateChildren() {
const newData = this.getChildren() || [];
const oldData = this.childNodes.map((node) => node.data);
const newDataMap = {};
const newNodes = [];
newData.forEach((item, index) => {
const key = item[NODE_KEY];
const isNodeExists = !!key && oldData.some((data) => (data == null ? void 0 : data[NODE_KEY]) === key);
if (isNodeExists) {
newDataMap[key] = { index, data: item };
} else {
newNodes.push({ index, data: item });
}
});
if (!this.store.lazy) {
oldData.forEach((item) => {
if (!newDataMap[item == null ? void 0 : item[NODE_KEY]]) this.removeChildByData(item);
});
}
newNodes.forEach(({ index, data }) => {
this.insertChild({ data }, index);
});
this.updateLeafState();
}
loadData(callback, defaultProps6 = {}) {
if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps6).length)) {
this.loading = true;
const resolve = (children) => {
this.childNodes = [];
this.doCreateChildren(children, defaultProps6);
this.loaded = true;
this.loading = false;
this.updateLeafState();
if (callback) {
callback.call(this, children);
}
};
const reject = () => {
this.loading = false;
};
this.store.load(this, resolve, reject);
} else {
if (callback) {
callback.call(this);
}
}
}
eachNode(callback) {
const arr = [this];
while (arr.length) {
const node = arr.shift();
arr.unshift(...node.childNodes);
callback(node);
}
}
reInitChecked() {
if (this.store.checkStrictly) return;
reInitChecked(this);
}
};
// node_modules/element-plus/es/components/tree/src/model/tree-store.mjs
var __defProp8 = Object.defineProperty;
var __defNormalProp8 = (obj, key, value) => key in obj ? __defProp8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField8 = (obj, key, value) => __defNormalProp8(obj, typeof key !== "symbol" ? key + "" : key, value);
var TreeStore = class {
constructor(options) {
__publicField8(this, "currentNode");
__publicField8(this, "currentNodeKey");
__publicField8(this, "nodesMap");
__publicField8(this, "root");
__publicField8(this, "data");
__publicField8(this, "lazy", false);
__publicField8(this, "load");
__publicField8(this, "filterNodeMethod");
__publicField8(this, "key");
__publicField8(this, "defaultCheckedKeys");
__publicField8(this, "checkStrictly", false);
__publicField8(this, "defaultExpandedKeys");
__publicField8(this, "autoExpandParent", false);
__publicField8(this, "defaultExpandAll", false);
__publicField8(this, "checkDescendants", false);
__publicField8(this, "props");
this.currentNode = null;
this.currentNodeKey = null;
for (const option in options) {
if (hasOwn(options, option)) {
this[option] = options[option];
}
}
this.nodesMap = {};
}
initialize() {
this.root = new Node3({
data: this.data,
store: this
});
this.root.initialize();
if (this.lazy && this.load) {
const loadFn = this.load;
loadFn(
this.root,
(data) => {
this.root.doCreateChildren(data);
this._initDefaultCheckedNodes();
},
NOOP
);
} else {
this._initDefaultCheckedNodes();
}
}
filter(value) {
const filterNodeMethod = this.filterNodeMethod;
const lazy = this.lazy;
const traverse = async function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
for (const [index, child] of childNodes.entries()) {
child.visible = !!(filterNodeMethod == null ? void 0 : filterNodeMethod.call(
child,
value,
child.data,
child
));
if (index % 80 === 0 && index > 0) {
await nextTick();
}
await traverse(child);
}
if (!node.visible && childNodes.length) {
let allHidden = true;
allHidden = !childNodes.some((child) => child.visible);
if (node.root) {
node.root.visible = allHidden === false;
} else {
node.visible = allHidden === false;
}
}
if (!value) return;
if (node.visible && !node.isLeaf) {
if (!lazy || node.loaded) {
node.expand();
}
}
};
traverse(this);
}
setData(newVal) {
const instanceChanged = newVal !== this.root.data;
if (instanceChanged) {
this.nodesMap = {};
this.root.setData(newVal);
this._initDefaultCheckedNodes();
this.setCurrentNodeKey(this.currentNodeKey);
} else {
this.root.updateChildren();
}
}
getNode(data) {
if (data instanceof Node3) return data;
const key = isObject(data) ? getNodeKey(this.key, data) : data;
return this.nodesMap[key] || null;
}
insertBefore(data, refData) {
var _a;
const refNode = this.getNode(refData);
(_a = refNode.parent) == null ? void 0 : _a.insertBefore({ data }, refNode);
}
insertAfter(data, refData) {
var _a;
const refNode = this.getNode(refData);
(_a = refNode.parent) == null ? void 0 : _a.insertAfter({ data }, refNode);
}
remove(data) {
const node = this.getNode(data);
if (node && node.parent) {
if (node === this.currentNode) {
this.currentNode = null;
}
node.parent.removeChild(node);
}
}
append(data, parentData) {
const parentNode = !isPropAbsent(parentData) ? this.getNode(parentData) : this.root;
if (parentNode) {
parentNode.insertChild({ data });
}
}
_initDefaultCheckedNodes() {
const defaultCheckedKeys = this.defaultCheckedKeys || [];
const nodesMap = this.nodesMap;
defaultCheckedKeys.forEach((checkedKey) => {
const node = nodesMap[checkedKey];
if (node) {
node.setChecked(true, !this.checkStrictly);
}
});
}
_initDefaultCheckedNode(node) {
const defaultCheckedKeys = this.defaultCheckedKeys || [];
if (!isNil_default(node.key) && defaultCheckedKeys.includes(node.key)) {
node.setChecked(true, !this.checkStrictly);
}
}
setDefaultCheckedKey(newVal) {
if (newVal !== this.defaultCheckedKeys) {
this.defaultCheckedKeys = newVal;
this._initDefaultCheckedNodes();
}
}
registerNode(node) {
const key = this.key;
if (!node || !node.data) return;
if (!key) {
this.nodesMap[node.id] = node;
} else {
const nodeKey = node.key;
if (!isNil_default(nodeKey)) this.nodesMap[nodeKey] = node;
}
}
deregisterNode(node) {
const key = this.key;
if (!key || !node || !node.data) return;
node.childNodes.forEach((child) => {
this.deregisterNode(child);
});
delete this.nodesMap[node.key];
}
getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
const checkedNodes = [];
const traverse = function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
checkedNodes.push(child.data);
}
traverse(child);
});
};
traverse(this);
return checkedNodes;
}
getCheckedKeys(leafOnly = false) {
return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
}
getHalfCheckedNodes() {
const nodes = [];
const traverse = function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
if (child.indeterminate) {
nodes.push(child.data);
}
traverse(child);
});
};
traverse(this);
return nodes;
}
getHalfCheckedKeys() {
return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
}
_getAllNodes() {
const allNodes = [];
const nodesMap = this.nodesMap;
for (const nodeKey in nodesMap) {
if (hasOwn(nodesMap, nodeKey)) {
allNodes.push(nodesMap[nodeKey]);
}
}
return allNodes;
}
updateChildren(key, data) {
const node = this.nodesMap[key];
if (!node) return;
const childNodes = node.childNodes;
for (let i = childNodes.length - 1; i >= 0; i--) {
const child = childNodes[i];
this.remove(child.data);
}
for (let i = 0, j = data.length; i < j; i++) {
const child = data[i];
this.append(child, node.data);
}
}
_setCheckedKeys(key, leafOnly = false, checkedKeys) {
const allNodes = this._getAllNodes().sort((a2, b2) => a2.level - b2.level);
const cache2 = /* @__PURE__ */ Object.create(null);
const keys2 = Object.keys(checkedKeys);
allNodes.forEach((node) => node.setChecked(false, false));
const cacheCheckedChild = (node) => {
node.childNodes.forEach((child) => {
var _a;
cache2[child.data[key]] = true;
if ((_a = child.childNodes) == null ? void 0 : _a.length) {
cacheCheckedChild(child);
}
});
};
for (let i = 0, j = allNodes.length; i < j; i++) {
const node = allNodes[i];
const nodeKey = node.data[key].toString();
const checked = keys2.includes(nodeKey);
if (!checked) {
if (node.checked && !cache2[nodeKey]) {
node.setChecked(false, false);
}
continue;
}
if (node.childNodes.length) {
cacheCheckedChild(node);
}
if (node.isLeaf || this.checkStrictly) {
node.setChecked(true, false);
continue;
}
node.setChecked(true, true);
if (leafOnly) {
node.setChecked(false, false);
const traverse = function(node2) {
const childNodes = node2.childNodes;
childNodes.forEach((child) => {
if (!child.isLeaf) {
child.setChecked(false, false);
}
traverse(child);
});
};
traverse(node);
}
}
}
setCheckedNodes(array, leafOnly = false) {
const key = this.key;
const checkedKeys = {};
array.forEach((item) => {
checkedKeys[(item || {})[key]] = true;
});
this._setCheckedKeys(key, leafOnly, checkedKeys);
}
setCheckedKeys(keys2, leafOnly = false) {
this.defaultCheckedKeys = keys2;
const key = this.key;
const checkedKeys = {};
keys2.forEach((key2) => {
checkedKeys[key2] = true;
});
this._setCheckedKeys(key, leafOnly, checkedKeys);
}
setDefaultExpandedKeys(keys2) {
keys2 = keys2 || [];
this.defaultExpandedKeys = keys2;
keys2.forEach((key) => {
const node = this.getNode(key);
if (node) node.expand(null, this.autoExpandParent);
});
}
setChecked(data, checked, deep) {
const node = this.getNode(data);
if (node) {
node.setChecked(!!checked, deep);
}
}
getCurrentNode() {
return this.currentNode;
}
setCurrentNode(currentNode) {
const prevCurrentNode = this.currentNode;
if (prevCurrentNode) {
prevCurrentNode.isCurrent = false;
}
this.currentNode = currentNode;
this.currentNode.isCurrent = true;
}
setUserCurrentNode(node, shouldAutoExpandParent = true) {
var _a;
const key = node[this.key];
const currNode = this.nodesMap[key];
this.setCurrentNode(currNode);
if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) {
(_a = this.currentNode.parent) == null ? void 0 : _a.expand(null, true);
}
}
setCurrentNodeKey(key, shouldAutoExpandParent = true) {
var _a;
this.currentNodeKey = key;
if (isPropAbsent(key)) {
this.currentNode && (this.currentNode.isCurrent = false);
this.currentNode = null;
return;
}
const node = this.getNode(key);
if (node) {
this.setCurrentNode(node);
if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) {
(_a = this.currentNode.parent) == null ? void 0 : _a.expand(null, true);
}
}
}
};
// node_modules/element-plus/es/components/tree/src/tokens.mjs
var ROOT_TREE_INJECTION_KEY = "RootTree";
var NODE_INSTANCE_INJECTION_KEY = "NodeInstance";
var TREE_NODE_MAP_INJECTION_KEY = "TreeNodeMap";
// node_modules/element-plus/es/components/tree/src/tree-node-content.vue2.mjs
var _sfc_main136 = defineComponent({
name: "ElTreeNodeContent",
props: {
node: {
type: Object,
required: true
},
renderContent: Function
},
setup(props2) {
const ns = useNamespace("tree");
const nodeInstance = inject(
NODE_INSTANCE_INJECTION_KEY
);
const tree = inject(ROOT_TREE_INJECTION_KEY);
return () => {
const node = props2.node;
const { data, store } = node;
return props2.renderContent ? props2.renderContent(h, { _self: nodeInstance, node, data, store }) : renderSlot(tree.ctx.slots, "default", { node, data }, () => [
h(
ElText,
{ tag: "span", truncated: true, class: ns.be("node", "label") },
() => [node.label]
)
]);
};
}
});
// node_modules/element-plus/es/components/tree/src/model/useNodeExpandEventBroadcast.mjs
function useNodeExpandEventBroadcast(props2) {
const parentNodeMap = inject(
TREE_NODE_MAP_INJECTION_KEY,
null
);
let currentNodeMap = {
treeNodeExpand: (node) => {
var _a;
if (props2.node !== node) {
(_a = props2.node) == null ? void 0 : _a.collapse();
}
},
children: /* @__PURE__ */ new Set()
};
if (parentNodeMap) {
parentNodeMap.children.add(currentNodeMap);
}
onBeforeUnmount(() => {
if (parentNodeMap) {
parentNodeMap.children.delete(currentNodeMap);
}
currentNodeMap = null;
});
provide(TREE_NODE_MAP_INJECTION_KEY, currentNodeMap);
return {
broadcastExpanded: (node) => {
if (!props2.accordion) return;
for (const childNode of currentNodeMap.children) {
childNode.treeNodeExpand(node);
}
}
};
}
// node_modules/element-plus/es/components/tree/src/model/useDragNode.mjs
var dragEventsKey = /* @__PURE__ */ Symbol("dragEvents");
function useDragNodeHandler({
props: props2,
ctx,
el$,
dropIndicator$,
store
}) {
const ns = useNamespace("tree");
const dragState = ref({
showDropIndicator: false,
draggingNode: null,
dropNode: null,
allowDrop: true,
dropType: null
});
const treeNodeDragStart = ({ event, treeNode }) => {
if (!event.dataTransfer) return;
if (isFunction(props2.allowDrag) && !props2.allowDrag(treeNode.node)) {
event.preventDefault();
return false;
}
event.dataTransfer.effectAllowed = "move";
try {
event.dataTransfer.setData("text/plain", "");
} catch (e) {
}
dragState.value.draggingNode = treeNode;
ctx.emit("node-drag-start", treeNode.node, event);
};
const treeNodeDragOver = ({ event, treeNode }) => {
if (!event.dataTransfer) return;
const dropNode = treeNode;
const oldDropNode = dragState.value.dropNode;
if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {
removeClass(oldDropNode.$el, ns.is("drop-inner"));
}
const draggingNode = dragState.value.draggingNode;
if (!draggingNode || !dropNode) return;
let dropPrev = true;
let dropInner = true;
let dropNext = true;
let userAllowDropInner = true;
if (isFunction(props2.allowDrop)) {
dropPrev = props2.allowDrop(draggingNode.node, dropNode.node, "prev");
userAllowDropInner = dropInner = props2.allowDrop(
draggingNode.node,
dropNode.node,
"inner"
);
dropNext = props2.allowDrop(draggingNode.node, dropNode.node, "next");
}
event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
if ((dropPrev || dropInner || dropNext) && (oldDropNode == null ? void 0 : oldDropNode.node.id) !== dropNode.node.id) {
if (oldDropNode) {
ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
}
ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event);
}
if (dropPrev || dropInner || dropNext) {
dragState.value.dropNode = dropNode;
} else {
dragState.value.dropNode = null;
}
if (dropNode.node.nextSibling === draggingNode.node) {
dropNext = false;
}
if (dropNode.node.previousSibling === draggingNode.node) {
dropPrev = false;
}
if (dropNode.node.contains(draggingNode.node, false)) {
dropInner = false;
}
if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
dropPrev = false;
dropInner = false;
dropNext = false;
}
const dropEl = dropNode.$el;
const targetPosition = dropEl.querySelector(`.${ns.be("node", "content")}`).getBoundingClientRect();
const treePosition = el$.value.getBoundingClientRect();
const treeScrollTop = el$.value.scrollTop;
let dropType;
const prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : Number.NEGATIVE_INFINITY;
const nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : Number.POSITIVE_INFINITY;
let indicatorTop = -9999;
const distance = event.clientY - targetPosition.top;
if (distance < targetPosition.height * prevPercent) {
dropType = "before";
} else if (distance > targetPosition.height * nextPercent) {
dropType = "after";
} else if (dropInner) {
dropType = "inner";
} else {
dropType = "none";
}
const iconPosition = dropEl.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect();
const dropIndicator = dropIndicator$.value;
if (dropType === "before") {
indicatorTop = iconPosition.top - treePosition.top + treeScrollTop;
} else if (dropType === "after") {
indicatorTop = iconPosition.bottom - treePosition.top + treeScrollTop;
}
dropIndicator.style.top = `${indicatorTop}px`;
dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`;
if (dropType === "inner") {
addClass(dropEl, ns.is("drop-inner"));
} else {
removeClass(dropEl, ns.is("drop-inner"));
}
dragState.value.showDropIndicator = dropType === "before" || dropType === "after";
dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner;
dragState.value.dropType = dropType;
ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event);
};
const treeNodeDragEnd = (event) => {
var _a, _b;
const { draggingNode, dropType, dropNode } = dragState.value;
event.preventDefault();
if (event.dataTransfer) {
event.dataTransfer.dropEffect = "move";
}
if ((draggingNode == null ? void 0 : draggingNode.node.data) && dropNode) {
const draggingNodeCopy = { data: draggingNode.node.data };
if (dropType !== "none") {
draggingNode.node.remove();
}
if (dropType === "before") {
(_a = dropNode.node.parent) == null ? void 0 : _a.insertBefore(draggingNodeCopy, dropNode.node);
} else if (dropType === "after") {
(_b = dropNode.node.parent) == null ? void 0 : _b.insertAfter(draggingNodeCopy, dropNode.node);
} else if (dropType === "inner") {
dropNode.node.insertChild(draggingNodeCopy);
}
if (dropType !== "none") {
store.value.registerNode(draggingNodeCopy);
if (store.value.key) {
draggingNode.node.eachNode((node) => {
var _a2;
(_a2 = store.value.nodesMap[node.data[store.value.key]]) == null ? void 0 : _a2.setChecked(
node.checked,
!store.value.checkStrictly
);
});
}
}
removeClass(dropNode.$el, ns.is("drop-inner"));
ctx.emit(
"node-drag-end",
draggingNode.node,
dropNode.node,
dropType,
event
);
if (dropType !== "none") {
ctx.emit(
"node-drop",
draggingNode.node,
dropNode.node,
dropType,
event
);
}
}
if (draggingNode && !dropNode) {
ctx.emit("node-drag-end", draggingNode.node, null, dropType, event);
}
dragState.value.showDropIndicator = false;
dragState.value.draggingNode = null;
dragState.value.dropNode = null;
dragState.value.allowDrop = true;
};
provide(dragEventsKey, {
treeNodeDragStart,
treeNodeDragOver,
treeNodeDragEnd
});
return {
dragState
};
}
// node_modules/element-plus/es/components/tree/src/tree-node.vue2.mjs
var _sfc_main137 = defineComponent({
name: "ElTreeNode",
components: {
ElCollapseTransition,
ElCheckbox,
NodeContent: _sfc_main136,
ElIcon,
Loading: loading_default
},
props: {
node: {
type: Node3,
default: () => ({})
},
props: {
type: Object,
default: () => ({})
},
accordion: Boolean,
renderContent: Function,
renderAfterExpand: Boolean,
showCheckbox: Boolean
},
emits: ["node-expand"],
setup(props2, ctx) {
const ns = useNamespace("tree");
const { broadcastExpanded } = useNodeExpandEventBroadcast(props2);
const tree = inject(ROOT_TREE_INJECTION_KEY);
const expanded = ref(false);
const childNodeRendered = ref(false);
const oldChecked = ref();
const oldIndeterminate = ref();
const node$ = ref();
const dragEvents = inject(dragEventsKey);
const instance = getCurrentInstance();
provide(NODE_INSTANCE_INJECTION_KEY, instance);
if (!tree) {
debugWarn("Tree", "Can not find node's tree.");
}
if (props2.node.expanded) {
expanded.value = true;
childNodeRendered.value = true;
}
const childrenKey = tree.props.props["children"] || "children";
watch(
() => {
var _a;
const children = (_a = props2.node.data) == null ? void 0 : _a[childrenKey];
return children && [...children];
},
() => {
props2.node.updateChildren();
}
);
watch(
() => props2.node.indeterminate,
(val) => {
handleSelectChange(props2.node.checked, val);
}
);
watch(
() => props2.node.checked,
(val) => {
handleSelectChange(val, props2.node.indeterminate);
}
);
watch(
() => props2.node.childNodes.length,
() => props2.node.reInitChecked()
);
watch(
() => props2.node.expanded,
(val) => {
nextTick(() => expanded.value = val);
if (val) {
childNodeRendered.value = true;
}
}
);
const getNodeKey$1 = (node) => {
return getNodeKey(tree.props.nodeKey, node.data);
};
const getNodeClass = (node) => {
const nodeClassFunc = props2.props.class;
if (!nodeClassFunc) {
return {};
}
let className;
if (isFunction(nodeClassFunc)) {
const { data } = node;
className = nodeClassFunc(data, node);
} else {
className = nodeClassFunc;
}
if (isString(className)) {
return { [className]: true };
} else {
return className;
}
};
const handleSelectChange = (checked, indeterminate) => {
if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) {
tree.ctx.emit("check-change", props2.node.data, checked, indeterminate);
}
oldChecked.value = checked;
oldIndeterminate.value = indeterminate;
};
const handleClick = (e) => {
handleCurrentChange(tree.store, tree.ctx.emit, () => {
var _a;
const nodeKeyProp = (_a = tree == null ? void 0 : tree.props) == null ? void 0 : _a.nodeKey;
if (nodeKeyProp) {
const curNodeKey = getNodeKey$1(props2.node);
tree.store.value.setCurrentNodeKey(curNodeKey);
} else {
tree.store.value.setCurrentNode(props2.node);
}
});
tree.currentNode.value = props2.node;
if (tree.props.expandOnClickNode) {
handleExpandIconClick();
}
if ((tree.props.checkOnClickNode || props2.node.isLeaf && tree.props.checkOnClickLeaf && props2.showCheckbox) && !props2.node.disabled) {
handleCheckChange(!props2.node.checked);
}
tree.ctx.emit("node-click", props2.node.data, props2.node, instance, e);
};
const handleContextMenu = (event) => {
var _a;
if ((_a = tree.instance.vnode.props) == null ? void 0 : _a["onNodeContextmenu"]) {
event.stopPropagation();
event.preventDefault();
}
tree.ctx.emit(
"node-contextmenu",
event,
props2.node.data,
props2.node,
instance
);
};
const handleExpandIconClick = () => {
if (props2.node.isLeaf) return;
if (expanded.value) {
tree.ctx.emit("node-collapse", props2.node.data, props2.node, instance);
props2.node.collapse();
} else {
props2.node.expand(() => {
ctx.emit("node-expand", props2.node.data, props2.node, instance);
});
}
};
const handleCheckChange = (value) => {
const checkStrictly = tree == null ? void 0 : tree.props.checkStrictly;
const childNodes = props2.node.childNodes;
if (!checkStrictly && childNodes.length) {
value = childNodes.some((node) => !node.isEffectivelyChecked);
}
props2.node.setChecked(value, !checkStrictly);
nextTick(() => {
const store = tree.store.value;
tree.ctx.emit("check", props2.node.data, {
checkedNodes: store.getCheckedNodes(),
checkedKeys: store.getCheckedKeys(),
halfCheckedNodes: store.getHalfCheckedNodes(),
halfCheckedKeys: store.getHalfCheckedKeys()
});
});
};
const handleChildNodeExpand = (nodeData, node, instance2) => {
broadcastExpanded(node);
tree.ctx.emit("node-expand", nodeData, node, instance2);
};
const handleDragStart = (event) => {
if (!tree.props.draggable) return;
dragEvents.treeNodeDragStart({ event, treeNode: props2 });
};
const handleDragOver = (event) => {
event.preventDefault();
if (!tree.props.draggable) return;
dragEvents.treeNodeDragOver({
event,
treeNode: { $el: node$.value, node: props2.node }
});
};
const handleDrop = (event) => {
event.preventDefault();
};
const handleDragEnd = (event) => {
if (!tree.props.draggable) return;
dragEvents.treeNodeDragEnd(event);
};
return {
ns,
node$,
tree,
expanded,
childNodeRendered,
oldChecked,
oldIndeterminate,
getNodeKey: getNodeKey$1,
getNodeClass,
handleSelectChange,
handleClick,
handleContextMenu,
handleExpandIconClick,
handleCheckChange,
handleChildNodeExpand,
handleDragStart,
handleDragOver,
handleDrop,
handleDragEnd,
CaretRight: caret_right_default
};
}
});
// node_modules/element-plus/es/components/tree/src/tree-node.vue.mjs
var _hoisted_171 = ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key"];
var _hoisted_239 = ["aria-expanded"];
function _sfc_render20(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_icon = resolveComponent("el-icon");
const _component_el_checkbox = resolveComponent("el-checkbox");
const _component_loading = resolveComponent("loading");
const _component_node_content = resolveComponent("node-content");
const _component_el_tree_node = resolveComponent("el-tree-node");
const _component_el_collapse_transition = resolveComponent("el-collapse-transition");
return withDirectives((openBlock(), createElementBlock("div", {
ref: "node$",
class: normalizeClass([
_ctx.ns.b("node"),
_ctx.ns.is("expanded", _ctx.expanded),
_ctx.ns.is("current", _ctx.node.isCurrent),
_ctx.ns.is("hidden", !_ctx.node.visible),
_ctx.ns.is("focusable", !_ctx.node.disabled),
_ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked),
_ctx.getNodeClass(_ctx.node)
]),
role: "treeitem",
tabindex: "-1",
"aria-expanded": _ctx.expanded,
"aria-disabled": _ctx.node.disabled,
"aria-checked": _ctx.node.checked,
draggable: _ctx.tree.props.draggable,
"data-key": _ctx.getNodeKey(_ctx.node),
onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
onContextmenu: _cache[3] || (_cache[3] = (...args) => _ctx.handleContextMenu && _ctx.handleContextMenu(...args)),
onDragstart: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args), ["stop"])),
onDragover: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["stop"])),
onDragend: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.handleDragEnd && _ctx.handleDragEnd(...args), ["stop"])),
onDrop: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.handleDrop && _ctx.handleDrop(...args), ["stop"]))
}, [
createBaseVNode(
"div",
{
class: normalizeClass(_ctx.ns.be("node", "content")),
style: normalizeStyle({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" })
},
[
_ctx.tree.props.icon || _ctx.CaretRight ? (openBlock(), createBlock(_component_el_icon, {
key: 0,
class: normalizeClass([
_ctx.ns.be("node", "expand-icon"),
_ctx.ns.is("leaf", _ctx.node.isLeaf),
{
expanded: !_ctx.node.isLeaf && _ctx.expanded
}
]),
onClick: withModifiers(_ctx.handleExpandIconClick, ["stop"])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tree.props.icon || _ctx.CaretRight)))
]),
_: 1
/* STABLE */
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
_ctx.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
key: 1,
"model-value": _ctx.node.checked,
indeterminate: _ctx.node.indeterminate,
disabled: !!_ctx.node.disabled,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"])),
onChange: _ctx.handleCheckChange
}, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : createCommentVNode("v-if", true),
_ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, {
key: 2,
class: normalizeClass([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")])
}, {
default: withCtx(() => [
createVNode(_component_loading)
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
createVNode(_component_node_content, {
node: _ctx.node,
"render-content": _ctx.renderContent
}, null, 8, ["node", "render-content"])
],
6
/* CLASS, STYLE */
),
createVNode(_component_el_collapse_transition, null, {
default: withCtx(() => [
!_ctx.renderAfterExpand || _ctx.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(_ctx.ns.be("node", "children")),
role: "group",
"aria-expanded": _ctx.expanded,
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["stop"]))
}, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.node.childNodes, (child) => {
return openBlock(), createBlock(_component_el_tree_node, {
key: _ctx.getNodeKey(child),
"render-content": _ctx.renderContent,
"render-after-expand": _ctx.renderAfterExpand,
"show-checkbox": _ctx.showCheckbox,
node: child,
accordion: _ctx.accordion,
props: _ctx.props,
onNodeExpand: _ctx.handleChildNodeExpand
}, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]);
}),
128
/* KEYED_FRAGMENT */
))
], 10, _hoisted_239)), [
[vShow, _ctx.expanded]
]) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
})
], 42, _hoisted_171)), [
[vShow, _ctx.node.visible]
]);
}
var ElTreeNode = _export_sfc(_sfc_main137, [["render", _sfc_render20]]);
// node_modules/element-plus/es/components/tree/src/model/useKeydown.mjs
function useKeydown({ el$ }, store) {
const ns = useNamespace("tree");
onMounted(() => {
initTabIndex();
});
onUpdated(() => {
var _a;
(_a = el$.value) == null ? void 0 : _a.querySelectorAll("input[type=checkbox]").forEach((checkbox) => {
checkbox.setAttribute("tabindex", "-1");
});
});
function canNodeFocus(treeItems, nextIndex) {
var _a, _b;
const currentNode = store.value.getNode(treeItems[nextIndex].dataset.key);
return currentNode.canFocus && currentNode.visible && (((_a = currentNode.parent) == null ? void 0 : _a.expanded) || ((_b = currentNode.parent) == null ? void 0 : _b.level) === 0);
}
const handleKeydown = (ev) => {
const currentItem = ev.target;
if (!currentItem.className.includes(ns.b("node"))) return;
const code = getEventCode(ev);
const treeItems = Array.from(
el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`)
);
const currentIndex = treeItems.indexOf(currentItem);
let nextIndex;
if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {
ev.preventDefault();
if (code === EVENT_CODE.up) {
nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.length - 1;
const startIndex = nextIndex;
while (true) {
if (canNodeFocus(treeItems, nextIndex)) {
break;
}
nextIndex--;
if (nextIndex === startIndex) {
nextIndex = -1;
break;
}
if (nextIndex < 0) {
nextIndex = treeItems.length - 1;
}
}
} else {
nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.length - 1 ? currentIndex + 1 : 0;
const startIndex = nextIndex;
while (true) {
if (canNodeFocus(treeItems, nextIndex)) {
break;
}
nextIndex++;
if (nextIndex === startIndex) {
nextIndex = -1;
break;
}
if (nextIndex >= treeItems.length) {
nextIndex = 0;
}
}
}
nextIndex !== -1 && treeItems[nextIndex].focus();
}
if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {
ev.preventDefault();
currentItem.click();
}
const hasInput = currentItem.querySelector(
'[type="checkbox"]'
);
if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(
code
) && hasInput) {
ev.preventDefault();
hasInput.click();
}
};
useEventListener(el$, "keydown", handleKeydown);
const initTabIndex = () => {
var _a;
if (!el$.value) return;
const treeItems = Array.from(
el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`)
);
const checkboxItems = Array.from(
el$.value.querySelectorAll("input[type=checkbox]")
);
checkboxItems.forEach((checkbox) => {
checkbox.setAttribute("tabindex", "-1");
});
const checkedItem = el$.value.querySelectorAll(
`.${ns.is("checked")}[role=treeitem]`
);
if (checkedItem.length) {
checkedItem[0].setAttribute("tabindex", "0");
return;
}
(_a = treeItems[0]) == null ? void 0 : _a.setAttribute("tabindex", "0");
};
}
// node_modules/element-plus/es/components/tree/src/tree.mjs
var treeProps = buildProps({
data: {
type: definePropType(Array),
default: () => []
},
emptyText: {
type: String
},
renderAfterExpand: {
type: Boolean,
default: true
},
nodeKey: String,
checkStrictly: Boolean,
defaultExpandAll: Boolean,
expandOnClickNode: {
type: Boolean,
default: true
},
checkOnClickNode: Boolean,
checkOnClickLeaf: {
type: Boolean,
default: true
},
checkDescendants: Boolean,
autoExpandParent: {
type: Boolean,
default: true
},
defaultCheckedKeys: {
type: Array
},
defaultExpandedKeys: {
type: Array
},
currentNodeKey: {
type: [String, Number]
},
renderContent: {
type: definePropType(Function)
},
showCheckbox: Boolean,
draggable: Boolean,
allowDrag: {
type: definePropType(Function)
},
allowDrop: {
type: definePropType(Function)
},
props: {
type: Object,
default: () => ({
children: "children",
label: "label",
disabled: "disabled"
})
},
lazy: Boolean,
highlightCurrent: Boolean,
load: {
type: Function
},
filterNodeMethod: {
type: Function
},
accordion: Boolean,
indent: {
type: Number,
default: 18
},
icon: {
type: iconPropType
}
});
var treeEmits = {
"check-change": (data, checked, indeterminate) => data && isBoolean(checked) && isBoolean(indeterminate),
"current-change": (data, node) => true,
"node-click": (data, node, nodeInstance, evt) => data && node && evt instanceof Event,
"node-contextmenu": (evt, data, node, nodeInstance) => evt instanceof Event && data && node,
"node-collapse": (data, node, nodeInstance) => data && node,
"node-expand": (data, node, nodeInstance) => data && node,
check: (data, checkedInfo) => data && checkedInfo,
"node-drag-start": (node, evt) => node && evt,
"node-drag-end": (draggingNode, dropNode, dropType, evt) => draggingNode && evt,
"node-drop": (draggingNode, dropNode, dropType, evt) => draggingNode && dropNode && evt,
"node-drag-leave": (draggingNode, oldDropNode, evt) => draggingNode && oldDropNode && evt,
"node-drag-enter": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt,
"node-drag-over": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt
};
// node_modules/element-plus/es/components/tree/src/tree.vue2.mjs
var _sfc_main138 = defineComponent({
name: "ElTree",
components: { ElTreeNode },
props: treeProps,
emits: treeEmits,
setup(props2, ctx) {
const { t } = useLocale();
const ns = useNamespace("tree");
const store = ref(
new TreeStore({
key: props2.nodeKey,
data: props2.data,
lazy: props2.lazy,
props: props2.props,
load: props2.load,
currentNodeKey: props2.currentNodeKey,
checkStrictly: props2.checkStrictly,
checkDescendants: props2.checkDescendants,
defaultCheckedKeys: props2.defaultCheckedKeys,
defaultExpandedKeys: props2.defaultExpandedKeys,
autoExpandParent: props2.autoExpandParent,
defaultExpandAll: props2.defaultExpandAll,
filterNodeMethod: props2.filterNodeMethod
})
);
store.value.initialize();
const root = ref(store.value.root);
const currentNode = ref(null);
const el$ = ref(null);
const dropIndicator$ = ref(null);
const { broadcastExpanded } = useNodeExpandEventBroadcast(props2);
const { dragState } = useDragNodeHandler({
props: props2,
ctx,
el$,
dropIndicator$,
store
});
useKeydown({ el$ }, store);
const instance = getCurrentInstance();
const isSelectTree = computed(() => {
let parent = instance == null ? void 0 : instance.parent;
while (parent) {
if (parent.type.name === "ElTreeSelect") {
return true;
}
parent = parent.parent;
}
return false;
});
const isEmpty2 = computed(() => {
const { childNodes } = root.value;
return (!childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible)) && !isSelectTree.value;
});
watch(
() => props2.currentNodeKey,
(newVal) => {
store.value.setCurrentNodeKey(newVal != null ? newVal : null);
}
);
watch(
() => props2.defaultCheckedKeys,
(newVal, oldVal) => {
if (isEqual_default(newVal, oldVal)) return;
store.value.setDefaultCheckedKey(newVal != null ? newVal : []);
}
);
watch(
() => props2.defaultExpandedKeys,
(newVal) => {
store.value.setDefaultExpandedKeys(newVal != null ? newVal : []);
}
);
watch(
() => props2.data,
(newVal) => {
store.value.setData(newVal);
},
{ deep: true }
);
watch(
() => props2.checkStrictly,
(newVal) => {
store.value.checkStrictly = newVal;
}
);
const filter = (value) => {
if (!props2.filterNodeMethod)
throw new Error("[Tree] filterNodeMethod is required when filter");
store.value.filter(value);
};
const getNodeKey$1 = (node) => {
return getNodeKey(props2.nodeKey, node.data);
};
const requireNodeKey = (methodName) => {
if (!props2.nodeKey) {
throw new Error(`[Tree] nodeKey is required in ${methodName}`);
}
};
const getNodePath = (data) => {
requireNodeKey("getNodePath");
const node = store.value.getNode(data);
if (!node) return [];
const path = [node.data];
let parent = node.parent;
while (parent && parent !== root.value) {
path.push(parent.data);
parent = parent.parent;
}
return path.reverse();
};
const getCheckedNodes = (leafOnly, includeHalfChecked) => {
return store.value.getCheckedNodes(leafOnly, includeHalfChecked);
};
const getCheckedKeys = (leafOnly) => {
return store.value.getCheckedKeys(leafOnly);
};
const getCurrentNode = () => {
const currentNode2 = store.value.getCurrentNode();
return currentNode2 ? currentNode2.data : null;
};
const getCurrentKey = () => {
requireNodeKey("getCurrentKey");
const currentNode2 = getCurrentNode();
return currentNode2 ? currentNode2[props2.nodeKey] : null;
};
const setCheckedNodes = (nodes, leafOnly) => {
requireNodeKey("setCheckedNodes");
store.value.setCheckedNodes(nodes, leafOnly);
};
const setCheckedKeys = (keys2, leafOnly) => {
requireNodeKey("setCheckedKeys");
store.value.setCheckedKeys(keys2, leafOnly);
};
const setChecked = (data, checked, deep) => {
store.value.setChecked(data, checked, deep);
};
const getHalfCheckedNodes = () => {
return store.value.getHalfCheckedNodes();
};
const getHalfCheckedKeys = () => {
return store.value.getHalfCheckedKeys();
};
const setCurrentNode = (node, shouldAutoExpandParent = true) => {
requireNodeKey("setCurrentNode");
handleCurrentChange(store, ctx.emit, () => {
broadcastExpanded(node);
store.value.setUserCurrentNode(node, shouldAutoExpandParent);
});
};
const setCurrentKey = (key = null, shouldAutoExpandParent = true) => {
requireNodeKey("setCurrentKey");
handleCurrentChange(store, ctx.emit, () => {
broadcastExpanded();
store.value.setCurrentNodeKey(key, shouldAutoExpandParent);
});
};
const getNode = (data) => {
return store.value.getNode(data);
};
const remove = (data) => {
store.value.remove(data);
};
const append = (data, parentNode) => {
store.value.append(data, parentNode);
};
const insertBefore = (data, refNode) => {
store.value.insertBefore(data, refNode);
};
const insertAfter = (data, refNode) => {
store.value.insertAfter(data, refNode);
};
const handleNodeExpand = (nodeData, node, instance2) => {
broadcastExpanded(node);
ctx.emit("node-expand", nodeData, node, instance2);
};
const updateKeyChildren = (key, data) => {
requireNodeKey("updateKeyChild");
store.value.updateChildren(key, data);
};
provide(ROOT_TREE_INJECTION_KEY, {
ctx,
props: props2,
store,
root,
currentNode,
instance
});
provide(formItemContextKey, void 0);
return {
ns,
// ref
store,
root,
currentNode,
dragState,
el$,
dropIndicator$,
// computed
isEmpty: isEmpty2,
// methods
filter,
getNodeKey: getNodeKey$1,
getNodePath,
getCheckedNodes,
getCheckedKeys,
getCurrentNode,
getCurrentKey,
setCheckedNodes,
setCheckedKeys,
setChecked,
getHalfCheckedNodes,
getHalfCheckedKeys,
setCurrentNode,
setCurrentKey,
t,
getNode,
remove,
append,
insertBefore,
insertAfter,
handleNodeExpand,
updateKeyChildren
};
}
});
// node_modules/element-plus/es/components/tree/src/tree.vue.mjs
function _sfc_render21(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_tree_node = resolveComponent("el-tree-node");
return openBlock(), createElementBlock(
"div",
{
ref: "el$",
class: normalizeClass([
_ctx.ns.b(),
_ctx.ns.is("dragging", !!_ctx.dragState.draggingNode),
_ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop),
_ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"),
{ [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent }
]),
role: "tree"
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(_ctx.root.childNodes, (child) => {
return openBlock(), createBlock(_component_el_tree_node, {
key: _ctx.getNodeKey(child),
node: child,
props: _ctx.props,
accordion: _ctx.accordion,
"render-after-expand": _ctx.renderAfterExpand,
"show-checkbox": _ctx.showCheckbox,
"render-content": _ctx.renderContent,
onNodeExpand: _ctx.handleNodeExpand
}, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]);
}),
128
/* KEYED_FRAGMENT */
)),
_ctx.isEmpty ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(_ctx.ns.e("empty-block"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => {
var _a;
return [
createBaseVNode(
"span",
{
class: normalizeClass(_ctx.ns.e("empty-text"))
},
toDisplayString((_a = _ctx.emptyText) != null ? _a : _ctx.t("el.tree.emptyText")),
3
/* TEXT, CLASS */
)
];
})
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
withDirectives(createBaseVNode(
"div",
{
ref: "dropIndicator$",
class: normalizeClass(_ctx.ns.e("drop-indicator"))
},
null,
2
/* CLASS */
), [
[vShow, _ctx.dragState.showDropIndicator]
])
],
2
/* CLASS */
);
}
var Tree = _export_sfc(_sfc_main138, [["render", _sfc_render21]]);
// node_modules/element-plus/es/components/tree/index.mjs
var ElTree = withInstall(Tree);
// node_modules/element-plus/es/components/tree-select/src/select.mjs
var useSelect3 = (props2, { attrs, emit }, {
select,
tree,
key
}) => {
const ns = useNamespace("tree-select");
watch(
() => props2.data,
() => {
if (props2.filterable) {
nextTick(() => {
var _a, _b;
(_b = tree.value) == null ? void 0 : _b.filter((_a = select.value) == null ? void 0 : _a.states.inputValue);
});
}
},
{ flush: "post" }
);
const focusLastNode = (listNode) => {
var _a;
const lastNode = listNode.at(-1);
if (lastNode.expanded && lastNode.childNodes.at(-1)) {
focusLastNode([lastNode.childNodes.at(-1)]);
} else {
const el = (_a = tree.value.el$) == null ? void 0 : _a.querySelector(
`[data-key="${listNode.at(-1).key}"]`
);
el == null ? void 0 : el.focus({ preventScroll: true });
return;
}
};
onMounted(() => {
useEventListener(
() => {
var _a;
return (_a = select.value) == null ? void 0 : _a.$el;
},
"keydown",
async (evt) => {
const code = getEventCode(evt);
const { dropdownMenuVisible } = select.value;
if ([EVENT_CODE.down, EVENT_CODE.up].includes(code) && dropdownMenuVisible) {
await nextTick();
setTimeout(() => {
var _a, _b, _c;
if (EVENT_CODE.up === code) {
const listNode = tree.value.store.root.childNodes;
focusLastNode(listNode);
return;
}
(_c = (_b = (_a = select.value.optionsArray[select.value.states.hoveringIndex].$el) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.parentNode) == null ? void 0 : _c.focus({ preventScroll: true });
});
}
},
{
capture: true
}
);
});
const result = {
...pick_default(toRefs(props2), Object.keys(ElSelect.props)),
...attrs,
class: computed(() => attrs.class),
style: computed(() => attrs.style),
// attrs is not reactive, when v-model binding source changes,
// this listener is still old, see the bug(or test 'v-model source change'):
// https://github.com/element-plus/element-plus/issues/14204
"onUpdate:modelValue": (value) => emit(UPDATE_MODEL_EVENT, value),
valueKey: key,
popperClass: computed(() => {
const classes = [ns.e("popper")];
if (props2.popperClass) classes.push(props2.popperClass);
return classes.join(" ");
}),
filterMethod: (keyword = "") => {
var _a;
if (props2.filterMethod) {
props2.filterMethod(keyword);
} else if (props2.remoteMethod) {
props2.remoteMethod(keyword);
} else {
(_a = tree.value) == null ? void 0 : _a.filter(keyword);
}
}
};
return result;
};
// node_modules/element-plus/es/components/tree-select/src/tree-select-option.mjs
var component = defineComponent({
extends: ElOption,
setup(props2, ctx) {
const result = ElOption.setup(props2, ctx);
delete result.selectOptionClick;
const vm = getCurrentInstance().proxy;
nextTick(() => {
if (!result.select.states.cachedOptions.get(vm.value)) {
result.select.onOptionCreate(vm);
}
});
watch(
() => ctx.attrs.visible,
(val) => {
nextTick(() => {
result.states.visible = val;
});
},
{
immediate: true
}
);
return result;
},
methods: {
selectOptionClick() {
this.$el.parentElement.click();
}
}
});
// node_modules/element-plus/es/components/tree-select/src/utils.mjs
function isValidValue2(val) {
return val || val === 0;
}
function isValidArray(val) {
return isArray(val) && val.length;
}
function toValidArray(val) {
return isArray(val) ? val : isValidValue2(val) ? [val] : [];
}
function treeFind(treeData, findCallback, getChildren, resultCallback, parent) {
for (let i = 0; i < treeData.length; i++) {
const data = treeData[i];
if (findCallback(data, i, treeData, parent)) {
return resultCallback ? resultCallback(data, i, treeData, parent) : data;
} else {
const children = getChildren(data);
if (isValidArray(children)) {
const find = treeFind(
children,
findCallback,
getChildren,
resultCallback,
data
);
if (find) return find;
}
}
}
}
function treeEach(treeData, callback, getChildren, parent) {
for (let i = 0; i < treeData.length; i++) {
const data = treeData[i];
callback(data, i, treeData, parent);
const children = getChildren(data);
if (isValidArray(children)) {
treeEach(children, callback, getChildren, data);
}
}
}
// node_modules/element-plus/es/components/tree-select/src/tree.mjs
var useTree2 = (props2, { attrs, slots, emit }, {
select,
tree,
key
}) => {
watch(
[() => props2.modelValue, tree],
() => {
if (props2.showCheckbox) {
nextTick(() => {
const treeInstance = tree.value;
if (treeInstance && !isEqual_default(
treeInstance.getCheckedKeys(),
toValidArray(props2.modelValue)
)) {
treeInstance.setCheckedKeys(toValidArray(props2.modelValue));
}
});
}
},
{
immediate: true,
deep: true
}
);
const propsMap = computed(() => ({
value: key.value,
label: "label",
children: "children",
disabled: "disabled",
isLeaf: "isLeaf",
...props2.props
}));
const getNodeValByProp = (prop, data) => {
var _a;
const propVal = propsMap.value[prop];
if (isFunction(propVal)) {
return propVal(
data,
(_a = tree.value) == null ? void 0 : _a.getNode(getNodeValByProp("value", data))
);
} else {
return data[propVal];
}
};
const defaultExpandedParentKeys = toValidArray(props2.modelValue).map((value) => {
return treeFind(
props2.data || [],
(data) => getNodeValByProp("value", data) === value,
(data) => getNodeValByProp("children", data),
(data, index, array, parent) => parent && getNodeValByProp("value", parent)
);
}).filter((item) => isValidValue2(item));
const cacheOptions = computed(() => {
if (!props2.renderAfterExpand && !props2.lazy) return [];
const options = [];
treeEach(
props2.data.concat(props2.cacheData),
(node) => {
const value = getNodeValByProp("value", node);
options.push({
value,
currentLabel: getNodeValByProp("label", node),
isDisabled: getNodeValByProp("disabled", node)
});
},
(data) => getNodeValByProp("children", data)
);
return options;
});
const getChildCheckedKeys = () => {
var _a;
return (_a = tree.value) == null ? void 0 : _a.getCheckedKeys().filter((checkedKey) => {
var _a2;
const node = (_a2 = tree.value) == null ? void 0 : _a2.getNode(checkedKey);
return !isNil_default(node) && isEmpty(node.childNodes);
});
};
return {
...pick_default(toRefs(props2), Object.keys(ElTree.props)),
...attrs,
nodeKey: key,
// only expand on click node when the `check-strictly` is false
expandOnClickNode: computed(() => {
return !props2.checkStrictly && props2.expandOnClickNode;
}),
// show current selected node only first time,
// fix the problem of expanding multiple nodes when checking multiple nodes
defaultExpandedKeys: computed(() => {
return props2.defaultExpandedKeys ? props2.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys;
}),
renderContent: (h3, { node, data, store }) => {
return h3(
component,
{
value: getNodeValByProp("value", data),
label: getNodeValByProp("label", data),
disabled: getNodeValByProp("disabled", data),
visible: node.visible
},
props2.renderContent ? () => props2.renderContent(h3, { node, data, store }) : slots.default ? () => slots.default({ node, data, store }) : void 0
);
},
filterNodeMethod: (value, data, node) => {
if (props2.filterNodeMethod)
return props2.filterNodeMethod(value, data, node);
if (!value) return true;
const regexp = new RegExp(escapeStringRegexp(value), "i");
return regexp.test(getNodeValByProp("label", data) || "");
},
onNodeClick: (data, node, e) => {
var _a, _b, _c;
(_a = attrs.onNodeClick) == null ? void 0 : _a.call(attrs, data, node, e);
if (props2.showCheckbox && props2.checkOnClickNode) return;
if (!props2.showCheckbox && (props2.checkStrictly || node.isLeaf)) {
if (!getNodeValByProp("disabled", data)) {
const option = (_b = select.value) == null ? void 0 : _b.states.options.get(
getNodeValByProp("value", data)
);
(_c = select.value) == null ? void 0 : _c.handleOptionSelect(option);
}
} else if (props2.expandOnClickNode) {
e.proxy.handleExpandIconClick();
}
},
onCheck: (data, params) => {
var _a;
if (!props2.showCheckbox) return;
const dataValue = getNodeValByProp("value", data);
const dataMap = {};
treeEach(
[tree.value.store.root],
(node) => dataMap[node.key] = node,
(node) => node.childNodes
);
const uncachedCheckedKeys = params.checkedKeys;
const cachedKeys = props2.multiple ? toValidArray(props2.modelValue).filter(
(item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)
) : [];
const checkedKeys = cachedKeys.concat(uncachedCheckedKeys);
if (props2.checkStrictly) {
emit(
UPDATE_MODEL_EVENT,
// Checking for changes may come from `check-on-node-click`
props2.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0
);
} else {
if (props2.multiple) {
const childKeys = getChildCheckedKeys();
emit(UPDATE_MODEL_EVENT, cachedKeys.concat(childKeys));
} else {
const firstLeaf = treeFind(
[data],
(data2) => !isValidArray(getNodeValByProp("children", data2)) && !getNodeValByProp("disabled", data2),
(data2) => getNodeValByProp("children", data2)
);
const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0;
const hasCheckedChild = isValidValue2(props2.modelValue) && !!treeFind(
[data],
(data2) => getNodeValByProp("value", data2) === props2.modelValue,
(data2) => getNodeValByProp("children", data2)
);
emit(
UPDATE_MODEL_EVENT,
firstLeafKey === props2.modelValue || hasCheckedChild ? void 0 : firstLeafKey
);
}
}
nextTick(() => {
var _a2;
const checkedKeys2 = toValidArray(props2.modelValue);
tree.value.setCheckedKeys(checkedKeys2);
(_a2 = attrs.onCheck) == null ? void 0 : _a2.call(attrs, data, {
checkedKeys: tree.value.getCheckedKeys(),
checkedNodes: tree.value.getCheckedNodes(),
halfCheckedKeys: tree.value.getHalfCheckedKeys(),
halfCheckedNodes: tree.value.getHalfCheckedNodes()
});
});
(_a = select.value) == null ? void 0 : _a.focus();
},
onNodeExpand: (data, node, e) => {
var _a;
(_a = attrs.onNodeExpand) == null ? void 0 : _a.call(attrs, data, node, e);
nextTick(() => {
if (!props2.checkStrictly && props2.lazy && props2.multiple && node.checked) {
const dataMap = {};
const uncachedCheckedKeys = tree.value.getCheckedKeys();
treeEach(
[tree.value.store.root],
(node2) => dataMap[node2.key] = node2,
(node2) => node2.childNodes
);
const cachedKeys = toValidArray(props2.modelValue).filter(
(item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)
);
const childKeys = getChildCheckedKeys();
emit(UPDATE_MODEL_EVENT, cachedKeys.concat(childKeys));
}
});
},
// else
cacheOptions
};
};
// node_modules/element-plus/es/components/tree-select/src/cache-options.mjs
var CacheOptions = defineComponent({
props: {
data: {
type: Array,
default: () => []
}
},
setup(props2) {
const select = inject(selectKey);
watch(
() => props2.data,
() => {
var _a;
props2.data.forEach((item) => {
if (!select.states.cachedOptions.has(item.value)) {
select.states.cachedOptions.set(item.value, item);
}
});
const inputs = ((_a = select.selectRef) == null ? void 0 : _a.querySelectorAll("input")) || [];
if (isClient && !Array.from(inputs).includes(
document.activeElement
)) {
select.setSelected();
}
},
{ flush: "post", immediate: true }
);
return () => void 0;
}
});
// node_modules/element-plus/es/components/tree-select/src/tree-select.vue2.mjs
var _sfc_main139 = defineComponent({
name: "ElTreeSelect",
// disable `ElSelect` inherit current attrs
inheritAttrs: false,
props: {
...selectProps,
...treeProps,
/**
* @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
*/
cacheData: {
type: Array,
default: () => []
}
},
setup(props2, context) {
const { slots, expose } = context;
const select = ref();
const tree = ref();
const key = computed(() => props2.nodeKey || props2.valueKey || "value");
const selectProps2 = useSelect3(props2, context, { select, tree, key });
const { cacheOptions, ...treeProps22 } = useTree2(props2, context, {
select,
tree,
key
});
const methods = reactive({});
expose(methods);
onMounted(() => {
Object.assign(methods, {
//TODO: let only tree and select in 3.0
...pick_default(tree.value, [
"filter",
"updateKeyChildren",
"getCheckedNodes",
"setCheckedNodes",
"getCheckedKeys",
"setCheckedKeys",
"setChecked",
"getHalfCheckedNodes",
"getHalfCheckedKeys",
"getCurrentKey",
"getCurrentNode",
"setCurrentKey",
"setCurrentNode",
"getNode",
"remove",
"append",
"insertBefore",
"insertAfter"
]),
...pick_default(select.value, ["focus", "blur", "selectedLabel"]),
treeRef: tree.value,
selectRef: select.value
});
});
return () => h(
ElSelect,
/**
* 1. The `props` is processed into `Refs`, but `v-bind` and
* render function props cannot read `Refs`, so use `reactive`
* unwrap the `Refs` and keep reactive.
* 2. The keyword `ref` requires `Ref`, but `reactive` broke it,
* so use function.
*/
reactive({
...selectProps2,
ref: (ref2) => select.value = ref2
}),
{
...slots,
default: () => [
h(CacheOptions, { data: cacheOptions.value }),
h(
ElTree,
reactive({
...treeProps22,
ref: (ref2) => tree.value = ref2
})
)
]
}
);
}
});
// node_modules/element-plus/es/components/tree-select/index.mjs
var ElTreeSelect = withInstall(_sfc_main139);
// node_modules/element-plus/es/components/tree-v2/src/virtual-tree.mjs
var ROOT_TREE_INJECTION_KEY2 = /* @__PURE__ */ Symbol();
var EMPTY_NODE = {
key: -1,
level: -1,
data: {}
};
var TreeOptionsEnum = ((TreeOptionsEnum2) => {
TreeOptionsEnum2["KEY"] = "id";
TreeOptionsEnum2["LABEL"] = "label";
TreeOptionsEnum2["CHILDREN"] = "children";
TreeOptionsEnum2["DISABLED"] = "disabled";
TreeOptionsEnum2["CLASS"] = "";
return TreeOptionsEnum2;
})(TreeOptionsEnum || {});
var SetOperationEnum = ((SetOperationEnum2) => {
SetOperationEnum2["ADD"] = "add";
SetOperationEnum2["DELETE"] = "delete";
return SetOperationEnum2;
})(SetOperationEnum || {});
var itemSize2 = {
type: Number,
default: 26
};
var treeProps2 = buildProps({
data: {
type: definePropType(Array),
default: () => mutable([])
},
emptyText: {
type: String
},
height: {
type: Number,
default: 200
},
props: {
type: definePropType(Object),
default: () => mutable({
children: "children",
label: "label",
disabled: "disabled",
value: "id",
class: ""
/* CLASS */
})
},
highlightCurrent: Boolean,
showCheckbox: Boolean,
defaultCheckedKeys: {
type: definePropType(Array),
default: () => mutable([])
},
// Whether checked state of a node not affects its father and
// child nodes when show-checkbox is true
checkStrictly: Boolean,
defaultExpandedKeys: {
type: definePropType(Array),
default: () => mutable([])
},
indent: {
type: Number,
default: 16
},
itemSize: itemSize2,
icon: {
type: iconPropType
},
expandOnClickNode: {
type: Boolean,
default: true
},
checkOnClickNode: Boolean,
checkOnClickLeaf: {
type: Boolean,
default: true
},
currentNodeKey: {
type: definePropType([String, Number])
},
// TODO need to optimization
accordion: Boolean,
filterMethod: {
type: definePropType(Function)
},
// Performance mode will increase memory usage, but scrolling will be smoother
perfMode: {
type: Boolean,
default: true
},
/**
* @description always show scrollbar
*/
scrollbarAlwaysOn: Boolean
});
var treeNodeProps = buildProps({
node: {
type: definePropType(Object),
default: () => mutable(EMPTY_NODE)
},
expanded: Boolean,
checked: Boolean,
indeterminate: Boolean,
showCheckbox: Boolean,
disabled: Boolean,
current: Boolean,
hiddenExpandIcon: Boolean,
itemSize: itemSize2
});
var treeNodeContentProps = buildProps({
node: {
type: definePropType(Object),
required: true
}
});
var NODE_CLICK = "node-click";
var NODE_DROP = "node-drop";
var NODE_EXPAND = "node-expand";
var NODE_COLLAPSE = "node-collapse";
var CURRENT_CHANGE = "current-change";
var NODE_CHECK = "check";
var NODE_CHECK_CHANGE = "check-change";
var NODE_CONTEXTMENU = "node-contextmenu";
var treeEmits2 = {
[NODE_CLICK]: (data, node, e) => data && node && e,
[NODE_DROP]: (data, node, e) => data && node && e,
[NODE_EXPAND]: (data, node) => data && node,
[NODE_COLLAPSE]: (data, node) => data && node,
[CURRENT_CHANGE]: (data, node) => data && node,
[NODE_CHECK]: (data, checkedInfo) => data && checkedInfo,
[NODE_CHECK_CHANGE]: (data, checked) => data && isBoolean(checked),
[NODE_CONTEXTMENU]: (evt, data, node) => evt && data && node
};
var treeNodeEmits = {
click: (node, e) => !!(node && e),
drop: (node, e) => !!(node && e),
toggle: (node) => !!node,
check: (node, checked) => node && isBoolean(checked)
};
// node_modules/element-plus/es/components/tree-v2/src/composables/useCheck.mjs
function useCheck2(props2, tree) {
const checkedKeys = ref(/* @__PURE__ */ new Set());
const indeterminateKeys = ref(/* @__PURE__ */ new Set());
const { emit } = getCurrentInstance();
watch(
[() => tree.value, () => props2.defaultCheckedKeys],
() => {
return nextTick(() => {
_setCheckedKeys(props2.defaultCheckedKeys);
});
},
{
immediate: true
}
);
const updateCheckedKeys = () => {
if (!tree.value || !props2.showCheckbox || props2.checkStrictly) {
return;
}
const { levelTreeNodeMap, maxLevel } = tree.value;
const checkedKeySet = checkedKeys.value;
const indeterminateKeySet = /* @__PURE__ */ new Set();
for (let level = maxLevel; level >= 1; --level) {
const nodes = levelTreeNodeMap.get(level);
if (!nodes) continue;
nodes.forEach((node) => {
const children = node.children;
let isEffectivelyChecked = !node.isLeaf || node.disabled || checkedKeySet.has(node.key);
if (children) {
let allChecked = true;
let hasChecked = false;
for (const childNode of children) {
const key = childNode.key;
if (!childNode.isEffectivelyChecked) {
isEffectivelyChecked = false;
}
if (checkedKeySet.has(key)) {
hasChecked = true;
} else if (indeterminateKeySet.has(key)) {
allChecked = false;
hasChecked = true;
break;
} else {
allChecked = false;
}
}
if (allChecked) {
checkedKeySet.add(node.key);
} else if (hasChecked) {
indeterminateKeySet.add(node.key);
checkedKeySet.delete(node.key);
} else {
checkedKeySet.delete(node.key);
indeterminateKeySet.delete(node.key);
}
}
node.isEffectivelyChecked = isEffectivelyChecked;
});
}
indeterminateKeys.value = indeterminateKeySet;
};
const isChecked = (node) => checkedKeys.value.has(node.key);
const isIndeterminate = (node) => indeterminateKeys.value.has(node.key);
const toggleCheckbox = (node, isChecked2, nodeClick = true, immediateUpdate = true) => {
const checkedKeySet = checkedKeys.value;
const children = node.children;
if (!props2.checkStrictly && nodeClick && (children == null ? void 0 : children.length)) {
isChecked2 = children.some((node2) => !node2.isEffectivelyChecked);
}
const toggle = (node2, checked) => {
checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](
node2.key
);
const children2 = node2.children;
if (!props2.checkStrictly && children2) {
children2.forEach((childNode) => {
if (!childNode.disabled || childNode.children) {
toggle(childNode, checked);
}
});
}
};
toggle(node, isChecked2);
if (immediateUpdate) {
updateCheckedKeys();
}
if (nodeClick) {
afterNodeCheck(node, isChecked2);
}
};
const afterNodeCheck = (node, checked) => {
const { checkedNodes, checkedKeys: checkedKeys2 } = getChecked();
const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked();
emit(NODE_CHECK, node.data, {
checkedKeys: checkedKeys2,
checkedNodes,
halfCheckedKeys,
halfCheckedNodes
});
emit(NODE_CHECK_CHANGE, node.data, checked);
};
function getCheckedKeys(leafOnly = false) {
return getChecked(leafOnly).checkedKeys;
}
function getCheckedNodes(leafOnly = false) {
return getChecked(leafOnly).checkedNodes;
}
function getHalfCheckedKeys() {
return getHalfChecked().halfCheckedKeys;
}
function getHalfCheckedNodes() {
return getHalfChecked().halfCheckedNodes;
}
function getChecked(leafOnly = false) {
const checkedNodes = [];
const keys2 = [];
if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
const { treeNodeMap } = tree.value;
checkedKeys.value.forEach((key) => {
const node = treeNodeMap.get(key);
if (node && (!leafOnly || leafOnly && node.isLeaf)) {
keys2.push(key);
checkedNodes.push(node.data);
}
});
}
return {
checkedKeys: keys2,
checkedNodes
};
}
function getHalfChecked() {
const halfCheckedNodes = [];
const halfCheckedKeys = [];
if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
const { treeNodeMap } = tree.value;
indeterminateKeys.value.forEach((key) => {
const node = treeNodeMap.get(key);
if (node) {
halfCheckedKeys.push(key);
halfCheckedNodes.push(node.data);
}
});
}
return {
halfCheckedNodes,
halfCheckedKeys
};
}
function setCheckedKeys(keys2) {
checkedKeys.value.clear();
indeterminateKeys.value.clear();
nextTick(() => {
_setCheckedKeys(keys2);
});
}
function setChecked(key, isChecked2) {
if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
const node = tree.value.treeNodeMap.get(key);
if (node) {
toggleCheckbox(node, isChecked2, false);
}
}
}
function _setCheckedKeys(keys2) {
if (tree == null ? void 0 : tree.value) {
const { treeNodeMap } = tree.value;
if (props2.showCheckbox && treeNodeMap && (keys2 == null ? void 0 : keys2.length) > 0) {
for (const key of keys2) {
const node = treeNodeMap.get(key);
if (node && !isChecked(node)) {
toggleCheckbox(node, true, false, false);
}
}
updateCheckedKeys();
}
}
}
return {
updateCheckedKeys,
toggleCheckbox,
isChecked,
isIndeterminate,
// expose
getCheckedKeys,
getCheckedNodes,
getHalfCheckedKeys,
getHalfCheckedNodes,
setChecked,
setCheckedKeys
};
}
// node_modules/element-plus/es/components/tree-v2/src/composables/useFilter.mjs
function useFilter(props2, tree) {
const hiddenNodeKeySet = ref(/* @__PURE__ */ new Set([]));
const hiddenExpandIconKeySet = ref(/* @__PURE__ */ new Set([]));
const filterable = computed(() => {
return isFunction(props2.filterMethod);
});
function doFilter(query) {
var _a;
if (!filterable.value) {
return;
}
const expandKeySet = /* @__PURE__ */ new Set();
const hiddenExpandIconKeys = hiddenExpandIconKeySet.value;
const hiddenKeys = hiddenNodeKeySet.value;
const family = [];
const nodes = ((_a = tree.value) == null ? void 0 : _a.treeNodes) || [];
const filter = props2.filterMethod;
hiddenKeys.clear();
function traverse(nodes2) {
nodes2.forEach((node) => {
family.push(node);
if (filter == null ? void 0 : filter(query, node.data, node)) {
family.forEach((member) => {
expandKeySet.add(member.key);
member.expanded = true;
});
} else {
node.expanded = false;
if (node.isLeaf) {
hiddenKeys.add(node.key);
}
}
const children = node.children;
if (children) {
traverse(children);
}
if (!node.isLeaf) {
if (!expandKeySet.has(node.key)) {
hiddenKeys.add(node.key);
} else if (children) {
let allHidden = true;
for (const childNode of children) {
if (!hiddenKeys.has(childNode.key)) {
allHidden = false;
break;
}
}
if (allHidden) {
hiddenExpandIconKeys.add(node.key);
} else {
hiddenExpandIconKeys.delete(node.key);
}
}
}
family.pop();
});
}
traverse(nodes);
return expandKeySet;
}
function isForceHiddenExpandIcon(node) {
return hiddenExpandIconKeySet.value.has(node.key);
}
return {
hiddenExpandIconKeySet,
hiddenNodeKeySet,
doFilter,
isForceHiddenExpandIcon
};
}
// node_modules/element-plus/es/components/tree-v2/src/composables/useTree.mjs
function useTree3(props2, emit) {
const expandedKeySet = ref(/* @__PURE__ */ new Set());
const currentKey = ref();
const tree = shallowRef();
const listRef = ref();
const {
isIndeterminate,
isChecked,
toggleCheckbox,
getCheckedKeys,
getCheckedNodes,
getHalfCheckedKeys,
getHalfCheckedNodes,
setChecked,
setCheckedKeys
} = useCheck2(props2, tree);
const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(
props2,
tree
);
const valueKey = computed(() => {
var _a;
return ((_a = props2.props) == null ? void 0 : _a.value) || TreeOptionsEnum.KEY;
});
const childrenKey = computed(() => {
var _a;
return ((_a = props2.props) == null ? void 0 : _a.children) || TreeOptionsEnum.CHILDREN;
});
const disabledKey = computed(() => {
var _a;
return ((_a = props2.props) == null ? void 0 : _a.disabled) || TreeOptionsEnum.DISABLED;
});
const labelKey = computed(() => {
var _a;
return ((_a = props2.props) == null ? void 0 : _a.label) || TreeOptionsEnum.LABEL;
});
const flattenTree = computed(() => {
var _a;
const expandedKeys = expandedKeySet.value;
const hiddenKeys = hiddenNodeKeySet.value;
const flattenNodes = [];
const nodes = ((_a = tree.value) == null ? void 0 : _a.treeNodes) || [];
const stack = [];
for (let i = nodes.length - 1; i >= 0; --i) {
stack.push(nodes[i]);
}
while (stack.length) {
const node = stack.pop();
if (hiddenKeys.has(node.key)) continue;
flattenNodes.push(node);
if (node.children && expandedKeys.has(node.key)) {
for (let i = node.children.length - 1; i >= 0; --i) {
stack.push(node.children[i]);
}
}
}
return flattenNodes;
});
const isNotEmpty = computed(() => {
return flattenTree.value.length > 0;
});
function createTree(data) {
const treeNodeMap = /* @__PURE__ */ new Map();
const levelTreeNodeMap = /* @__PURE__ */ new Map();
let maxLevel = 1;
function traverse(nodes, level = 1, parent = void 0) {
var _a;
const siblings = [];
for (const rawNode of nodes) {
const value = getKey(rawNode);
const node = {
level,
key: value,
data: rawNode
};
node.label = getLabel(rawNode);
node.parent = parent;
const children = getChildren(rawNode);
node.disabled = getDisabled(rawNode);
node.isLeaf = !children || children.length === 0;
node.expanded = expandedKeySet.value.has(value);
if (children && children.length) {
node.children = traverse(children, level + 1, node);
}
siblings.push(node);
treeNodeMap.set(value, node);
if (!levelTreeNodeMap.has(level)) {
levelTreeNodeMap.set(level, []);
}
(_a = levelTreeNodeMap.get(level)) == null ? void 0 : _a.push(node);
}
if (level > maxLevel) {
maxLevel = level;
}
return siblings;
}
const treeNodes = traverse(data);
return {
treeNodeMap,
levelTreeNodeMap,
maxLevel,
treeNodes
};
}
function filter(query) {
const keys2 = doFilter(query);
if (keys2) {
expandedKeySet.value = keys2;
}
}
function getChildren(node) {
return node[childrenKey.value];
}
function getKey(node) {
if (!node) {
return "";
}
return node[valueKey.value];
}
function getDisabled(node) {
return node[disabledKey.value];
}
function getLabel(node) {
return node[labelKey.value];
}
function toggleExpand(node) {
const expandedKeys = expandedKeySet.value;
if (expandedKeys.has(node.key)) {
collapseNode(node);
} else {
expandNode(node);
}
}
function setExpandedKeys(keys2) {
const expandedKeys = /* @__PURE__ */ new Set();
const nodeMap = tree.value.treeNodeMap;
expandedKeySet.value.forEach((key) => {
const node = nodeMap.get(key);
expandedKeySet.value.delete(node.key);
node.expanded = false;
});
keys2.forEach((k) => {
let node = nodeMap.get(k);
while (node && !expandedKeys.has(node.key)) {
expandedKeys.add(node.key);
node.expanded = true;
node = node.parent;
}
});
expandedKeySet.value = expandedKeys;
}
function handleNodeClick(node, e) {
emit(NODE_CLICK, node.data, node, e);
handleCurrentChange2(node);
if (props2.expandOnClickNode) {
toggleExpand(node);
}
if (props2.showCheckbox && (props2.checkOnClickNode || node.isLeaf && props2.checkOnClickLeaf) && !node.disabled) {
toggleCheckbox(node, !isChecked(node), true);
}
}
function handleNodeDrop(node, e) {
emit(NODE_DROP, node.data, node, e);
}
function handleCurrentChange2(node) {
if (!isCurrent(node)) {
currentKey.value = node.key;
emit(CURRENT_CHANGE, node.data, node);
}
}
function handleNodeCheck(node, checked) {
toggleCheckbox(node, checked);
}
function expandNode(node) {
const keySet = expandedKeySet.value;
if (tree.value && props2.accordion) {
const { treeNodeMap } = tree.value;
keySet.forEach((key) => {
const treeNode = treeNodeMap.get(key);
if (node && node.level === (treeNode == null ? void 0 : treeNode.level)) {
keySet.delete(key);
treeNode.expanded = false;
}
});
}
keySet.add(node.key);
const _node = getNode(node.key);
if (_node) {
_node.expanded = true;
emit(NODE_EXPAND, _node.data, _node);
}
}
function collapseNode(node) {
expandedKeySet.value.delete(node.key);
const _node = getNode(node.key);
if (_node) {
_node.expanded = false;
emit(NODE_COLLAPSE, _node.data, _node);
}
}
function isDisabled(node) {
return !!node.disabled;
}
function isCurrent(node) {
const current = currentKey.value;
return current !== void 0 && current === node.key;
}
function getCurrentNode() {
var _a, _b;
if (!currentKey.value) return void 0;
return (_b = (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(currentKey.value)) == null ? void 0 : _b.data;
}
function getCurrentKey() {
return currentKey.value;
}
function setCurrentKey(key) {
currentKey.value = key;
}
function setData(data) {
tree.value = createTree(data);
}
function getNode(data) {
var _a;
const key = isObject(data) ? getKey(data) : data;
return (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(key);
}
function scrollToNode(key, strategy = "auto") {
const node = getNode(key);
if (node && listRef.value) {
listRef.value.scrollToItem(flattenTree.value.indexOf(node), strategy);
}
}
function scrollTo2(offset3) {
var _a;
(_a = listRef.value) == null ? void 0 : _a.scrollTo(offset3);
}
watch(
() => props2.currentNodeKey,
(key) => {
currentKey.value = key;
},
{
immediate: true
}
);
watch(
() => props2.defaultExpandedKeys,
(key) => {
expandedKeySet.value = new Set(key);
},
{
immediate: true
}
);
watch(
() => props2.data,
(data) => {
setData(data);
},
{
immediate: true
}
);
return {
tree,
flattenTree,
isNotEmpty,
listRef,
getKey,
getChildren,
toggleExpand,
toggleCheckbox,
isChecked,
isIndeterminate,
isDisabled,
isCurrent,
isForceHiddenExpandIcon,
handleNodeClick,
handleNodeDrop,
handleNodeCheck,
// expose
getCurrentNode,
getCurrentKey,
setCurrentKey,
getCheckedKeys,
getCheckedNodes,
getHalfCheckedKeys,
getHalfCheckedNodes,
setChecked,
setCheckedKeys,
filter,
setData,
getNode,
expandNode,
collapseNode,
setExpandedKeys,
scrollToNode,
scrollTo: scrollTo2
};
}
// node_modules/element-plus/es/components/tree-v2/src/tree-node-content.mjs
var ElNodeContent = defineComponent({
name: "ElTreeNodeContent",
props: treeNodeContentProps,
setup(props2) {
const tree = inject(ROOT_TREE_INJECTION_KEY2);
const ns = useNamespace("tree");
return () => {
const node = props2.node;
const { data } = node;
return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({ node, data }) : h(
ElText,
{ tag: "span", truncated: true, class: ns.be("node", "label") },
() => [node == null ? void 0 : node.label]
);
};
}
});
// node_modules/element-plus/es/components/tree-v2/src/tree-node.vue2.mjs
var _hoisted_173 = ["aria-expanded", "aria-disabled", "aria-checked", "data-key"];
var _sfc_main140 = defineComponent({
...{
name: "ElTreeNode"
},
__name: "tree-node",
props: treeNodeProps,
emits: treeNodeEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const tree = inject(ROOT_TREE_INJECTION_KEY2);
const ns = useNamespace("tree");
const indent = computed(() => {
var _a;
return (_a = tree == null ? void 0 : tree.props.indent) != null ? _a : 16;
});
const icon = computed(() => {
var _a;
return (_a = tree == null ? void 0 : tree.props.icon) != null ? _a : caret_right_default;
});
const getNodeClass = (node) => {
var _a;
const nodeClassFunc = (_a = tree == null ? void 0 : tree.props.props) == null ? void 0 : _a.class;
if (!nodeClassFunc) return {};
let className;
if (isFunction(nodeClassFunc)) {
const { data } = node;
className = nodeClassFunc(data, node);
} else {
className = nodeClassFunc;
}
return isString(className) ? { [className]: true } : className;
};
const handleClick = (e) => {
emit("click", props2.node, e);
};
const handleDrop = (e) => {
emit("drop", props2.node, e);
};
const handleExpandIconClick = () => {
emit("toggle", props2.node);
};
const handleCheckChange = (value) => {
emit("check", props2.node, value);
};
const handleContextMenu = (event) => {
var _a, _b, _c, _d;
if ((_c = (_b = (_a = tree == null ? void 0 : tree.instance) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props) == null ? void 0 : _c["onNodeContextmenu"]) {
event.stopPropagation();
event.preventDefault();
}
tree == null ? void 0 : tree.ctx.emit(NODE_CONTEXTMENU, event, (_d = props2.node) == null ? void 0 : _d.data, props2.node);
};
return (_ctx, _cache) => {
var _a, _b, _c;
return openBlock(), createElementBlock("div", {
ref: "node$",
class: normalizeClass([
unref(ns).b("node"),
unref(ns).is("expanded", __props.expanded),
unref(ns).is("current", __props.current),
unref(ns).is("focusable", !__props.disabled),
unref(ns).is("checked", !__props.disabled && __props.checked),
getNodeClass(__props.node)
]),
role: "treeitem",
tabindex: "-1",
"aria-expanded": __props.expanded,
"aria-disabled": __props.disabled,
"aria-checked": __props.checked,
"data-key": (_a = __props.node) == null ? void 0 : _a.key,
onClick: withModifiers(handleClick, ["stop"]),
onContextmenu: handleContextMenu,
onDragover: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["prevent"])),
onDragenter: _cache[2] || (_cache[2] = withModifiers(() => {
}, ["prevent"])),
onDrop: withModifiers(handleDrop, ["stop"])
}, [
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns).be("node", "content")),
style: normalizeStyle({
paddingLeft: `${(__props.node.level - 1) * indent.value}px`,
height: __props.itemSize + "px"
})
},
[
icon.value ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([
unref(ns).is("leaf", !!((_b = __props.node) == null ? void 0 : _b.isLeaf)),
unref(ns).is("hidden", __props.hiddenExpandIcon),
{
expanded: !((_c = __props.node) == null ? void 0 : _c.isLeaf) && __props.expanded
},
unref(ns).be("node", "expand-icon")
]),
onClick: withModifiers(handleExpandIconClick, ["stop"])
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(icon.value)))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true),
__props.showCheckbox ? (openBlock(), createBlock(unref(ElCheckbox), {
key: 1,
"model-value": __props.checked,
indeterminate: __props.indeterminate,
disabled: __props.disabled,
onChange: handleCheckChange,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
}, null, 8, ["model-value", "indeterminate", "disabled"])) : createCommentVNode("v-if", true),
createVNode(unref(ElNodeContent), {
node: { ...__props.node, expanded: __props.expanded }
}, null, 8, ["node"])
],
6
/* CLASS, STYLE */
)
], 42, _hoisted_173);
};
}
});
// node_modules/element-plus/es/components/tree-v2/src/tree.vue2.mjs
var _sfc_main141 = defineComponent({
...{
name: "ElTreeV2"
},
__name: "tree",
props: treeProps2,
emits: treeEmits2,
setup(__props, { expose: __expose, emit: __emit }) {
const props2 = __props;
const emit = __emit;
const slots = useSlots();
const treeNodeSize = computed(() => props2.itemSize);
provide(ROOT_TREE_INJECTION_KEY2, {
ctx: {
emit,
slots
},
props: props2,
instance: getCurrentInstance()
});
provide(formItemContextKey, void 0);
const { t } = useLocale();
const ns = useNamespace("tree");
const {
flattenTree,
isNotEmpty,
listRef,
toggleExpand,
isIndeterminate,
isChecked,
isDisabled,
isCurrent,
isForceHiddenExpandIcon,
handleNodeClick,
handleNodeDrop,
handleNodeCheck,
// expose
toggleCheckbox,
getCurrentNode,
getCurrentKey,
setCurrentKey,
getCheckedKeys,
getCheckedNodes,
getHalfCheckedKeys,
getHalfCheckedNodes,
setChecked,
setCheckedKeys,
filter,
setData,
getNode,
expandNode,
collapseNode,
setExpandedKeys,
scrollToNode,
scrollTo: scrollTo2
} = useTree3(props2, emit);
__expose({
toggleCheckbox,
getCurrentNode,
getCurrentKey,
setCurrentKey,
getCheckedKeys,
getCheckedNodes,
getHalfCheckedKeys,
getHalfCheckedNodes,
setChecked,
setCheckedKeys,
filter,
setData,
getNode,
expandNode,
collapseNode,
setExpandedKeys,
scrollToNode,
scrollTo: scrollTo2
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b(), { [unref(ns).m("highlight-current")]: __props.highlightCurrent }]),
role: "tree"
},
[
unref(isNotEmpty) ? (openBlock(), createBlock(unref(FixedSizeList), {
key: 0,
ref_key: "listRef",
ref: listRef,
"class-name": unref(ns).b("virtual-list"),
data: unref(flattenTree),
total: unref(flattenTree).length,
height: __props.height,
"item-size": treeNodeSize.value,
"perf-mode": __props.perfMode,
"scrollbar-always-on": __props.scrollbarAlwaysOn
}, {
default: withCtx(({ data, index, style }) => [
(openBlock(), createBlock(_sfc_main140, {
key: data[index].key,
style: normalizeStyle(style),
node: data[index],
expanded: data[index].expanded,
"show-checkbox": __props.showCheckbox,
checked: unref(isChecked)(data[index]),
indeterminate: unref(isIndeterminate)(data[index]),
"item-size": treeNodeSize.value,
disabled: unref(isDisabled)(data[index]),
current: unref(isCurrent)(data[index]),
"hidden-expand-icon": unref(isForceHiddenExpandIcon)(data[index]),
onClick: unref(handleNodeClick),
onToggle: unref(toggleExpand),
onCheck: unref(handleNodeCheck),
onDrop: unref(handleNodeDrop)
}, null, 8, ["style", "node", "expanded", "show-checkbox", "checked", "indeterminate", "item-size", "disabled", "current", "hidden-expand-icon", "onClick", "onToggle", "onCheck", "onDrop"]))
]),
_: 1
/* STABLE */
}, 8, ["class-name", "data", "total", "height", "item-size", "perf-mode", "scrollbar-always-on"])) : (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(ns).e("empty-block"))
},
[
renderSlot(_ctx.$slots, "empty", {}, () => {
var _a;
return [
createBaseVNode(
"span",
{
class: normalizeClass(unref(ns).e("empty-text"))
},
toDisplayString((_a = __props.emptyText) != null ? _a : unref(t)("el.tree.emptyText")),
3
/* TEXT, CLASS */
)
];
})
],
2
/* CLASS */
))
],
2
/* CLASS */
);
};
}
});
// node_modules/element-plus/es/components/tree-v2/index.mjs
var ElTreeV2 = withInstall(_sfc_main141);
// node_modules/element-plus/es/components/upload/src/ajax.mjs
var __defProp9 = Object.defineProperty;
var __defNormalProp9 = (obj, key, value) => key in obj ? __defProp9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField9 = (obj, key, value) => __defNormalProp9(obj, typeof key !== "symbol" ? key + "" : key, value);
var SCOPE11 = "ElUpload";
var UploadAjaxError = class extends Error {
constructor(message2, status, method, url) {
super(message2);
__publicField9(this, "name", "UploadAjaxError");
__publicField9(this, "status");
__publicField9(this, "method");
__publicField9(this, "url");
this.status = status;
this.method = method;
this.url = url;
}
};
function getError(action, option, xhr) {
let msg;
if (xhr.response) {
msg = `${xhr.response.error || xhr.response}`;
} else if (xhr.responseText) {
msg = `${xhr.responseText}`;
} else {
msg = `fail to ${option.method} ${action} ${xhr.status}`;
}
return new UploadAjaxError(msg, xhr.status, option.method, action);
}
function getBody(xhr) {
const text = xhr.responseText || xhr.response;
if (!text) {
return text;
}
try {
return JSON.parse(text);
} catch (e) {
return text;
}
}
var ajaxUpload = (option) => {
if (typeof XMLHttpRequest === "undefined")
throwError(SCOPE11, "XMLHttpRequest is undefined");
const xhr = new XMLHttpRequest();
const action = option.action;
if (xhr.upload) {
xhr.upload.addEventListener("progress", (evt) => {
const progressEvt = evt;
progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0;
option.onProgress(progressEvt);
});
}
const formData = new FormData();
if (option.data) {
for (const [key, value] of Object.entries(option.data)) {
if (isArray(value) && value.length) formData.append(key, ...value);
else formData.append(key, value);
}
}
formData.append(option.filename, option.file, option.file.name);
xhr.addEventListener("error", () => {
option.onError(getError(action, option, xhr));
});
xhr.addEventListener("load", () => {
if (xhr.status < 200 || xhr.status >= 300) {
return option.onError(getError(action, option, xhr));
}
option.onSuccess(getBody(xhr));
});
xhr.open(option.method, action, true);
if (option.withCredentials && "withCredentials" in xhr) {
xhr.withCredentials = true;
}
const headers = option.headers || {};
if (headers instanceof Headers) {
headers.forEach((value, key) => xhr.setRequestHeader(key, value));
} else {
for (const [key, value] of Object.entries(headers)) {
if (isNil_default(value)) continue;
xhr.setRequestHeader(key, String(value));
}
}
xhr.send(formData);
return xhr;
};
// node_modules/element-plus/es/components/upload/src/upload.mjs
var uploadListTypes = ["text", "picture", "picture-card"];
var fileId = 1;
var genFileId = () => Date.now() + fileId++;
var uploadBaseProps = buildProps({
/**
* @description request URL
*/
action: {
type: String,
default: "#"
},
/**
* @description request headers
*/
headers: {
type: definePropType(Object)
},
/**
* @description set upload request method
*/
method: {
type: String,
default: "post"
},
/**
* @description additions options of request
*/
data: {
type: definePropType([Object, Function, Promise]),
default: () => mutable({})
},
/**
* @description whether uploading multiple files is permitted
*/
multiple: Boolean,
/**
* @description key name for uploaded file
*/
name: {
type: String,
default: "file"
},
/**
* @description whether to activate drag and drop mode
*/
drag: Boolean,
/**
* @description whether cookies are sent
*/
withCredentials: Boolean,
/**
* @description whether to show the uploaded file list
*/
showFileList: {
type: Boolean,
default: true
},
/**
* @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true`
*/
accept: {
type: String,
default: ""
},
/**
* @description default uploaded files
*/
fileList: {
type: definePropType(Array),
default: () => mutable([])
},
/**
* @description whether to auto upload file
*/
autoUpload: {
type: Boolean,
default: true
},
/**
* @description type of file list
*/
listType: {
type: String,
values: uploadListTypes,
default: "text"
},
/**
* @description override default xhr behavior, allowing you to implement your own upload-file's request
*/
httpRequest: {
type: definePropType(Function),
default: ajaxUpload
},
/**
* @description whether to disable upload
*/
disabled: {
type: Boolean,
default: void 0
},
/**
* @description maximum number of uploads allowed
*/
limit: Number,
/**
* @description whether to support uploading directory
*/
directory: Boolean
});
var uploadProps = buildProps({
...uploadBaseProps,
/**
* @description hook function before uploading with the file to be uploaded as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, uploading will be aborted
*/
beforeUpload: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function before removing a file with the file and file list as its parameters. If `false` is returned or a `Promise` is returned and then is rejected, removing will be aborted
*/
beforeRemove: {
type: definePropType(Function)
},
/**
* @description hook function when files are removed
*/
onRemove: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when select file or upload file success or upload file fail
*/
onChange: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when clicking the uploaded files
*/
onPreview: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when uploaded successfully
*/
onSuccess: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when some progress occurs
*/
onProgress: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when some errors occurs
*/
onError: {
type: definePropType(Function),
default: NOOP
},
/**
* @description hook function when limit is exceeded
*/
onExceed: {
type: definePropType(Function),
default: NOOP
},
/**
* @description set HTML attribute: crossorigin.
*/
crossorigin: {
type: definePropType(String)
}
});
var uploadBasePropsDefaults = {
action: "#",
method: "post",
data: () => mutable({}),
name: "file",
showFileList: true,
accept: "",
fileList: () => mutable([]),
autoUpload: true,
listType: "text",
httpRequest: ajaxUpload,
disabled: void 0
};
var uploadPropsDefaults = {
...uploadBasePropsDefaults,
beforeUpload: NOOP,
onRemove: NOOP,
onChange: NOOP,
onPreview: NOOP,
onSuccess: NOOP,
onProgress: NOOP,
onError: NOOP,
onExceed: NOOP
};
// node_modules/element-plus/es/components/upload/src/constants.mjs
var uploadContextKey = /* @__PURE__ */ Symbol("uploadContextKey");
// node_modules/element-plus/es/components/upload/src/upload-list.mjs
var uploadListProps = buildProps({
files: {
type: definePropType(Array),
default: () => mutable([])
},
disabled: {
type: Boolean,
default: void 0
},
handlePreview: {
type: definePropType(Function),
default: NOOP
},
listType: {
type: String,
values: uploadListTypes,
default: "text"
},
/**
* @description set HTML attribute: crossorigin.
*/
crossorigin: {
type: definePropType(String)
}
});
var uploadListEmits = {
remove: (file) => !!file
};
// node_modules/element-plus/es/components/upload/src/upload-list.vue2.mjs
var _hoisted_174 = ["tabindex", "aria-disabled", "onKeydown"];
var _hoisted_240 = ["src", "crossorigin"];
var _hoisted_317 = ["onClick"];
var _hoisted_412 = ["title"];
var _hoisted_510 = ["onClick"];
var _hoisted_65 = ["onClick"];
var _sfc_main142 = defineComponent({
...{
name: "ElUploadList"
},
__name: "upload-list",
props: uploadListProps,
emits: uploadListEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const { t } = useLocale();
const nsUpload = useNamespace("upload");
const nsIcon = useNamespace("icon");
const nsList = useNamespace("list");
const disabled = useFormDisabled();
const focusing = ref(false);
const containerKls = computed(() => [
nsUpload.b("list"),
nsUpload.bm("list", props2.listType),
nsUpload.is("disabled", disabled.value)
]);
const handleRemove = (file) => {
emit("remove", file);
};
return (_ctx, _cache) => {
return openBlock(), createBlock(TransitionGroup, {
tag: "ul",
class: normalizeClass(containerKls.value),
name: unref(nsList).b()
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.files, (file, index) => {
return openBlock(), createElementBlock("li", {
key: file.uid || file.name,
class: normalizeClass([
unref(nsUpload).be("list", "item"),
unref(nsUpload).is(file.status),
{ focusing: focusing.value }
]),
tabindex: unref(disabled) ? void 0 : 0,
"aria-disabled": unref(disabled),
role: "button",
onKeydown: withKeys(($event) => !unref(disabled) && handleRemove(file), ["delete"]),
onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true),
onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false),
onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false)
}, [
renderSlot(_ctx.$slots, "default", {
file,
index
}, () => [
__props.listType === "picture" || file.status !== "uploading" && __props.listType === "picture-card" ? (openBlock(), createElementBlock("img", {
key: 0,
class: normalizeClass(unref(nsUpload).be("list", "item-thumbnail")),
src: file.url,
crossorigin: __props.crossorigin,
alt: ""
}, null, 10, _hoisted_240)) : createCommentVNode("v-if", true),
file.status === "uploading" || __props.listType !== "picture-card" ? (openBlock(), createElementBlock(
"div",
{
key: 1,
class: normalizeClass(unref(nsUpload).be("list", "item-info"))
},
[
createBaseVNode("a", {
class: normalizeClass(unref(nsUpload).be("list", "item-name")),
onClick: withModifiers(($event) => __props.handlePreview(file), ["prevent"])
}, [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(nsIcon).m("document"))
}, {
default: withCtx(() => [
createVNode(unref(document_default))
]),
_: 1
/* STABLE */
}, 8, ["class"]),
createBaseVNode("span", {
class: normalizeClass(unref(nsUpload).be("list", "item-file-name")),
title: file.name
}, toDisplayString(file.name), 11, _hoisted_412)
], 10, _hoisted_317),
file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), {
key: 0,
type: __props.listType === "picture-card" ? "circle" : "line",
"stroke-width": __props.listType === "picture-card" ? 6 : 2,
percentage: Number(file.percentage),
style: normalizeStyle(__props.listType === "picture-card" ? "" : "margin-top: 0.5rem")
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"label",
{
class: normalizeClass(unref(nsUpload).be("list", "item-status-label"))
},
[
__props.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("circle-check")])
}, {
default: withCtx(() => [
createVNode(unref(circle_check_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : ["picture-card", "picture"].includes(__props.listType) ? (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("check")])
}, {
default: withCtx(() => [
createVNode(unref(check_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
),
!unref(disabled) ? (openBlock(), createBlock(unref(ElIcon), {
key: 2,
class: normalizeClass(unref(nsIcon).m("close")),
onClick: ($event) => handleRemove(file)
}, {
default: withCtx(() => [
createVNode(unref(close_default))
]),
_: 1
/* STABLE */
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
createCommentVNode(" This is a bug which needs to be fixed "),
createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
!unref(disabled) ? (openBlock(), createElementBlock(
"i",
{
key: 3,
class: normalizeClass(unref(nsIcon).m("close-tip"))
},
toDisplayString(unref(t)("el.upload.deleteTip")),
3
/* TEXT, CLASS */
)) : createCommentVNode("v-if", true),
__props.listType === "picture-card" ? (openBlock(), createElementBlock(
"span",
{
key: 4,
class: normalizeClass(unref(nsUpload).be("list", "item-actions"))
},
[
createBaseVNode("span", {
class: normalizeClass(unref(nsUpload).be("list", "item-preview")),
onClick: ($event) => __props.handlePreview(file)
}, [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(nsIcon).m("zoom-in"))
}, {
default: withCtx(() => [
createVNode(unref(zoom_in_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])
], 10, _hoisted_510),
!unref(disabled) ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass(unref(nsUpload).be("list", "item-delete")),
onClick: ($event) => handleRemove(file)
}, [
createVNode(unref(ElIcon), {
class: normalizeClass(unref(nsIcon).m("delete"))
}, {
default: withCtx(() => [
createVNode(unref(delete_default))
]),
_: 1
/* STABLE */
}, 8, ["class"])
], 10, _hoisted_65)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
])
], 42, _hoisted_174);
}),
128
/* KEYED_FRAGMENT */
)),
renderSlot(_ctx.$slots, "append")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "name"]);
};
}
});
// node_modules/element-plus/es/components/upload/src/upload-content.mjs
var uploadContentProps = buildProps({
...uploadBaseProps,
beforeUpload: {
type: definePropType(Function),
default: NOOP
},
onRemove: {
type: definePropType(Function),
default: NOOP
},
onStart: {
type: definePropType(Function),
default: NOOP
},
onSuccess: {
type: definePropType(
Function
),
default: NOOP
},
onProgress: {
type: definePropType(Function),
default: NOOP
},
onError: {
type: definePropType(Function),
default: NOOP
},
onExceed: {
type: definePropType(Function),
default: NOOP
}
});
var uploadContentPropsDefaults = {
...uploadBasePropsDefaults,
beforeUpload: NOOP,
onRemove: NOOP,
onStart: NOOP,
onSuccess: NOOP,
onProgress: NOOP,
onError: NOOP,
onExceed: NOOP
};
// node_modules/element-plus/es/components/upload/src/upload-dragger.mjs
var uploadDraggerProps = buildProps({
disabled: {
type: Boolean,
default: void 0
},
directory: Boolean
});
var uploadDraggerEmits = {
file: (file) => isArray(file)
};
// node_modules/element-plus/es/components/upload/src/upload-dragger.vue2.mjs
var COMPONENT_NAME25 = "ElUploadDrag";
var _sfc_main143 = defineComponent({
...{
name: COMPONENT_NAME25
},
__name: "upload-dragger",
props: uploadDraggerProps,
emits: uploadDraggerEmits,
setup(__props, { emit: __emit }) {
const props2 = __props;
const emit = __emit;
const uploaderContext = inject(uploadContextKey);
if (!uploaderContext) {
throwError(
COMPONENT_NAME25,
"usage: "
);
}
const ns = useNamespace("upload");
const dragover = ref(false);
const disabled = useFormDisabled();
const getFile = (entry) => {
return new Promise((resolve, reject) => entry.file(resolve, reject));
};
const getAllFiles = async (entry) => {
try {
if (entry.isFile) {
const file = await getFile(
entry
);
file.isDirectory = false;
return [file];
}
if (entry.isDirectory) {
const dirReader = entry.createReader();
const getEntries = () => {
return new Promise(
(resolve, reject) => dirReader.readEntries(resolve, reject)
);
};
const entries = [];
let readEntries = await getEntries();
while (readEntries.length > 0) {
entries.push(...readEntries);
readEntries = await getEntries();
}
const filePromises = entries.map(
(entry2) => getAllFiles(entry2).catch(() => [])
);
const files = await Promise.all(filePromises);
return flatten_default(files);
}
} catch (e) {
return [];
}
return [];
};
const onDrop = async (e) => {
if (disabled.value) return;
dragover.value = false;
e.stopPropagation();
const files = Array.from(e.dataTransfer.files);
const items = e.dataTransfer.items || [];
if (props2.directory) {
const entries = Array.from(items).map((item) => {
var _a;
return (_a = item == null ? void 0 : item.webkitGetAsEntry) == null ? void 0 : _a.call(item);
}).filter((entry) => entry);
const allFiles = await Promise.all(entries.map(getAllFiles));
emit("file", flatten_default(allFiles));
return;
}
files.forEach((file, index) => {
var _a;
const item = items[index];
const entry = (_a = item == null ? void 0 : item.webkitGetAsEntry) == null ? void 0 : _a.call(item);
if (entry) {
file.isDirectory = entry.isDirectory;
}
});
emit("file", files);
};
const onDragover = () => {
if (!disabled.value) dragover.value = true;
};
const onDragleave = (e) => {
if (!e.currentTarget.contains(e.relatedTarget))
dragover.value = false;
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
onDrop: withModifiers(onDrop, ["prevent"]),
onDragover: withModifiers(onDragover, ["prevent"]),
onDragleave: withModifiers(onDragleave, ["prevent"])
},
[
renderSlot(_ctx.$slots, "default")
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
// node_modules/element-plus/es/components/upload/src/upload-content.vue2.mjs
var _hoisted_175 = ["tabindex", "aria-disabled", "onKeydown"];
var _hoisted_241 = ["name", "disabled", "multiple", "accept", "webkitdirectory"];
var _sfc_main144 = defineComponent({
...{
name: "ElUploadContent",
inheritAttrs: false
},
__name: "upload-content",
props: uploadContentProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const ns = useNamespace("upload");
const disabled = useFormDisabled();
const requests = shallowRef(
{}
);
const inputRef = shallowRef();
const uploadFiles = (files) => {
if (files.length === 0) return;
const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props2;
if (limit && fileList.length + files.length > limit) {
onExceed(files, fileList);
return;
}
if (!multiple) {
files = files.slice(0, 1);
}
for (const file of files) {
const rawFile = file;
rawFile.uid = genFileId();
onStart(rawFile);
if (autoUpload) upload(rawFile);
}
};
const upload = async (rawFile) => {
inputRef.value.value = "";
if (!props2.beforeUpload) {
return doUpload(rawFile);
}
let hookResult;
let beforeData = {};
try {
const originData = props2.data;
const beforeUploadPromise = props2.beforeUpload(rawFile);
beforeData = isPlainObject(props2.data) ? cloneDeep_default(props2.data) : props2.data;
hookResult = await beforeUploadPromise;
if (isPlainObject(props2.data) && isEqual_default(originData, beforeData)) {
beforeData = cloneDeep_default(props2.data);
}
} catch (e) {
hookResult = false;
}
if (hookResult === false) {
props2.onRemove(rawFile);
return;
}
let file = rawFile;
if (hookResult instanceof Blob) {
if (hookResult instanceof File) {
file = hookResult;
} else {
file = new File([hookResult], rawFile.name, {
type: rawFile.type
});
}
}
doUpload(
Object.assign(file, {
uid: rawFile.uid
}),
beforeData
);
};
const resolveData = async (data, rawFile) => {
if (isFunction(data)) {
return data(rawFile);
}
return data;
};
const doUpload = async (rawFile, beforeData) => {
const {
headers,
data,
method,
withCredentials,
name: filename,
action,
onProgress,
onSuccess,
onError,
httpRequest
} = props2;
try {
beforeData = await resolveData(beforeData != null ? beforeData : data, rawFile);
} catch (e) {
props2.onRemove(rawFile);
return;
}
const { uid: uid2 } = rawFile;
const options = {
headers: headers || {},
withCredentials,
file: rawFile,
data: beforeData,
method,
filename,
action,
onProgress: (evt) => {
onProgress(evt, rawFile);
},
onSuccess: (res) => {
onSuccess(res, rawFile);
delete requests.value[uid2];
},
onError: (err) => {
onError(err, rawFile);
delete requests.value[uid2];
}
};
const request = httpRequest(options);
requests.value[uid2] = request;
if (request instanceof Promise) {
request.then(options.onSuccess, options.onError);
}
};
const handleChange = (e) => {
const files = e.target.files;
if (!files) return;
uploadFiles(Array.from(files));
};
const handleClick = () => {
if (!disabled.value) {
inputRef.value.value = "";
inputRef.value.click();
}
};
const handleKeydown = () => {
handleClick();
};
const abort = (file) => {
const _reqs = entriesOf(requests.value).filter(
file ? ([uid2]) => String(file.uid) === uid2 : () => true
);
_reqs.forEach(([uid2, req]) => {
if (req instanceof XMLHttpRequest) req.abort();
delete requests.value[uid2];
});
};
__expose({
abort,
upload
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([
unref(ns).b(),
unref(ns).m(__props.listType),
unref(ns).is("drag", __props.drag),
unref(ns).is("disabled", unref(disabled))
]),
tabindex: unref(disabled) ? void 0 : 0,
"aria-disabled": unref(disabled),
role: "button",
onClick: handleClick,
onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"])
}, [
__props.drag ? (openBlock(), createBlock(_sfc_main143, {
key: 0,
disabled: unref(disabled),
directory: __props.directory,
onFile: uploadFiles
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["disabled", "directory"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
createBaseVNode("input", {
ref_key: "inputRef",
ref: inputRef,
class: normalizeClass(unref(ns).e("input")),
name: __props.name,
disabled: unref(disabled),
multiple: __props.multiple,
accept: __props.accept,
webkitdirectory: __props.directory || void 0,
type: "file",
onChange: handleChange,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
}, null, 42, _hoisted_241)
], 42, _hoisted_175);
};
}
});
// node_modules/element-plus/es/components/upload/src/use-handlers.mjs
var SCOPE12 = "ElUpload";
var revokeFileObjectURL = (file) => {
var _a;
if ((_a = file.url) == null ? void 0 : _a.startsWith("blob:")) {
URL.revokeObjectURL(file.url);
}
};
var useHandlers = (props2, uploadRef) => {
const uploadFiles = useVModel(
props2,
"fileList",
void 0,
{ passive: true }
);
const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
function abort(file) {
var _a;
(_a = uploadRef.value) == null ? void 0 : _a.abort(file);
}
function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
uploadFiles.value = uploadFiles.value.filter(
(row) => !states.includes(row.status)
);
}
function removeFile(file) {
uploadFiles.value = uploadFiles.value.filter(
(uploadFile) => uploadFile.uid !== file.uid
);
}
const emitChange = (file) => {
nextTick(() => props2.onChange(file, uploadFiles.value));
};
const handleError = (err, rawFile) => {
const file = getFile(rawFile);
if (!file) return;
console.error(err);
file.status = "fail";
removeFile(file);
props2.onError(err, file, uploadFiles.value);
emitChange(file);
};
const handleProgress = (evt, rawFile) => {
const file = getFile(rawFile);
if (!file) return;
props2.onProgress(evt, file, uploadFiles.value);
file.status = "uploading";
file.percentage = Math.round(evt.percent);
};
const handleSuccess = (response, rawFile) => {
const file = getFile(rawFile);
if (!file) return;
file.status = "success";
file.response = response;
props2.onSuccess(response, file, uploadFiles.value);
emitChange(file);
};
const handleStart = (file) => {
if (isNil_default(file.uid)) file.uid = genFileId();
const uploadFile = {
name: file.name,
percentage: 0,
status: "ready",
size: file.size,
raw: file,
uid: file.uid
};
if (props2.listType === "picture-card" || props2.listType === "picture") {
try {
uploadFile.url = URL.createObjectURL(file);
} catch (err) {
debugWarn(SCOPE12, err.message);
props2.onError(err, uploadFile, uploadFiles.value);
}
}
uploadFiles.value = [...uploadFiles.value, uploadFile];
emitChange(uploadFile);
};
const handleRemove = async (file) => {
const uploadFile = file instanceof File ? getFile(file) : file;
if (!uploadFile) throwError(SCOPE12, "file to be removed not found");
const doRemove = (file2) => {
abort(file2);
removeFile(file2);
props2.onRemove(file2, uploadFiles.value);
revokeFileObjectURL(file2);
};
if (props2.beforeRemove) {
const before = await props2.beforeRemove(uploadFile, uploadFiles.value);
if (before !== false) doRemove(uploadFile);
} else {
doRemove(uploadFile);
}
};
function submit() {
uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => {
var _a;
return raw && ((_a = uploadRef.value) == null ? void 0 : _a.upload(raw));
});
}
watch(
() => props2.listType,
(val) => {
if (val !== "picture-card" && val !== "picture") {
return;
}
uploadFiles.value = uploadFiles.value.map((file) => {
const { raw, url } = file;
if (!url && raw) {
try {
file.url = URL.createObjectURL(raw);
} catch (err) {
props2.onError(err, file, uploadFiles.value);
}
}
return file;
});
}
);
watch(
uploadFiles,
(files) => {
for (const file of files) {
file.uid || (file.uid = genFileId());
file.status || (file.status = "success");
}
},
{ immediate: true, deep: true }
);
return {
/** @description two-way binding ref from props `fileList` */
uploadFiles,
abort,
clearFiles,
handleError,
handleProgress,
handleStart,
handleSuccess,
handleRemove,
submit,
revokeFileObjectURL
};
};
// node_modules/element-plus/es/components/upload/src/upload.vue2.mjs
var _sfc_main145 = defineComponent({
...{
name: "ElUpload"
},
__name: "upload",
props: uploadProps,
setup(__props, { expose: __expose }) {
const props2 = __props;
const disabled = useFormDisabled();
const uploadRef = shallowRef();
const {
abort,
submit,
clearFiles,
uploadFiles,
handleStart,
handleError,
handleRemove,
handleSuccess,
handleProgress,
revokeFileObjectURL: revokeFileObjectURL2
} = useHandlers(props2, uploadRef);
const isPictureCard = computed(() => props2.listType === "picture-card");
const uploadContentProps2 = computed(() => ({
...props2,
fileList: uploadFiles.value,
onStart: handleStart,
onProgress: handleProgress,
onSuccess: handleSuccess,
onError: handleError,
onRemove: handleRemove
}));
onBeforeUnmount(() => {
uploadFiles.value.forEach(revokeFileObjectURL2);
});
provide(uploadContextKey, {
accept: toRef(props2, "accept")
});
__expose({
/** @description cancel upload request */
abort,
/** @description upload the file list manually */
submit,
/** @description clear the file list */
clearFiles,
/** @description select the file manually */
handleStart,
/** @description remove the file manually */
handleRemove
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(_sfc_main142, {
key: 0,
disabled: unref(disabled),
"list-type": __props.listType,
files: unref(uploadFiles),
crossorigin: __props.crossorigin,
"handle-preview": __props.onPreview,
onRemove: unref(handleRemove)
}, createSlots({
append: withCtx(() => [
createVNode(
_sfc_main144,
mergeProps({
ref_key: "uploadRef",
ref: uploadRef
}, uploadContentProps2.value),
{
default: withCtx(() => [
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
},
16
/* FULL_PROPS */
)
]),
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.file ? {
name: "default",
fn: withCtx(({ file, index }) => [
renderSlot(_ctx.$slots, "file", {
file,
index
})
]),
key: "0"
} : void 0
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
!isPictureCard.value || isPictureCard.value && !__props.showFileList ? (openBlock(), createBlock(
_sfc_main144,
mergeProps({
key: 1,
ref_key: "uploadRef",
ref: uploadRef
}, uploadContentProps2.value),
{
default: withCtx(() => [
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
},
16
/* FULL_PROPS */
)) : createCommentVNode("v-if", true),
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "tip"),
!isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(_sfc_main142, {
key: 3,
disabled: unref(disabled),
"list-type": __props.listType,
files: unref(uploadFiles),
crossorigin: __props.crossorigin,
"handle-preview": __props.onPreview,
onRemove: unref(handleRemove)
}, createSlots({
_: 2
/* DYNAMIC */
}, [
_ctx.$slots.file ? {
name: "default",
fn: withCtx(({ file, index }) => [
renderSlot(_ctx.$slots, "file", {
file,
index
})
]),
key: "0"
} : void 0
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
]);
};
}
});
// node_modules/element-plus/es/components/upload/index.mjs
var ElUpload = withInstall(_sfc_main145);
// node_modules/element-plus/es/components/watermark/src/watermark.mjs
var watermarkProps = buildProps({
/**
* @description The z-index of the appended watermark element
*/
zIndex: {
type: Number,
default: 9
},
/**
* @description The rotation angle of the watermark
*/
rotate: {
type: Number,
default: -22
},
/**
* @description The width of the watermark
*/
width: Number,
/**
* @description The height of the watermark
*/
height: Number,
/**
* @description Image source, it is recommended to export 2x or 3x image, high priority (support base64 format)
*/
image: String,
/**
* @description Watermark text content
*/
content: {
type: definePropType([String, Array]),
default: "Element Plus"
},
/**
* @description Text style
*/
font: {
type: definePropType(Object)
},
/**
* @description The spacing between watermarks
*/
gap: {
type: definePropType(Array),
default: () => [100, 100]
},
/**
* @description The offset of the watermark from the upper left corner of the container. The default is gap/2
*/
offset: {
type: definePropType(Array)
}
});
// node_modules/element-plus/es/components/watermark/src/utils.mjs
function toLowercaseSeparator(key) {
return key.replace(/([A-Z])/g, "-$1").toLowerCase();
}
function getStyleStr(style) {
return Object.keys(style).map(
(key) => `${toLowercaseSeparator(key)}: ${style[key]};`
).join(" ");
}
function getPixelRatio() {
return window.devicePixelRatio || 1;
}
var reRendering = (mutation, watermarkElement) => {
let flag = false;
if (mutation.removedNodes.length && watermarkElement) {
flag = Array.from(mutation.removedNodes).includes(watermarkElement);
}
if (mutation.type === "attributes" && mutation.target === watermarkElement) {
flag = true;
}
return flag;
};
// node_modules/element-plus/es/components/watermark/src/useClips.mjs
var TEXT_ALIGN_RATIO_MAP = {
left: [0, 0.5],
start: [0, 0.5],
center: [0.5, 0],
right: [1, -0.5],
end: [1, -0.5]
};
function prepareCanvas(width, height, ratio = 1) {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const realWidth = width * ratio;
const realHeight = height * ratio;
canvas.setAttribute("width", `${realWidth}px`);
canvas.setAttribute("height", `${realHeight}px`);
ctx.save();
return [ctx, canvas, realWidth, realHeight];
}
function useClips() {
function getClips(content, rotate, ratio, width, height, font, gapX, gapY, space) {
const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(
width,
height,
ratio
);
let baselineOffset = 0;
if (content instanceof HTMLImageElement) {
ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
} else {
const {
color,
fontSize,
fontStyle,
fontWeight,
fontFamily,
textAlign,
textBaseline
} = font;
const mergedFontSize = Number(fontSize) * ratio;
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
ctx.fillStyle = color;
ctx.textAlign = textAlign;
ctx.textBaseline = textBaseline;
const contents = isArray(content) ? content : [content];
if (textBaseline !== "top" && contents[0]) {
const argumentMetrics = ctx.measureText(contents[0]);
ctx.textBaseline = "top";
const topMetrics = ctx.measureText(contents[0]);
baselineOffset = argumentMetrics.actualBoundingBoxAscent - topMetrics.actualBoundingBoxAscent;
}
contents == null ? void 0 : contents.forEach((item, index) => {
const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign];
ctx.fillText(
item != null ? item : "",
contentWidth * alignRatio + space * spaceRatio,
index * (mergedFontSize + font.fontGap * ratio)
);
});
}
const angle = Math.PI / 180 * Number(rotate);
const maxSize = Math.max(width, height);
const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
rCtx.translate(realMaxSize / 2, realMaxSize / 2);
rCtx.rotate(angle);
if (contentWidth > 0 && contentHeight > 0) {
rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
}
function getRotatePos(x2, y) {
const targetX = x2 * Math.cos(angle) - y * Math.sin(angle);
const targetY = x2 * Math.sin(angle) + y * Math.cos(angle);
return [targetX, targetY];
}
let left = 0;
let right = 0;
let top = 0;
let bottom = 0;
const halfWidth = contentWidth / 2;
const halfHeight = contentHeight / 2;
const points = [
[0 - halfWidth, 0 - halfHeight],
[0 + halfWidth, 0 - halfHeight],
[0 + halfWidth, 0 + halfHeight],
[0 - halfWidth, 0 + halfHeight]
];
points.forEach(([x2, y]) => {
const [targetX, targetY] = getRotatePos(x2, y);
left = Math.min(left, targetX);
right = Math.max(right, targetX);
top = Math.min(top, targetY);
bottom = Math.max(bottom, targetY);
});
const cutLeft = left + realMaxSize / 2;
const cutTop = top + realMaxSize / 2;
const cutWidth = right - left;
const cutHeight = bottom - top;
const realGapX = gapX * ratio;
const realGapY = gapY * ratio;
const filledWidth = (cutWidth + realGapX) * 2;
const filledHeight = cutHeight + realGapY;
const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
function drawImg(targetX = 0, targetY = 0) {
fCtx.drawImage(
rCanvas,
cutLeft,
cutTop,
cutWidth,
cutHeight,
targetX,
targetY + baselineOffset,
cutWidth,
cutHeight
);
}
drawImg();
drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio];
}
return getClips;
}
// node_modules/element-plus/es/components/watermark/src/watermark.vue2.mjs
var _sfc_main146 = defineComponent({
...{
name: "ElWatermark"
},
__name: "watermark",
props: watermarkProps,
setup(__props) {
const style = {
position: "relative"
};
const props2 = __props;
const fontGap = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.fontGap) != null ? _b : 3;
});
const color = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.color) != null ? _b : "rgba(0,0,0,.15)";
});
const fontSize = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.fontSize) != null ? _b : 16;
});
const fontWeight = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.fontWeight) != null ? _b : "normal";
});
const fontStyle = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.fontStyle) != null ? _b : "normal";
});
const fontFamily = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.fontFamily) != null ? _b : "sans-serif";
});
const textAlign = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.textAlign) != null ? _b : "center";
});
const textBaseline = computed(() => {
var _a, _b;
return (_b = (_a = props2.font) == null ? void 0 : _a.textBaseline) != null ? _b : "hanging";
});
const gapX = computed(() => props2.gap[0]);
const gapY = computed(() => props2.gap[1]);
const gapXCenter = computed(() => gapX.value / 2);
const gapYCenter = computed(() => gapY.value / 2);
const offsetLeft = computed(() => {
var _a, _b;
return (_b = (_a = props2.offset) == null ? void 0 : _a[0]) != null ? _b : gapXCenter.value;
});
const offsetTop = computed(() => {
var _a, _b;
return (_b = (_a = props2.offset) == null ? void 0 : _a[1]) != null ? _b : gapYCenter.value;
});
const getMarkStyle = () => {
const markStyle = {
zIndex: props2.zIndex,
position: "absolute",
left: 0,
top: 0,
width: "100%",
height: "100%",
pointerEvents: "none",
backgroundRepeat: "repeat"
};
let positionLeft = offsetLeft.value - gapXCenter.value;
let positionTop = offsetTop.value - gapYCenter.value;
if (positionLeft > 0) {
markStyle.left = `${positionLeft}px`;
markStyle.width = `calc(100% - ${positionLeft}px)`;
positionLeft = 0;
}
if (positionTop > 0) {
markStyle.top = `${positionTop}px`;
markStyle.height = `calc(100% - ${positionTop}px)`;
positionTop = 0;
}
markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
return markStyle;
};
const containerRef = shallowRef(null);
const watermarkRef = shallowRef();
const stopObservation = ref(false);
const destroyWatermark = () => {
if (watermarkRef.value) {
watermarkRef.value.remove();
watermarkRef.value = void 0;
}
};
const appendWatermark = (base64Url, markWidth) => {
var _a;
if (containerRef.value && watermarkRef.value) {
stopObservation.value = true;
watermarkRef.value.setAttribute(
"style",
getStyleStr({
...getMarkStyle(),
backgroundImage: `url('${base64Url}')`,
backgroundSize: `${Math.floor(markWidth)}px`
})
);
(_a = containerRef.value) == null ? void 0 : _a.append(watermarkRef.value);
setTimeout(() => {
stopObservation.value = false;
});
}
};
const getMarkSize = (ctx) => {
let defaultWidth = 120;
let defaultHeight = 64;
let space = 0;
const { image, content, width, height, rotate } = props2;
if (!image && ctx.measureText) {
ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
const contents = isArray(content) ? content : [content];
let maxWidth = 0;
let maxHeight = 0;
contents.forEach((item) => {
const {
width: width2,
fontBoundingBoxAscent,
fontBoundingBoxDescent,
actualBoundingBoxAscent,
actualBoundingBoxDescent
} = ctx.measureText(item);
const height2 = isUndefined(fontBoundingBoxAscent) ? actualBoundingBoxAscent + actualBoundingBoxDescent : fontBoundingBoxAscent + fontBoundingBoxDescent;
if (width2 > maxWidth) maxWidth = Math.ceil(width2);
if (height2 > maxHeight) maxHeight = Math.ceil(height2);
});
defaultWidth = maxWidth;
defaultHeight = maxHeight * contents.length + (contents.length - 1) * fontGap.value;
const angle = Math.PI / 180 * Number(rotate);
space = Math.ceil(Math.abs(Math.sin(angle) * defaultHeight) / 2);
defaultWidth += space;
}
return [width != null ? width : defaultWidth, height != null ? height : defaultHeight, space];
};
const getClips = useClips();
const renderWatermark = () => {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const image = props2.image;
const content = props2.content;
const rotate = props2.rotate;
if (ctx) {
if (!watermarkRef.value) {
watermarkRef.value = document.createElement("div");
}
const ratio = getPixelRatio();
const [markWidth, markHeight, space] = getMarkSize(ctx);
const drawCanvas = (drawContent) => {
const [textClips, clipWidth] = getClips(
drawContent || "",
rotate,
ratio,
markWidth,
markHeight,
{
color: color.value,
fontSize: fontSize.value,
fontStyle: fontStyle.value,
fontWeight: fontWeight.value,
fontFamily: fontFamily.value,
fontGap: fontGap.value,
textAlign: textAlign.value,
textBaseline: textBaseline.value
},
gapX.value,
gapY.value,
space
);
appendWatermark(textClips, clipWidth);
};
if (image) {
const img = new Image();
img.onload = () => {
drawCanvas(img);
};
img.onerror = () => {
drawCanvas(content);
};
img.crossOrigin = "anonymous";
img.referrerPolicy = "no-referrer";
img.src = image;
} else {
drawCanvas(content);
}
}
};
onMounted(() => {
renderWatermark();
});
watch(
() => props2,
() => {
renderWatermark();
},
{
deep: true,
flush: "post"
}
);
onBeforeUnmount(() => {
destroyWatermark();
});
const onMutate = (mutations) => {
if (stopObservation.value) {
return;
}
mutations.forEach((mutation) => {
if (reRendering(mutation, watermarkRef.value)) {
destroyWatermark();
renderWatermark();
}
});
};
useMutationObserver(containerRef, onMutate, {
attributes: true,
subtree: true,
childList: true
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
ref_key: "containerRef",
ref: containerRef,
style: normalizeStyle([style])
},
[
renderSlot(_ctx.$slots, "default")
],
4
/* STYLE */
);
};
}
});
// node_modules/element-plus/es/components/watermark/index.mjs
var ElWatermark = withInstall(_sfc_main146);
// node_modules/element-plus/es/components/tour/src/content.mjs
var tourStrategies = ["absolute", "fixed"];
var tourPlacements = [
"top-start",
"top-end",
"top",
"bottom-start",
"bottom-end",
"bottom",
"left-start",
"left-end",
"left",
"right-start",
"right-end",
"right"
];
var tourContentProps = buildProps({
/**
* @description position of the guide card relative to the target element
*/
placement: {
type: definePropType(String),
values: tourPlacements,
default: "bottom"
},
/**
* @description the reference dom
*/
reference: {
type: definePropType(Object),
default: null
},
/**
* @description position strategy of the content
*/
strategy: {
type: definePropType(String),
values: tourStrategies,
default: "absolute"
},
/**
* @description offset of the arrow
*/
offset: {
type: Number,
default: 10
},
/**
* @description whether to show the arrow
*/
showArrow: Boolean,
/**
* @description content's zIndex
*/
zIndex: {
type: Number,
default: 2001
}
});
var tourContentEmits = {
close: () => true
};
// node_modules/element-plus/es/components/tour/src/tour.mjs
var tourProps = buildProps({
/**
* @description open tour
*/
modelValue: Boolean,
/**
* @description what is the current step
*/
current: {
type: Number,
default: 0
},
/**
* @description whether to show the arrow
*/
showArrow: {
type: Boolean,
default: true
},
/**
* @description whether to show a close button
*/
showClose: {
type: Boolean,
default: true
},
/**
* @description custom close icon
*/
closeIcon: {
type: iconPropType
},
/**
* @description position of the guide card relative to the target element
*/
placement: tourContentProps.placement,
/**
* @description custom style for content
*/
contentStyle: {
type: definePropType([Object])
},
/**
* @description whether to enable masking, change mask style and fill color by pass custom props
*/
mask: {
type: definePropType([Boolean, Object]),
default: true
},
/**
* @description transparent gap between mask and target
*/
gap: {
type: definePropType(Object),
default: () => ({
offset: 6,
radius: 2
})
},
/**
* @description tour's zIndex
*/
zIndex: {
type: Number
},
/**
* @description support pass custom scrollIntoView options
*/
scrollIntoViewOptions: {
type: definePropType([Boolean, Object]),
default: () => ({
block: "center"
})
},
/**
* @description type, affects the background color and text color
*/
type: {
type: definePropType(String)
},
/**
* @description which element the TourContent appends to
*/
appendTo: {
type: teleportProps.to.type,
default: "body"
},
/**
* @description whether the Tour can be closed by pressing ESC
*/
closeOnPressEscape: {
type: Boolean,
default: true
},
/**
* @description whether the target element can be clickable, when using mask
*/
targetAreaClickable: {
type: Boolean,
default: true
}
});
var tourEmits = {
[UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
["update:current"]: (current) => isNumber(current),
close: (current) => isNumber(current),
finish: () => true,
change: (current) => isNumber(current)
};
// node_modules/element-plus/es/components/tour/src/mask.mjs
var maskProps = buildProps({
/**
* @description mask's zIndex
*/
zIndex: {
type: Number,
default: 1001
},
/**
* @description whether to show the mask
*/
visible: Boolean,
/**
* @description mask's fill
*/
fill: {
type: String,
default: "rgba(0,0,0,0.5)"
},
/***
* @description mask's transparent space position
*/
pos: {
type: definePropType(Object)
},
/**
* @description whether the target element can be clickable, when using mask
*/
targetAreaClickable: {
type: Boolean,
default: true
}
});
// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var sides = ["top", "right", "bottom", "left"];
var alignments = ["start", "end"];
var placements = sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
var min2 = Math.min;
var max2 = Math.max;
var round = Math.round;
var floor2 = Math.floor;
var createCoords = (v2) => ({
x: v2,
y: v2
});
var oppositeSideMap = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
var oppositeAlignmentMap = {
start: "end",
end: "start"
};
function clamp2(start, value, end) {
return max2(start, min2(value, end));
}
function evaluate(value, param) {
return typeof value === "function" ? value(param) : value;
}
function getSide(placement) {
return placement.split("-")[0];
}
function getAlignment(placement) {
return placement.split("-")[1];
}
function getOppositeAxis(axis) {
return axis === "x" ? "y" : "x";
}
function getAxisLength(axis) {
return axis === "y" ? "height" : "width";
}
var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
function getSideAxis(placement) {
return yAxisSides.has(getSide(placement)) ? "y" : "x";
}
function getAlignmentAxis(placement) {
return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
}
var lrPlacement = ["left", "right"];
var rlPlacement = ["right", "left"];
var tbPlacement = ["top", "bottom"];
var btPlacement = ["bottom", "top"];
function getSideList(side, isStart, rtl) {
switch (side) {
case "top":
case "bottom":
if (rtl) return isStart ? rlPlacement : lrPlacement;
return isStart ? lrPlacement : rlPlacement;
case "left":
case "right":
return isStart ? tbPlacement : btPlacement;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction2, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction2 === "start", rtl);
if (alignment) {
list = list.map((side) => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
}
function expandPaddingObject(padding) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...padding
};
}
function getPaddingObject(padding) {
return typeof padding !== "number" ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
const {
x: x2,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x2,
right: x2 + width,
bottom: y + height,
x: x2,
y
};
}
// node_modules/@floating-ui/core/dist/floating-ui.core.mjs
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const sideAxis = getSideAxis(placement);
const alignmentAxis = getAlignmentAxis(placement);
const alignLength = getAxisLength(alignmentAxis);
const side = getSide(placement);
const isVertical = sideAxis === "y";
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height / 2;
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
let coords;
switch (side) {
case "top":
coords = {
x: commonX,
y: reference.y - floating.height
};
break;
case "bottom":
coords = {
x: commonX,
y: reference.y + reference.height
};
break;
case "right":
coords = {
x: reference.x + reference.width,
y: commonY
};
break;
case "left":
coords = {
x: reference.x - floating.width,
y: commonY
};
break;
default:
coords = {
x: reference.x,
y: reference.y
};
}
switch (getAlignment(placement)) {
case "start":
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
break;
case "end":
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
break;
}
return coords;
}
async function detectOverflow(state, options) {
var _await$platform$isEle;
if (options === void 0) {
options = {};
}
const {
x: x2,
y,
platform: platform2,
rects,
elements,
strategy
} = state;
const {
boundary = "clippingAncestors",
rootBoundary = "viewport",
elementContext = "floating",
altBoundary = false,
padding = 0
} = evaluate(options, state);
const paddingObject = getPaddingObject(padding);
const altContext = elementContext === "floating" ? "reference" : "floating";
const element = elements[altBoundary ? altContext : elementContext];
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
boundary,
rootBoundary,
strategy
}));
const rect = elementContext === "floating" ? {
x: x2,
y,
width: rects.floating.width,
height: rects.floating.height
} : rects.reference;
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
};
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
elements,
rect,
offsetParent,
strategy
}) : rect);
return {
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
};
}
var computePosition = async (reference, floating, config) => {
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform: platform2
} = config;
const validMiddleware = middleware.filter(Boolean);
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
let rects = await platform2.getElementRects({
reference,
floating,
strategy
});
let {
x: x2,
y
} = computeCoordsFromPlacement(rects, placement, rtl);
let statefulPlacement = placement;
let middlewareData = {};
let resetCount = 0;
for (let i = 0; i < validMiddleware.length; i++) {
var _platform$detectOverf;
const {
name,
fn: fn2
} = validMiddleware[i];
const {
x: nextX,
y: nextY,
data,
reset
} = await fn2({
x: x2,
y,
initialPlacement: placement,
placement: statefulPlacement,
strategy,
middlewareData,
rects,
platform: {
...platform2,
detectOverflow: (_platform$detectOverf = platform2.detectOverflow) != null ? _platform$detectOverf : detectOverflow
},
elements: {
reference,
floating
}
});
x2 = nextX != null ? nextX : x2;
y = nextY != null ? nextY : y;
middlewareData = {
...middlewareData,
[name]: {
...middlewareData[name],
...data
}
};
if (reset && resetCount <= 50) {
resetCount++;
if (typeof reset === "object") {
if (reset.placement) {
statefulPlacement = reset.placement;
}
if (reset.rects) {
rects = reset.rects === true ? await platform2.getElementRects({
reference,
floating,
strategy
}) : reset.rects;
}
({
x: x2,
y
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
}
i = -1;
}
}
return {
x: x2,
y,
placement: statefulPlacement,
strategy,
middlewareData
};
};
var arrow = (options) => ({
name: "arrow",
options,
async fn(state) {
const {
x: x2,
y,
placement,
rects,
platform: platform2,
elements,
middlewareData
} = state;
const {
element,
padding = 0
} = evaluate(options, state) || {};
if (element == null) {
return {};
}
const paddingObject = getPaddingObject(padding);
const coords = {
x: x2,
y
};
const axis = getAlignmentAxis(placement);
const length = getAxisLength(axis);
const arrowDimensions = await platform2.getDimensions(element);
const isYAxis = axis === "y";
const minProp = isYAxis ? "top" : "left";
const maxProp = isYAxis ? "bottom" : "right";
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
const startDiff = coords[axis] - rects.reference[axis];
const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
clientSize = elements.floating[clientProp] || rects.floating[length];
}
const centerToReference = endDiff / 2 - startDiff / 2;
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
const minPadding = min2(paddingObject[minProp], largestPossiblePadding);
const maxPadding = min2(paddingObject[maxProp], largestPossiblePadding);
const min$1 = minPadding;
const max3 = clientSize - arrowDimensions[length] - maxPadding;
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
const offset3 = clamp2(min$1, center, max3);
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max3 : 0;
return {
[axis]: coords[axis] + alignmentOffset,
data: {
[axis]: offset3,
centerOffset: center - offset3 - alignmentOffset,
...shouldAddOffset && {
alignmentOffset
}
},
reset: shouldAddOffset
};
}
});
var flip = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "flip",
options,
async fn(state) {
var _middlewareData$arrow, _middlewareData$flip;
const {
placement,
middlewareData,
rects,
initialPlacement,
platform: platform2,
elements
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true,
fallbackPlacements: specifiedFallbackPlacements,
fallbackStrategy = "bestFit",
fallbackAxisSideDirection = "none",
flipAlignment = true,
...detectOverflowOptions
} = evaluate(options, state);
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
const side = getSide(placement);
const initialSideAxis = getSideAxis(initialPlacement);
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
}
const placements2 = [initialPlacement, ...fallbackPlacements];
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
const overflows = [];
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
if (checkMainAxis) {
overflows.push(overflow[side]);
}
if (checkCrossAxis) {
const sides2 = getAlignmentSides(placement, rects, rtl);
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
}
overflowsData = [...overflowsData, {
placement,
overflows
}];
if (!overflows.every((side2) => side2 <= 0)) {
var _middlewareData$flip2, _overflowsData$filter;
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
const nextPlacement = placements2[nextIndex];
if (nextPlacement) {
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
// overflows the main axis.
overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
return {
data: {
index: nextIndex,
overflows: overflowsData
},
reset: {
placement: nextPlacement
}
};
}
}
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
if (!resetPlacement) {
switch (fallbackStrategy) {
case "bestFit": {
var _overflowsData$filter2;
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
if (hasFallbackAxisSideDirection) {
const currentSideAxis = getSideAxis(d2.placement);
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
// reading directions favoring greater width.
currentSideAxis === "y";
}
return true;
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
if (placement2) {
resetPlacement = placement2;
}
break;
}
case "initialPlacement":
resetPlacement = initialPlacement;
break;
}
}
if (placement !== resetPlacement) {
return {
reset: {
placement: resetPlacement
}
};
}
}
return {};
}
};
};
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
async function convertValueToCoords(state, options) {
const {
placement,
platform: platform2,
elements
} = state;
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
const side = getSide(placement);
const alignment = getAlignment(placement);
const isVertical = getSideAxis(placement) === "y";
const mainAxisMulti = originSides.has(side) ? -1 : 1;
const crossAxisMulti = rtl && isVertical ? -1 : 1;
const rawValue = evaluate(options, state);
let {
mainAxis,
crossAxis,
alignmentAxis
} = typeof rawValue === "number" ? {
mainAxis: rawValue,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: rawValue.mainAxis || 0,
crossAxis: rawValue.crossAxis || 0,
alignmentAxis: rawValue.alignmentAxis
};
if (alignment && typeof alignmentAxis === "number") {
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
}
return isVertical ? {
x: crossAxis * crossAxisMulti,
y: mainAxis * mainAxisMulti
} : {
x: mainAxis * mainAxisMulti,
y: crossAxis * crossAxisMulti
};
}
var offset = function(options) {
if (options === void 0) {
options = 0;
}
return {
name: "offset",
options,
async fn(state) {
var _middlewareData$offse, _middlewareData$arrow;
const {
x: x2,
y,
placement,
middlewareData
} = state;
const diffCoords = await convertValueToCoords(state, options);
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
return {
x: x2 + diffCoords.x,
y: y + diffCoords.y,
data: {
...diffCoords,
placement
}
};
}
};
};
var shift = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "shift",
options,
async fn(state) {
const {
x: x2,
y,
placement,
platform: platform2
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = false,
limiter = {
fn: (_ref) => {
let {
x: x3,
y: y2
} = _ref;
return {
x: x3,
y: y2
};
}
},
...detectOverflowOptions
} = evaluate(options, state);
const coords = {
x: x2,
y
};
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
const crossAxis = getSideAxis(getSide(placement));
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
if (checkMainAxis) {
const minSide = mainAxis === "y" ? "top" : "left";
const maxSide = mainAxis === "y" ? "bottom" : "right";
const min3 = mainAxisCoord + overflow[minSide];
const max3 = mainAxisCoord - overflow[maxSide];
mainAxisCoord = clamp2(min3, mainAxisCoord, max3);
}
if (checkCrossAxis) {
const minSide = crossAxis === "y" ? "top" : "left";
const maxSide = crossAxis === "y" ? "bottom" : "right";
const min3 = crossAxisCoord + overflow[minSide];
const max3 = crossAxisCoord - overflow[maxSide];
crossAxisCoord = clamp2(min3, crossAxisCoord, max3);
}
const limitedCoords = limiter.fn({
...state,
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
});
return {
...limitedCoords,
data: {
x: limitedCoords.x - x2,
y: limitedCoords.y - y,
enabled: {
[mainAxis]: checkMainAxis,
[crossAxis]: checkCrossAxis
}
}
};
}
};
};
// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
return typeof window !== "undefined";
}
function getNodeName(node) {
if (isNode(node)) {
return (node.nodeName || "").toLowerCase();
}
return "#document";
}
function getWindow(node) {
var _node$ownerDocument;
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
var _ref;
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Node || value instanceof getWindow(value).Node;
}
function isElement2(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Element || value instanceof getWindow(value).Element;
}
function isHTMLElement2(value) {
if (!hasWindow()) {
return false;
}
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
if (!hasWindow() || typeof ShadowRoot === "undefined") {
return false;
}
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = getComputedStyle2(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
}
var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
function isTableElement(element) {
return tableElements.has(getNodeName(element));
}
var topLayerSelectors = [":popover-open", ":modal"];
function isTopLayer(element) {
return topLayerSelectors.some((selector) => {
try {
return element.matches(selector);
} catch (_e) {
return false;
}
});
}
var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
var containValues = ["paint", "layout", "strict", "content"];
function isContainingBlock(elementOrCss) {
const webkit = isWebKit();
const css = isElement2(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement2(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else if (isTopLayer(currentNode)) {
return null;
}
currentNode = getParentNode(currentNode);
}
return null;
}
function isWebKit() {
if (typeof CSS === "undefined" || !CSS.supports) return false;
return CSS.supports("-webkit-backdrop-filter", "none");
}
var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
function isLastTraversableNode(node) {
return lastTraversableNodeNames.has(getNodeName(node));
}
function getComputedStyle2(element) {
return getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
if (isElement2(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.scrollX,
scrollTop: element.scrollY
};
}
function getParentNode(node) {
if (getNodeName(node) === "html") {
return node;
}
const result = (
// Step into the shadow DOM of the parent of a slotted node.
node.assignedSlot || // DOM Element detected.
node.parentNode || // ShadowRoot detected.
isShadowRoot(node) && node.host || // Fallback.
getDocumentElement(node)
);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return node.ownerDocument ? node.ownerDocument.body : node.body;
}
if (isHTMLElement2(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = getWindow(scrollableAncestor);
if (isBody) {
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
function getCssDimensions(element) {
const css = getComputedStyle2(element);
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement2(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height,
$: shouldFallback
};
}
function unwrapElement(element) {
return !isElement2(element) ? element.contextElement : element;
}
function getScale(element) {
const domElement = unwrapElement(element);
if (!isHTMLElement2(domElement)) {
return createCoords(1);
}
const rect = domElement.getBoundingClientRect();
const {
width,
height,
$
} = getCssDimensions(domElement);
let x2 = ($ ? round(rect.width) : rect.width) / width;
let y = ($ ? round(rect.height) : rect.height) / height;
if (!x2 || !Number.isFinite(x2)) {
x2 = 1;
}
if (!y || !Number.isFinite(y)) {
y = 1;
}
return {
x: x2,
y
};
}
var noOffsets = createCoords(0);
function getVisualOffsets(element) {
const win = getWindow(element);
if (!isWebKit() || !win.visualViewport) {
return noOffsets;
}
return {
x: win.visualViewport.offsetLeft,
y: win.visualViewport.offsetTop
};
}
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
if (isFixed === void 0) {
isFixed = false;
}
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
return false;
}
return isFixed;
}
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element.getBoundingClientRect();
const domElement = unwrapElement(element);
let scale = createCoords(1);
if (includeScale) {
if (offsetParent) {
if (isElement2(offsetParent)) {
scale = getScale(offsetParent);
}
} else {
scale = getScale(element);
}
}
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
let x2 = (clientRect.left + visualOffsets.x) / scale.x;
let y = (clientRect.top + visualOffsets.y) / scale.y;
let width = clientRect.width / scale.x;
let height = clientRect.height / scale.y;
if (domElement) {
const win = getWindow(domElement);
const offsetWin = offsetParent && isElement2(offsetParent) ? getWindow(offsetParent) : offsetParent;
let currentWin = win;
let currentIFrame = getFrameElement(currentWin);
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
const iframeScale = getScale(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css = getComputedStyle2(currentIFrame);
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
x2 *= iframeScale.x;
y *= iframeScale.y;
width *= iframeScale.x;
height *= iframeScale.y;
x2 += left;
y += top;
currentWin = getWindow(currentIFrame);
currentIFrame = getFrameElement(currentWin);
}
}
return rectToClientRect({
width,
height,
x: x2,
y
});
}
function getWindowScrollBarX(element, rect) {
const leftScroll = getNodeScroll(element).scrollLeft;
if (!rect) {
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
}
return rect.left + leftScroll;
}
function getHTMLOffset(documentElement, scroll) {
const htmlRect = documentElement.getBoundingClientRect();
const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
const y = htmlRect.top + scroll.scrollTop;
return {
x: x2,
y
};
}
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
let {
elements,
rect,
offsetParent,
strategy
} = _ref;
const isFixed = strategy === "fixed";
const documentElement = getDocumentElement(offsetParent);
const topLayer = elements ? isTopLayer(elements.floating) : false;
if (offsetParent === documentElement || topLayer && isFixed) {
return rect;
}
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
let scale = createCoords(1);
const offsets = createCoords(0);
const isOffsetParentAnElement = isHTMLElement2(offsetParent);
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement2(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent);
scale = getScale(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
return {
width: rect.width * scale.x,
height: rect.height * scale.y,
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
};
}
function getClientRects(element) {
return Array.from(element.getClientRects());
}
function getDocumentRect(element) {
const html = getDocumentElement(element);
const scroll = getNodeScroll(element);
const body = element.ownerDocument.body;
const width = max2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
const height = max2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
const y = -scroll.scrollTop;
if (getComputedStyle2(body).direction === "rtl") {
x2 += max2(html.clientWidth, body.clientWidth) - width;
}
return {
width,
height,
x: x2,
y
};
}
var SCROLLBAR_MAX = 25;
function getViewportRect(element, strategy) {
const win = getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x2 = 0;
let y = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
const visualViewportBased = isWebKit();
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
x2 = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
const windowScrollbarX = getWindowScrollBarX(html);
if (windowScrollbarX <= 0) {
const doc = html.ownerDocument;
const body = doc.body;
const bodyStyles = getComputedStyle(body);
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
width -= clippingStableScrollbarWidth;
}
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
width += windowScrollbarX;
}
return {
width,
height,
x: x2,
y
};
}
var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
function getInnerBoundingClientRect(element, strategy) {
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
const top = clientRect.top + element.clientTop;
const left = clientRect.left + element.clientLeft;
const scale = isHTMLElement2(element) ? getScale(element) : createCoords(1);
const width = element.clientWidth * scale.x;
const height = element.clientHeight * scale.y;
const x2 = left * scale.x;
const y = top * scale.y;
return {
width,
height,
x: x2,
y
};
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
let rect;
if (clippingAncestor === "viewport") {
rect = getViewportRect(element, strategy);
} else if (clippingAncestor === "document") {
rect = getDocumentRect(getDocumentElement(element));
} else if (isElement2(clippingAncestor)) {
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
} else {
const visualOffsets = getVisualOffsets(element);
rect = {
x: clippingAncestor.x - visualOffsets.x,
y: clippingAncestor.y - visualOffsets.y,
width: clippingAncestor.width,
height: clippingAncestor.height
};
}
return rectToClientRect(rect);
}
function hasFixedPositionAncestor(element, stopNode) {
const parentNode = getParentNode(element);
if (parentNode === stopNode || !isElement2(parentNode) || isLastTraversableNode(parentNode)) {
return false;
}
return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
}
function getClippingElementAncestors(element, cache2) {
const cachedResult = cache2.get(element);
if (cachedResult) {
return cachedResult;
}
let result = getOverflowAncestors(element, [], false).filter((el) => isElement2(el) && getNodeName(el) !== "body");
let currentContainingBlockComputedStyle = null;
const elementIsFixed = getComputedStyle2(element).position === "fixed";
let currentNode = elementIsFixed ? getParentNode(element) : element;
while (isElement2(currentNode) && !isLastTraversableNode(currentNode)) {
const computedStyle = getComputedStyle2(currentNode);
const currentNodeIsContaining = isContainingBlock(currentNode);
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
currentContainingBlockComputedStyle = null;
}
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
if (shouldDropCurrentNode) {
result = result.filter((ancestor) => ancestor !== currentNode);
} else {
currentContainingBlockComputedStyle = computedStyle;
}
currentNode = getParentNode(currentNode);
}
cache2.set(element, result);
return result;
}
function getClippingRect(_ref) {
let {
element,
boundary,
rootBoundary,
strategy
} = _ref;
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
const firstClippingAncestor = clippingAncestors[0];
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
accRect.top = max2(rect.top, accRect.top);
accRect.right = min2(rect.right, accRect.right);
accRect.bottom = min2(rect.bottom, accRect.bottom);
accRect.left = max2(rect.left, accRect.left);
return accRect;
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
return {
width: clippingRect.right - clippingRect.left,
height: clippingRect.bottom - clippingRect.top,
x: clippingRect.left,
y: clippingRect.top
};
}
function getDimensions(element) {
const {
width,
height
} = getCssDimensions(element);
return {
width,
height
};
}
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
const isOffsetParentAnElement = isHTMLElement2(offsetParent);
const documentElement = getDocumentElement(offsetParent);
const isFixed = strategy === "fixed";
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
const offsets = createCoords(0);
function setLeftRTLScrollbarOffset() {
offsets.x = getWindowScrollBarX(documentElement);
}
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
} else if (documentElement) {
setLeftRTLScrollbarOffset();
}
}
if (isFixed && !isOffsetParentAnElement && documentElement) {
setLeftRTLScrollbarOffset();
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
return {
x: x2,
y,
width: rect.width,
height: rect.height
};
}
function isStaticPositioned(element) {
return getComputedStyle2(element).position === "static";
}
function getTrueOffsetParent(element, polyfill) {
if (!isHTMLElement2(element) || getComputedStyle2(element).position === "fixed") {
return null;
}
if (polyfill) {
return polyfill(element);
}
let rawOffsetParent = element.offsetParent;
if (getDocumentElement(element) === rawOffsetParent) {
rawOffsetParent = rawOffsetParent.ownerDocument.body;
}
return rawOffsetParent;
}
function getOffsetParent(element, polyfill) {
const win = getWindow(element);
if (isTopLayer(element)) {
return win;
}
if (!isHTMLElement2(element)) {
let svgOffsetParent = getParentNode(element);
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
if (isElement2(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
return svgOffsetParent;
}
svgOffsetParent = getParentNode(svgOffsetParent);
}
return win;
}
let offsetParent = getTrueOffsetParent(element, polyfill);
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
}
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
return win;
}
return offsetParent || getContainingBlock(element) || win;
}
var getElementRects = async function(data) {
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
const getDimensionsFn = this.getDimensions;
const floatingDimensions = await getDimensionsFn(data.floating);
return {
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
floating: {
x: 0,
y: 0,
width: floatingDimensions.width,
height: floatingDimensions.height
}
};
};
function isRTL2(element) {
return getComputedStyle2(element).direction === "rtl";
}
var platform = {
convertOffsetParentRelativeRectToViewportRelativeRect,
getDocumentElement,
getClippingRect,
getOffsetParent,
getElementRects,
getClientRects,
getDimensions,
getScale,
isElement: isElement2,
isRTL: isRTL2
};
function rectsAreEqual(a2, b2) {
return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
}
function observeMove(element, onMove) {
let io = null;
let timeoutId;
const root = getDocumentElement(element);
function cleanup() {
var _io;
clearTimeout(timeoutId);
(_io = io) == null || _io.disconnect();
io = null;
}
function refresh(skip, threshold) {
if (skip === void 0) {
skip = false;
}
if (threshold === void 0) {
threshold = 1;
}
cleanup();
const elementRectForRootMargin = element.getBoundingClientRect();
const {
left,
top,
width,
height
} = elementRectForRootMargin;
if (!skip) {
onMove();
}
if (!width || !height) {
return;
}
const insetTop = floor2(top);
const insetRight = floor2(root.clientWidth - (left + width));
const insetBottom = floor2(root.clientHeight - (top + height));
const insetLeft = floor2(left);
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
const options = {
rootMargin,
threshold: max2(0, min2(1, threshold)) || 1
};
let isFirstUpdate = true;
function handleObserve(entries) {
const ratio = entries[0].intersectionRatio;
if (ratio !== threshold) {
if (!isFirstUpdate) {
return refresh();
}
if (!ratio) {
timeoutId = setTimeout(() => {
refresh(false, 1e-7);
}, 1e3);
} else {
refresh(false, ratio);
}
}
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
refresh();
}
isFirstUpdate = false;
}
try {
io = new IntersectionObserver(handleObserve, {
...options,
// Handle