winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
793 lines • 1.14 MB
JavaScript
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
!function(e, t) {
typeof exports == "object" && typeof module != "undefined" ? module.exports = t(require("vue")) : typeof define == "function" && define.amd ? define(["vue"], t) : (e = typeof globalThis != "undefined" ? globalThis : e || self).Winbox = t(e.Vue);
}(this, function(e) {
"use strict";
const t = Object.prototype.toString;
function o(e2) {
return t.call(e2) === "[object Array]";
}
function n(e2) {
return t.call(e2) === "[object Null]";
}
function l(e2) {
return t.call(e2) === "[object Boolean]";
}
function r(e2) {
return t.call(e2) === "[object Object]";
}
const a = (e2) => t.call(e2) === "[object Promise]";
function i(e2) {
return t.call(e2) === "[object String]";
}
function s(e2) {
return t.call(e2) === "[object Number]" && e2 == e2;
}
function c(e2) {
return e2 === void 0;
}
function u(e2) {
return typeof e2 == "function";
}
function d(e2) {
return e2 === window;
}
const p = (e2) => (e2 == null ? void 0 : e2.$) !== void 0;
function m(e2) {
return r(e2) && "$y" in e2 && "$M" in e2 && "$D" in e2 && "$d" in e2 && "$H" in e2 && "$m" in e2 && "$s" in e2;
}
const f = Symbol("WinboxConfigProvider"), v = { formatYear: "YYYY \u5E74", formatMonth: "YYYY \u5E74 MM \u6708", today: "\u4ECA\u5929", view: { month: "\u6708", year: "\u5E74", week: "\u5468", day: "\u65E5" }, month: { long: { January: "\u4E00\u6708", February: "\u4E8C\u6708", March: "\u4E09\u6708", April: "\u56DB\u6708", May: "\u4E94\u6708", June: "\u516D\u6708", July: "\u4E03\u6708", August: "\u516B\u6708", September: "\u4E5D\u6708", October: "\u5341\u6708", November: "\u5341\u4E00\u6708", December: "\u5341\u4E8C\u6708" }, short: { January: "\u4E00\u6708", February: "\u4E8C\u6708", March: "\u4E09\u6708", April: "\u56DB\u6708", May: "\u4E94\u6708", June: "\u516D\u6708", July: "\u4E03\u6708", August: "\u516B\u6708", September: "\u4E5D\u6708", October: "\u5341\u6708", November: "\u5341\u4E00\u6708", December: "\u5341\u4E8C\u6708" } }, week: { long: { self: "\u5468", monday: "\u5468\u4E00", tuesday: "\u5468\u4E8C", wednesday: "\u5468\u4E09", thursday: "\u5468\u56DB", friday: "\u5468\u4E94", saturday: "\u5468\u516D", sunday: "\u5468\u65E5" }, short: { self: "\u5468", monday: "\u4E00", tuesday: "\u4E8C", wednesday: "\u4E09", thursday: "\u56DB", friday: "\u4E94", saturday: "\u516D", sunday: "\u65E5" } } }, h = { locale: "zh-CN", empty: { description: "\u6682\u65E0\u6570\u636E" }, drawer: { okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, popconfirm: { okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, modal: { okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, pagination: { goto: "\u524D\u5F80", page: "\u9875", countPerPage: "\u6761/\u9875", total: "\u5171 {0} \u6761" }, table: { okText: "\u786E\u5B9A", resetText: "\u91CD\u7F6E" }, upload: { start: "\u5F00\u59CB", cancel: "\u53D6\u6D88", delete: "\u5220\u9664", retry: "\u70B9\u51FB\u91CD\u8BD5", buttonText: "\u70B9\u51FB\u4E0A\u4F20", preview: "\u9884\u89C8", drag: "\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20", dragHover: "\u91CA\u653E\u6587\u4EF6\u5E76\u5F00\u59CB\u4E0A\u4F20", error: "\u4E0A\u4F20\u5931\u8D25" }, datePicker: { view: v.view, month: v.month, week: v.week, placeholder: { date: "\u8BF7\u9009\u62E9\u65E5\u671F", week: "\u8BF7\u9009\u62E9\u5468", month: "\u8BF7\u9009\u62E9\u6708\u4EFD", year: "\u8BF7\u9009\u62E9\u5E74\u4EFD", quarter: "\u8BF7\u9009\u62E9\u5B63\u5EA6", time: "\u8BF7\u9009\u62E9\u65F6\u95F4" }, rangePlaceholder: { date: ["\u5F00\u59CB\u65E5\u671F", "\u7ED3\u675F\u65E5\u671F"], week: ["\u5F00\u59CB\u5468", "\u7ED3\u675F\u5468"], month: ["\u5F00\u59CB\u6708\u4EFD", "\u7ED3\u675F\u6708\u4EFD"], year: ["\u5F00\u59CB\u5E74\u4EFD", "\u7ED3\u675F\u5E74\u4EFD"], quarter: ["\u5F00\u59CB\u5B63\u5EA6", "\u7ED3\u675F\u5B63\u5EA6"], time: ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"] }, selectTime: "\u9009\u62E9\u65F6\u95F4", today: "\u4ECA\u5929", now: "\u6B64\u523B", ok: "\u786E\u5B9A" }, image: { loading: "\u52A0\u8F7D\u4E2D" }, imagePreview: { fullScreen: "\u5168\u5C4F", rotateRight: "\u5411\u53F3\u65CB\u8F6C", rotateLeft: "\u5411\u5DE6\u65CB\u8F6C", zoomIn: "\u653E\u5927", zoomOut: "\u7F29\u5C0F", originalSize: "\u539F\u59CB\u5C3A\u5BF8" }, typography: { copied: "\u5DF2\u590D\u5236", copy: "\u590D\u5236", expand: "\u5C55\u5F00", collapse: "\u6298\u53E0", edit: "\u7F16\u8F91" }, colorPicker: { undo: "\u64A4\u9500", redo: "\u91CD\u505A", confirm: "\u786E\u8BA4", clear: "\u6E05\u9664" } }, g = e.ref("zh-CN"), y = e.reactive({ "zh-CN": h }), b = () => {
const t2 = e.inject(f, void 0), o2 = e.computed(() => {
var _a2;
return (_a2 = t2 == null ? void 0 : t2.locale) != null ? _a2 : y[g.value];
});
return { locale: e.computed(() => o2.value.locale), t: (e2, ...t3) => {
const n2 = e2.split(".");
let l2 = o2.value;
for (const t4 of n2) {
if (!l2[t4])
return e2;
l2 = l2[t4];
}
return i(l2) && t3.length > 0 ? l2.replace(/{(\d+)}/g, (e3, o3) => {
var _a2;
return (_a2 = t3[o3]) != null ? _a2 : e3;
}) : l2;
} };
}, C = (e2) => {
var _a2;
return (_a2 = e2 == null ? void 0 : e2.componentPrefix) != null ? _a2 : "W";
}, k = (e2, t2) => {
var _a2;
t2 && t2.classPrefix && (e2.config.globalProperties.$w = __spreadProps(__spreadValues({}, (_a2 = e2.config.globalProperties.$w) != null ? _a2 : {}), { classPrefix: t2.classPrefix }));
}, x = (t2) => {
var _a2, _b2, _c2, _d2;
const o2 = e.getCurrentInstance(), n2 = (_d2 = (_c2 = (_a2 = e.inject(f, void 0)) == null ? void 0 : _a2.prefixCls) != null ? _c2 : (_b2 = o2 == null ? void 0 : o2.appContext.config.globalProperties.$w) == null ? void 0 : _b2.classPrefix) != null ? _d2 : "w";
return t2 ? `${n2}-${t2}` : n2;
};
var w = function() {
if (typeof Map != "undefined")
return Map;
function e2(e3, t2) {
var o2 = -1;
return e3.some(function(e4, n2) {
return e4[0] === t2 && (o2 = n2, true);
}), o2;
}
return function() {
function t2() {
this.__entries__ = [];
}
return Object.defineProperty(t2.prototype, "size", { get: function() {
return this.__entries__.length;
}, enumerable: true, configurable: true }), t2.prototype.get = function(t3) {
var o2 = e2(this.__entries__, t3), n2 = this.__entries__[o2];
return n2 && n2[1];
}, t2.prototype.set = function(t3, o2) {
var n2 = e2(this.__entries__, t3);
~n2 ? this.__entries__[n2][1] = o2 : this.__entries__.push([t3, o2]);
}, t2.prototype.delete = function(t3) {
var o2 = this.__entries__, n2 = e2(o2, t3);
~n2 && o2.splice(n2, 1);
}, t2.prototype.has = function(t3) {
return !!~e2(this.__entries__, t3);
}, t2.prototype.clear = function() {
this.__entries__.splice(0);
}, t2.prototype.forEach = function(e3, t3) {
t3 === void 0 && (t3 = null);
for (var o2 = 0, n2 = this.__entries__; o2 < n2.length; o2++) {
var l2 = n2[o2];
e3.call(t3, l2[1], l2[0]);
}
}, t2;
}();
}(), S = typeof window != "undefined" && typeof document != "undefined" && window.document === document, V = typeof global != "undefined" && global.Math === Math ? global : typeof self != "undefined" && self.Math === Math ? self : typeof window != "undefined" && window.Math === Math ? window : Function("return this")(), N = typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(V) : function(e2) {
return setTimeout(function() {
return e2(Date.now());
}, 1e3 / 60);
};
var B = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], $ = typeof MutationObserver != "undefined", z = function() {
function e2() {
this.connected_ = false, this.mutationEventsAdded_ = false, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = function(e3, t2) {
var o2 = false, n2 = false, l2 = 0;
function r2() {
o2 && (o2 = false, e3()), n2 && i2();
}
function a2() {
N(r2);
}
function i2() {
var e4 = Date.now();
if (o2) {
if (e4 - l2 < 2)
return;
n2 = true;
} else
o2 = true, n2 = false, setTimeout(a2, t2);
l2 = e4;
}
return i2;
}(this.refresh.bind(this), 20);
}
return e2.prototype.addObserver = function(e3) {
~this.observers_.indexOf(e3) || this.observers_.push(e3), this.connected_ || this.connect_();
}, e2.prototype.removeObserver = function(e3) {
var t2 = this.observers_, o2 = t2.indexOf(e3);
~o2 && t2.splice(o2, 1), !t2.length && this.connected_ && this.disconnect_();
}, e2.prototype.refresh = function() {
this.updateObservers_() && this.refresh();
}, e2.prototype.updateObservers_ = function() {
var e3 = this.observers_.filter(function(e4) {
return e4.gatherActive(), e4.hasActive();
});
return e3.forEach(function(e4) {
return e4.broadcastActive();
}), e3.length > 0;
}, e2.prototype.connect_ = function() {
S && !this.connected_ && (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), $ ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = true), this.connected_ = true);
}, e2.prototype.disconnect_ = function() {
S && this.connected_ && (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = false, this.connected_ = false);
}, e2.prototype.onTransitionEnd_ = function(e3) {
var t2 = e3.propertyName, o2 = t2 === void 0 ? "" : t2;
B.some(function(e4) {
return !!~o2.indexOf(e4);
}) && this.refresh();
}, e2.getInstance = function() {
return this.instance_ || (this.instance_ = new e2()), this.instance_;
}, e2.instance_ = null, e2;
}(), P = function(e2, t2) {
for (var o2 = 0, n2 = Object.keys(t2); o2 < n2.length; o2++) {
var l2 = n2[o2];
Object.defineProperty(e2, l2, { value: t2[l2], enumerable: false, writable: false, configurable: true });
}
return e2;
}, E = function(e2) {
return e2 && e2.ownerDocument && e2.ownerDocument.defaultView || V;
}, O = A(0, 0, 0, 0);
function L(e2) {
return parseFloat(e2) || 0;
}
function j(e2) {
for (var t2 = [], o2 = 1; o2 < arguments.length; o2++)
t2[o2 - 1] = arguments[o2];
return t2.reduce(function(t3, o3) {
return t3 + L(e2["border-" + o3 + "-width"]);
}, 0);
}
function I(e2) {
var t2 = e2.clientWidth, o2 = e2.clientHeight;
if (!t2 && !o2)
return O;
var n2 = E(e2).getComputedStyle(e2), l2 = function(e3) {
for (var t3 = {}, o3 = 0, n3 = ["top", "right", "bottom", "left"]; o3 < n3.length; o3++) {
var l3 = n3[o3], r3 = e3["padding-" + l3];
t3[l3] = L(r3);
}
return t3;
}(n2), r2 = l2.left + l2.right, a2 = l2.top + l2.bottom, i2 = L(n2.width), s2 = L(n2.height);
if (n2.boxSizing === "border-box" && (Math.round(i2 + r2) !== t2 && (i2 -= j(n2, "left", "right") + r2), Math.round(s2 + a2) !== o2 && (s2 -= j(n2, "top", "bottom") + a2)), !function(e3) {
return e3 === E(e3).document.documentElement;
}(e2)) {
var c2 = Math.round(i2 + r2) - t2, u2 = Math.round(s2 + a2) - o2;
Math.abs(c2) !== 1 && (i2 -= c2), Math.abs(u2) !== 1 && (s2 -= u2);
}
return A(l2.left, l2.top, i2, s2);
}
var M = typeof SVGGraphicsElement != "undefined" ? function(e2) {
return e2 instanceof E(e2).SVGGraphicsElement;
} : function(e2) {
return e2 instanceof E(e2).SVGElement && typeof e2.getBBox == "function";
};
function T(e2) {
return S ? M(e2) ? function(e3) {
var t2 = e3.getBBox();
return A(0, 0, t2.width, t2.height);
}(e2) : I(e2) : O;
}
function A(e2, t2, o2, n2) {
return { x: e2, y: t2, width: o2, height: n2 };
}
var R = function() {
function e2(e3) {
this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = A(0, 0, 0, 0), this.target = e3;
}
return e2.prototype.isActive = function() {
var e3 = T(this.target);
return this.contentRect_ = e3, e3.width !== this.broadcastWidth || e3.height !== this.broadcastHeight;
}, e2.prototype.broadcastRect = function() {
var e3 = this.contentRect_;
return this.broadcastWidth = e3.width, this.broadcastHeight = e3.height, e3;
}, e2;
}(), D = function(e2, t2) {
var o2, n2, l2, r2, a2, i2, s2, c2 = (n2 = (o2 = t2).x, l2 = o2.y, r2 = o2.width, a2 = o2.height, i2 = typeof DOMRectReadOnly != "undefined" ? DOMRectReadOnly : Object, s2 = Object.create(i2.prototype), P(s2, { x: n2, y: l2, width: r2, height: a2, top: l2, right: n2 + r2, bottom: a2 + l2, left: n2 }), s2);
P(this, { target: e2, contentRect: c2 });
}, F = function() {
function e2(e3, t2, o2) {
if (this.activeObservations_ = [], this.observations_ = new w(), typeof e3 != "function")
throw new TypeError("The callback provided as parameter 1 is not a function.");
this.callback_ = e3, this.controller_ = t2, this.callbackCtx_ = o2;
}
return e2.prototype.observe = function(e3) {
if (!arguments.length)
throw new TypeError("1 argument required, but only 0 present.");
if (typeof Element != "undefined" && Element instanceof Object) {
if (!(e3 instanceof E(e3).Element))
throw new TypeError('parameter 1 is not of type "Element".');
var t2 = this.observations_;
t2.has(e3) || (t2.set(e3, new R(e3)), this.controller_.addObserver(this), this.controller_.refresh());
}
}, e2.prototype.unobserve = function(e3) {
if (!arguments.length)
throw new TypeError("1 argument required, but only 0 present.");
if (typeof Element != "undefined" && Element instanceof Object) {
if (!(e3 instanceof E(e3).Element))
throw new TypeError('parameter 1 is not of type "Element".');
var t2 = this.observations_;
t2.has(e3) && (t2.delete(e3), t2.size || this.controller_.removeObserver(this));
}
}, e2.prototype.disconnect = function() {
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
}, e2.prototype.gatherActive = function() {
var e3 = this;
this.clearActive(), this.observations_.forEach(function(t2) {
t2.isActive() && e3.activeObservations_.push(t2);
});
}, e2.prototype.broadcastActive = function() {
if (this.hasActive()) {
var e3 = this.callbackCtx_, t2 = this.activeObservations_.map(function(e4) {
return new D(e4.target, e4.broadcastRect());
});
this.callback_.call(e3, t2, e3), this.clearActive();
}
}, e2.prototype.clearActive = function() {
this.activeObservations_.splice(0);
}, e2.prototype.hasActive = function() {
return this.activeObservations_.length > 0;
}, e2;
}(), W = typeof WeakMap != "undefined" ? new WeakMap() : new w(), H = function e2(t2) {
if (!(this instanceof e2))
throw new TypeError("Cannot call a class as a function.");
if (!arguments.length)
throw new TypeError("1 argument required, but only 0 present.");
var o2 = z.getInstance(), n2 = new F(t2, o2, this);
W.set(this, n2);
};
["observe", "unobserve", "disconnect"].forEach(function(e2) {
H.prototype[e2] = function() {
var t2;
return (t2 = W.get(this))[e2].apply(t2, arguments);
};
});
var K = V.ResizeObserver !== void 0 ? V.ResizeObserver : H;
var _, q, U, Z;
(q = _ || (_ = {}))[q.ELEMENT = 1] = "ELEMENT", q[q.FUNCTIONAL_COMPONENT = 2] = "FUNCTIONAL_COMPONENT", q[q.STATEFUL_COMPONENT = 4] = "STATEFUL_COMPONENT", q[q.COMPONENT = 6] = "COMPONENT", q[q.TEXT_CHILDREN = 8] = "TEXT_CHILDREN", q[q.ARRAY_CHILDREN = 16] = "ARRAY_CHILDREN", q[q.SLOTS_CHILDREN = 32] = "SLOTS_CHILDREN", q[q.TELEPORT = 64] = "TELEPORT", q[q.SUSPENSE = 128] = "SUSPENSE", q[q.COMPONENT_SHOULD_KEEP_ALIVE = 256] = "COMPONENT_SHOULD_KEEP_ALIVE", q[q.COMPONENT_KEPT_ALIVE = 512] = "COMPONENT_KEPT_ALIVE", (Z = U || (U = {}))[Z.TEXT = 1] = "TEXT", Z[Z.CLASS = 2] = "CLASS", Z[Z.STYLE = 4] = "STYLE", Z[Z.PROPS = 8] = "PROPS", Z[Z.FULL_PROPS = 16] = "FULL_PROPS", Z[Z.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", Z[Z.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", Z[Z.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", Z[Z.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", Z[Z.NEED_PATCH = 512] = "NEED_PATCH", Z[Z.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", Z[Z.DEV_ROOT_FRAGMENT = 2048] = "DEV_ROOT_FRAGMENT", Z[Z.HOISTED = -1] = "HOISTED", Z[Z.BAIL = -2] = "BAIL";
const Y = (e2, t2, o2) => (o2 == null ? void 0 : o2[e2]) ? o2[e2] : (t2 == null ? void 0 : t2[e2]) ? () => t2[e2] : void 0, X = (e2) => Boolean(e2 && 1 & e2.shapeFlag), G = (e2, t2) => Boolean(e2 && 6 & e2.shapeFlag), J = (e2, t2) => G(e2, e2.type) && e2.type.name === t2, Q = (e2, t2) => Boolean(e2 && 16 & e2.shapeFlag), ee = (e2, t2) => Boolean(e2 && 32 & e2.shapeFlag), te = (e2) => {
var _a2, _b2;
if (e2)
for (const t2 of e2) {
if (X(t2) || G(t2))
return t2;
if (Q(t2, t2.children)) {
const e3 = te(t2.children);
if (e3)
return e3;
} else if (ee(t2, t2.children)) {
const e3 = (_b2 = (_a2 = t2.children).default) == null ? void 0 : _b2.call(_a2);
if (e3) {
const t3 = te(e3);
if (t3)
return t3;
}
} else if (o(t2)) {
const e3 = te(t2);
if (e3)
return e3;
}
}
}, oe = (e2, t2) => {
let o2 = 0;
for (const n2 of e2)
G(n2, n2.type) && n2.type.name === t2 ? o2++ : Q(n2, n2.children) && (o2 += oe(n2.children, t2));
return o2;
}, ne = (t2, o2, n2, l2 = 0) => {
var _a2, _b2, _c2;
const r2 = [];
for (const a2 of t2)
if (J(a2, o2))
if (n2) {
const t3 = l2 + r2.length, o3 = u(n2) ? n2(a2, t3) : n2;
r2.push(e.cloneVNode(a2, o3, true));
} else
r2.push(a2);
else if (Q(a2, a2.children))
r2.push(...ne(a2.children, o2, n2, r2.length));
else if (ee(a2, a2.children)) {
const e2 = (_c2 = (_b2 = (_a2 = a2.children).default) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : [];
r2.push(...ne(e2, o2, n2, r2.length));
}
return r2;
}, le = (t2, o2) => {
if (t2 && t2.length > 0)
for (let n2 = 0; n2 < t2.length; n2++) {
const l2 = t2[n2];
if (X(l2) || G(l2)) {
const r3 = u(o2) ? o2(l2) : o2;
return t2[n2] = e.cloneVNode(l2, r3, true), true;
}
const r2 = re(l2);
if (r2 && r2.length > 0) {
if (le(r2, o2))
return true;
}
}
return false;
}, re = (e2) => Q(e2, e2.children) ? e2.children : o(e2) ? e2 : void 0, ae = (e2) => {
var _a2, _b2;
if (X(e2))
return e2.el;
if (!G(e2)) {
const t2 = re(e2);
return ie(t2);
}
if (((_a2 = e2.el) == null ? void 0 : _a2.nodeType) === 1)
return e2.el;
if ((_b2 = e2.component) == null ? void 0 : _b2.subTree) {
const t2 = ae(e2.component.subTree);
if (t2)
return t2;
}
}, ie = (e2) => {
if (e2 && e2.length > 0)
for (const t2 of e2) {
const e3 = ae(t2);
if (e3)
return e3;
}
}, se = (e2, t2 = false) => {
var _a2, _b2;
const n2 = [];
for (const r2 of e2 != null ? e2 : [])
X(r2) || G(r2) || t2 && (l2 = r2, r2.children, Boolean(l2 && 8 & l2.shapeFlag)) ? n2.push(r2) : Q(r2, r2.children) ? n2.push(...se(r2.children, t2)) : ee(r2, r2.children) ? n2.push(...se((_b2 = (_a2 = r2.children).default) == null ? void 0 : _b2.call(_a2), t2)) : o(r2) && n2.push(...se(r2, t2));
var l2;
return n2;
};
const ce = (e2) => {
if (e2)
return u(e2) ? e2 : () => e2;
}, ue = (e2, t2) => {
var _a2;
const o2 = [];
if (G(e2, e2.type))
e2.type.name === t2 ? e2.component && o2.push(e2.component.uid) : ((_a2 = e2.component) == null ? void 0 : _a2.subTree) && o2.push(...ue(e2.component.subTree, t2));
else {
const n2 = re(e2);
n2 && o2.push(...de(n2, t2));
}
return o2;
}, de = (e2, t2) => {
const o2 = [];
if (e2 && e2.length > 0)
for (const n2 of e2)
o2.push(...ue(n2, t2));
return o2;
};
var pe = e.defineComponent({ name: "ResizeObserver", emits: ["resize"], setup(t2, { emit: o2, slots: n2 }) {
let l2;
const r2 = e.ref(), a2 = e.computed(() => p(r2.value) ? r2.value.$el : r2.value), i2 = (e2) => {
e2 && (l2 = new K((e3) => {
const t3 = e3[0];
o2("resize", t3);
}), l2.observe(e2));
}, s2 = () => {
l2 && (l2.disconnect(), l2 = null);
};
return e.watch(a2, (e2) => {
l2 && s2(), e2 && i2(e2);
}), e.onMounted(() => {
a2.value && i2(a2.value);
}), e.onUnmounted(() => {
s2();
}), () => {
var _a2, _b2;
const t3 = te((_b2 = (_a2 = n2.default) == null ? void 0 : _a2.call(n2)) != null ? _b2 : []);
return t3 ? e.cloneVNode(t3, { ref: r2 }, true) : null;
};
} });
const me = typeof window == "undefined" ? global : window, fe = me.requestAnimationFrame, ve = me.cancelAnimationFrame;
function he(e2) {
let t2 = 0;
const o2 = (...o3) => {
t2 && ve(t2), t2 = fe(() => {
e2(...o3), t2 = 0;
});
};
return o2.cancel = () => {
ve(t2), t2 = 0;
}, o2;
}
const ge = () => {
}, ye = (() => {
try {
return !(typeof window != "undefined" && document !== void 0);
} catch (e2) {
return true;
}
})(), be = ye ? ge : (e2, t2, o2, n2 = false) => {
e2.addEventListener(t2, o2, n2);
}, Ce = ye ? ge : (e2, t2, o2, n2 = false) => {
e2.removeEventListener(t2, o2, n2);
}, ke = (e2) => {
const t2 = document.createElement("div");
return t2.setAttribute("class", `w-overlay w-overlay-${e2}`), t2;
}, xe = (e2, t2) => {
var _a2;
if (!ye)
return (_a2 = (t2 != null ? t2 : document).querySelector(e2)) != null ? _a2 : void 0;
}, we = (e2, t2) => {
if (i(e2)) {
const o2 = e2[0] === "#" ? `[id='${e2.slice(1)}']` : e2;
return xe(o2, t2);
}
return e2;
}, Se = (e2, t2) => {
const o2 = e2.getBoundingClientRect(), n2 = t2.getBoundingClientRect();
return { top: o2.top - n2.top, bottom: n2.bottom - o2.bottom, left: o2.left - n2.left, right: n2.right - o2.right, width: o2.width, height: o2.height };
};
var Ve = (e2, t2) => {
for (const [o2, n2] of t2)
e2[o2] = n2;
return e2;
};
const Ne = e.defineComponent({ name: "Affix", components: { ResizeObserver: pe }, props: { offsetTop: { type: Number, default: 0 }, offsetBottom: { type: Number }, target: { type: [String, Object, Function] }, targetContainer: { type: [String, Object, Function] }, onChange: { type: [Function, Array] } }, emits: ["change"], setup(t2, { emit: o2 }) {
const n2 = x("affix"), { target: l2, targetContainer: r2 } = e.toRefs(t2), a2 = e.ref(), i2 = e.ref(), s2 = e.ref(false), u2 = e.ref({}), p2 = e.ref({}), m2 = e.computed(() => ({ [n2]: s2.value })), f2 = he(() => {
if (!a2.value || !i2.value)
return;
const { offsetTop: e2, offsetBottom: n3 } = t2, l3 = c(n3) ? "top" : "bottom", r3 = a2.value.getBoundingClientRect(), m3 = function(e3) {
return d(e3) ? { top: 0, bottom: window.innerHeight } : e3.getBoundingClientRect();
}(i2.value);
let f3 = false, v2 = {};
const h2 = { width: `${a2.value.offsetWidth}px`, height: `${a2.value.offsetHeight}px` };
l3 === "top" ? (f3 = r3.top - m3.top < (e2 || 0), v2 = f3 ? { position: "fixed", top: `${m3.top + (e2 || 0)}px` } : {}) : (f3 = m3.bottom - r3.bottom < (n3 || 0), v2 = f3 ? { position: "fixed", bottom: `${window.innerHeight - m3.bottom + (n3 || 0)}px` } : {}), f3 !== s2.value && (s2.value = f3, o2("change", f3)), u2.value = h2, p2.value = __spreadValues(__spreadValues({}, v2), f3 ? h2 : {});
});
return e.watchEffect((e2) => {
const t3 = l2 && l2.value !== window && we(l2.value) || window;
i2.value = t3, t3 && (be(t3, "scroll", f2), be(t3, "resize", f2), e2(() => {
Ce(t3, "scroll", f2), Ce(t3, "resize", f2);
}));
}), e.watchEffect((e2) => {
if (!i2.value)
return;
const t3 = r2 && r2.value !== window && we(r2.value) || window;
t3 && (be(t3, "scroll", f2), be(t3, "resize", f2), e2(() => {
Ce(t3, "scroll", f2), Ce(t3, "resize", f2);
}));
}), { wrapperRef: a2, isFixed: s2, classNames: m2, placeholderStyles: u2, fixedStyles: p2, updatePositionThrottle: f2 };
}, methods: { updatePosition() {
this.updatePositionThrottle();
} } }), Be = { ref: "wrapperRef" };
var $e = Ve(Ne, [["render", function(t2, o2, n2, l2, r2, a2) {
const i2 = e.resolveComponent("ResizeObserver");
return e.openBlock(), e.createBlock(i2, { onResize: t2.updatePositionThrottle }, { default: e.withCtx(() => [e.createElementVNode("div", Be, [t2.isFixed ? (e.openBlock(), e.createElementBlock("div", { key: 0, style: e.normalizeStyle(t2.placeholderStyles) }, null, 4)) : e.createCommentVNode("v-if", true), e.createElementVNode("div", { class: e.normalizeClass(t2.classNames), style: e.normalizeStyle(t2.fixedStyles) }, [e.createVNode(i2, { onResize: t2.updatePositionThrottle }, { default: e.withCtx(() => [e.renderSlot(t2.$slots, "default")]), _: 3 }, 8, ["onResize"])], 6)], 512)]), _: 3 }, 8, ["onResize"]);
}]]);
const ze = Object.assign($e, { install: (e2, t2) => {
k(e2, t2);
const o2 = C(t2);
e2.component(o2 + $e.name, $e);
} }), Pe = ["normal", "success", "warning", "danger"], Ee = ["info", "success", "warning", "error"], Oe = ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"], Le = ["hover", "click", "focus", "contextMenu"], je = ["onFocus", "onFocusin", "onFocusout", "onBlur", "onChange", "onBeforeinput", "onInput", "onReset", "onSubmit", "onInvalid", "onKeydown", "onKeypress", "onKeyup", "onCopy", "onCut", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onSelect", "autocomplete", "autofocus", "maxlength", "minlength", "name", "pattern", "readonly", "required"], Ie = e.defineComponent({ name: "IconClose", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (e2) => ["butt", "round", "square"].includes(e2) }, strokeLinejoin: { type: String, default: "miter", validator: (e2) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e2) }, spin: Boolean }, setup(t2) {
const o2 = x("icon");
return { cls: e.computed(() => [o2, `${o2}-close`, { [`${o2}-spin`]: t2.spin }]), innerStyle: e.computed(() => {
if (t2.size)
return { fontSize: s(t2.size) ? `${t2.size}px` : t2.size };
}) };
} }), Me = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Te = [e.createElementVNode("path", { d: "M9.857 9.858 24 24m0 0 14.142 14.142M24 24 38.142 9.858M24 24 9.857 38.142" }, null, -1)];
var Ae = Ve(Ie, [["render", function(t2, o2, n2, l2, r2, a2) {
return e.openBlock(), e.createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: e.normalizeClass(t2.cls), style: e.normalizeStyle(t2.innerStyle), "stroke-width": t2.strokeWidth, "stroke-linecap": t2.strokeLinecap, "stroke-linejoin": t2.strokeLinejoin }, Te, 14, Me);
}]]);
const Re = Object.assign(Ae, { install: (e2, t2) => {
var _a2;
const o2 = (_a2 = t2 == null ? void 0 : t2.iconPrefix) != null ? _a2 : "";
e2.component(o2 + Ae.name, Ae);
} }), De = e.defineComponent({ name: "IconInfoCircleFill", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (e2) => ["butt", "round", "square"].includes(e2) }, strokeLinejoin: { type: String, default: "miter", validator: (e2) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e2) }, spin: Boolean }, setup(t2) {
const o2 = x("icon");
return { cls: e.computed(() => [o2, `${o2}-info-circle-fill`, { [`${o2}-spin`]: t2.spin }]), innerStyle: e.computed(() => {
if (t2.size)
return { fontSize: s(t2.size) ? `${t2.size}px` : t2.size };
}) };
} }), Fe = ["stroke-width", "stroke-linecap", "stroke-linejoin"], We = [e.createElementVNode("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z", fill: "currentColor", stroke: "none" }, null, -1)];
var He = Ve(De, [["render", function(t2, o2, n2, l2, r2, a2) {
return e.openBlock(), e.createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: e.normalizeClass(t2.cls), style: e.normalizeStyle(t2.innerStyle), "stroke-width": t2.strokeWidth, "stroke-linecap": t2.strokeLinecap, "stroke-linejoin": t2.strokeLinejoin }, We, 14, Fe);
}]]);
const Ke = Object.assign(He, { install: (e2, t2) => {
var _a2;
const o2 = (_a2 = t2 == null ? void 0 : t2.iconPrefix) != null ? _a2 : "";
e2.component(o2 + He.name, He);
} }), _e = e.defineComponent({ name: "IconCheckCircleFill", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (e2) => ["butt", "round", "square"].includes(e2) }, strokeLinejoin: { type: String, default: "miter", validator: (e2) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e2) }, spin: Boolean }, setup(t2) {
const o2 = x("icon");
return { cls: e.computed(() => [o2, `${o2}-check-circle-fill`, { [`${o2}-spin`]: t2.spin }]), innerStyle: e.computed(() => {
if (t2.size)
return { fontSize: s(t2.size) ? `${t2.size}px` : t2.size };
}) };
} }), qe = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Ue = [e.createElementVNode("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z", fill: "currentColor", stroke: "none" }, null, -1)];
var Ze = Ve(_e, [["render", function(t2, o2, n2, l2, r2, a2) {
return e.openBlock(), e.createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: e.normalizeClass(t2.cls), style: e.normalizeStyle(t2.innerStyle), "stroke-width": t2.strokeWidth, "stroke-linecap": t2.strokeLinecap, "stroke-linejoin": t2.strokeLinejoin }, Ue, 14, qe);
}]]);
const Ye = Object.assign(Ze, { install: (e2, t2) => {
var _a2;
const o2 = (_a2 = t2 == null ? void 0 : t2.iconPrefix) != null ? _a2 : "";
e2.component(o2 + Ze.name, Ze);
} }), Xe = e.defineComponent({ name: "IconExclamationCircleFill", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (e2) => ["butt", "round", "square"].includes(e2) }, strokeLinejoin: { type: String, default: "miter", validator: (e2) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e2) }, spin: Boolean }, setup(t2) {
const o2 = x("icon");
return { cls: e.computed(() => [o2, `${o2}-exclamation-circle-fill`, { [`${o2}-spin`]: t2.spin }]), innerStyle: e.computed(() => {
if (t2.size)
return { fontSize: s(t2.size) ? `${t2.size}px` : t2.size };
}) };
} }), Ge = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Je = [e.createElementVNode("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z", fill: "currentColor", stroke: "none" }, null, -1)];
var Qe = Ve(Xe, [["render", function(t2, o2, n2, l2, r2, a2) {
return e.openBlock(), e.createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: e.normalizeClass(t2.cls), style: e.normalizeStyle(t2.innerStyle), "stroke-width": t2.strokeWidth, "stroke-linecap": t2.strokeLinecap, "stroke-linejoin": t2.strokeLinejoin }, Je, 14, Ge);
}]]);
const et = Object.assign(Qe, { install: (e2, t2) => {
var _a2;
const o2 = (_a2 = t2 == null ? void 0 : t2.iconPrefix) != null ? _a2 : "";
e2.component(o2 + Qe.name, Qe);
} }), tt = e.defineComponent({ name: "IconCloseCircleFill", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (e2) => ["butt", "round", "square"].includes(e2) }, strokeLinejoin: { type: String, default: "miter", validator: (e2) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e2) }, spin: Boolean }, setup(t2) {
const o2 = x("icon");
return { cls: e.computed(() => [o2, `${o2}-close-circle-fill`, { [`${o2}-spin`]: t2.spin }]), innerStyle: e.computed(() => {
if (t2.size)
return { fontSize: s(t2.size) ? `${t2.size}px` : t2.size };
}) };
} }), ot = ["stroke-width", "stroke-linecap", "stroke-linejoin"], nt = [e.createElementVNode("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z", fill: "currentColor", stroke: "none" }, null, -1)];
var lt = Ve(tt, [["render", function(t2, o2, n2, l2, r2, a2) {
return e.openBlock(), e.createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: e.normalizeClass(t2.cls), style: e.normalizeStyle(t2.innerStyle), "stroke-width": t2.strokeWidth, "stroke-linecap": t2.strokeLinecap, "stroke-linejoin": t2.strokeLinejoin }, nt, 14, ot);
}]]);
const rt = Object.assign(lt, { install: (e2, t2) => {
var _a2;
const o2 = (_a2 = t2 == null ? void 0 : t2.iconPrefix) != null ? _a2 : "";
e2.component(o2 + lt.name, lt);
} });
var at = Ve(e.defineComponent({ name: "Alert", components: { IconClose: Re, IconInfoCircleFill: Ke, IconCheckCircleFill: Ye, IconExclamationCircleFill: et, IconCloseCircleFill: rt }, props: { type: { type: String, default: "info", validator: (e2) => Ee.includes(e2) }, showIcon: { type: Boolean, default: false }, closable: { type: Boolean, default: false }, title: String, banner: { type: Boolean, default: false }, onClose: { type: Function }, onAfterClose: { type: Function } }, emits: ["close", "afterClose"], setup(t2, { slots: o2, emit: n2 }) {
const l2 = x("alert"), r2 = e.ref(true), a2 = e.computed(() => [l2, `${l2}-${t2.type}`, { [`${l2}-with-title`]: Boolean(t2.title || o2.title), [`${l2}-banner`]: t2.banner }]);
return { prefixCls: l2, cls: a2, visible: r2, handleClose: () => {
r2.value = false, n2("close");
}, handleAfterLeave: () => {
n2("afterClose");
} };
} }), [["render", function(t2, o2, n2, l2, r2, a2) {
const i2 = e.resolveComponent("icon-info-circle-fill"), s2 = e.resolveComponent("icon-check-circle-fill"), c2 = e.resolveComponent("icon-exclamation-circle-fill"), u2 = e.resolveComponent("icon-close-circle-fill"), d2 = e.resolveComponent("icon-close");
return e.openBlock(), e.createBlock(e.Transition, { name: "zoom-in-top", onAfterLeave: t2.handleAfterLeave }, { default: e.withCtx(() => [t2.visible ? (e.openBlock(), e.createElementBlock("div", { key: 0, class: e.normalizeClass(t2.cls) }, [t2.showIcon ? (e.openBlock(), e.createElementBlock("div", { key: 0, class: e.normalizeClass(`${t2.prefixCls}-icon`) }, [e.renderSlot(t2.$slots, "icon", {}, () => [t2.type === "info" ? (e.openBlock(), e.createBlock(i2, { key: 0 })) : t2.type === "success" ? (e.openBlock(), e.createBlock(s2, { key: 1 })) : t2.type === "warning" ? (e.openBlock(), e.createBlock(c2, { key: 2 })) : t2.type === "error" ? (e.openBlock(), e.createBlock(u2, { key: 3 })) : e.createCommentVNode("v-if", true)])], 2)) : e.createCommentVNode("v-if", true), e.createElementVNode("div", { class: e.normalizeClass(`${t2.prefixCls}-body`) }, [t2.title || t2.$slots.title ? (e.openBlock(), e.createElementBlock("div", { key: 0, class: e.normalizeClass(`${t2.prefixCls}-title`) }, [e.renderSlot(t2.$slots, "title", {}, () => [e.createTextVNode(e.toDisplayString(t2.title), 1)])], 2)) : e.createCommentVNode("v-if", true), e.createElementVNode("div", { class: e.normalizeClass(`${t2.prefixCls}-content`) }, [e.renderSlot(t2.$slots, "default")], 2)], 2), t2.$slots.action ? (e.openBlock(), e.createElementBlock("div", { key: 1, class: e.normalizeClass(`${t2.prefixCls}-action`) }, [e.renderSlot(t2.$slots, "action")], 2)) : e.createCommentVNode("v-if", true), t2.closable ? (e.openBlock(), e.createElementBlock("div", { key: 2, class: e.normalizeClass(`${t2.prefixCls}-close-btn`), onClick: o2[0] || (o2[0] = (...e2) => t2.handleClose && t2.handleClose(...e2)) }, [e.createVNode(d2)], 2)) : e.createCommentVNode("v-if", true)], 2)) : e.createCommentVNode("v-if", true)]), _: 3 }, 8, ["onAfterLeave"]);
}]]);
const it = Object.assign(at, { install: (e2, t2) => {
k(e2, t2);
const o2 = C(t2);
e2.component(o2 + at.name, at);
} });
function st(e2) {
return typeof e2 == "object" && e2 != null && e2.nodeType === 1;
}
function ct(e2, t2) {
return (!t2 || e2 !== "hidden") && e2 !== "visible" && e2 !== "clip";
}
function ut(e2, t2) {
if (e2.clientHeight < e2.scrollHeight || e2.clientWidth < e2.scrollWidth) {
var o2 = getComputedStyle(e2, null);
return ct(o2.overflowY, t2) || ct(o2.overflowX, t2) || function(e3) {
var t3 = function(e4) {
if (!e4.ownerDocument || !e4.ownerDocument.defaultView)
return null;
try {
return e4.ownerDocument.defaultView.frameElement;
} catch (e5) {
return null;
}
}(e3);
return !!t3 && (t3.clientHeight < e3.scrollHeight || t3.clientWidth < e3.scrollWidth);
}(e2);
}
return false;
}
function dt(e2, t2, o2, n2, l2, r2, a2, i2) {
return r2 < e2 && a2 > t2 || r2 > e2 && a2 < t2 ? 0 : r2 <= e2 && i2 <= o2 || a2 >= t2 && i2 >= o2 ? r2 - e2 - n2 : a2 > t2 && i2 < o2 || r2 < e2 && i2 > o2 ? a2 - t2 + l2 : 0;
}
function pt(e2, t2) {
var o2 = window, n2 = t2.scrollMode, l2 = t2.block, r2 = t2.inline, a2 = t2.boundary, i2 = t2.skipOverflowHiddenElements, s2 = typeof a2 == "function" ? a2 : function(e3) {
return e3 !== a2;
};
if (!st(e2))
throw new TypeError("Invalid target");
for (var c2 = document.scrollingElement || document.documentElement, u2 = [], d2 = e2; st(d2) && s2(d2); ) {
if ((d2 = d2.parentElement) === c2) {
u2.push(d2);
break;
}
d2 != null && d2 === document.body && ut(d2) && !ut(document.documentElement) || d2 != null && ut(d2, i2) && u2.push(d2);
}
for (var p2 = o2.visualViewport ? o2.visualViewport.width : innerWidth, m2 = o2.visualViewport ? o2.visualViewport.height : innerHeight, f2 = window.scrollX || pageXOffset, v2 = window.scrollY || pageYOffset, h2 = e2.getBoundingClientRect(), g2 = h2.height, y2 = h2.width, b2 = h2.top, C2 = h2.right, k2 = h2.bottom, x2 = h2.left, w2 = l2 === "start" || l2 === "nearest" ? b2 : l2 === "end" ? k2 : b2 + g2 / 2, S2 = r2 === "center" ? x2 + y2 / 2 : r2 === "end" ? C2 : x2, V2 = [], N2 = 0; N2 < u2.length; N2++) {
var B2 = u2[N2], $2 = B2.getBoundingClientRect(), z2 = $2.height, P2 = $2.width, E2 = $2.top, O2 = $2.right, L2 = $2.bottom, j2 = $2.left;
if (n2 === "if-needed" && b2 >= 0 && x2 >= 0 && k2 <= m2 && C2 <= p2 && b2 >= E2 && k2 <= L2 && x2 >= j2 && C2 <= O2)
return V2;
var I2 = getComputedStyle(B2), M2 = parseInt(I2.borderLeftWidth, 10), T2 = parseInt(I2.borderTopWidth, 10), A2 = parseInt(I2.borderRightWidth, 10), R2 = parseInt(I2.borderBottomWidth, 10), D2 = 0, F2 = 0, W2 = "offsetWidth" in B2 ? B2.offsetWidth - B2.clientWidth - M2 - A2 : 0, H2 = "offsetHeight" in B2 ? B2.offsetHeight - B2.clientHeight - T2 - R2 : 0;
if (c2 === B2)
D2 = l2 === "start" ? w2 : l2 === "end" ? w2 - m2 : l2 === "nearest" ? dt(v2, v2 + m2, m2, T2, R2, v2 + w2, v2 + w2 + g2, g2) : w2 - m2 / 2, F2 = r2 === "start" ? S2 : r2 === "center" ? S2 - p2 / 2 : r2 === "end" ? S2 - p2 : dt(f2, f2 + p2, p2, M2, A2, f2 + S2, f2 + S2 + y2, y2), D2 = Math.max(0, D2 + v2), F2 = Math.max(0, F2 + f2);
else {
D2 = l2 === "start" ? w2 - E2 - T2 : l2 === "end" ? w2 - L2 + R2 + H2 : l2 === "nearest" ? dt(E2, L2, z2, T2, R2 + H2, w2, w2 + g2, g2) : w2 - (E2 + z2 / 2) + H2 / 2, F2 = r2 === "start" ? S2 - j2 - M2 : r2 === "center" ? S2 - (j2 + P2 / 2) + W2 / 2 : r2 === "end" ? S2 - O2 + A2 + W2 : dt(j2, O2, P2, M2, A2 + W2, S2, S2 + y2, y2);
var K2 = B2.scrollLeft, _2 = B2.scrollTop;
w2 += _2 - (D2 = Math.max(0, Math.min(_2 + D2, B2.scrollHeight - z2 + H2))), S2 += K2 - (F2 = Math.max(0, Math.min(K2 + F2, B2.scrollWidth - P2 + W2)));
}
V2.push({ el: B2, top: D2, left: F2 });
}
return V2;
}
var mt = function(e2) {
return function(t2) {
return Math.pow(t2, e2);
};
}, ft = function(e2) {
return function(t2) {
return 1 - Math.abs(Math.pow(t2 - 1, e2));
};
}, vt = function(e2) {
return function(t2) {
return t2 < 0.5 ? mt(e2)(2 * t2) / 2 : ft(e2)(2 * t2 - 1) / 2 + 0.5;
};
}, ht = mt(2), gt = ft(2), yt = vt(2), bt = mt(3), Ct = ft(3), kt = vt(3), xt = mt(4), wt = ft(4), St = vt(4), Vt = mt(5), Nt = ft(5), Bt = vt(5), $t = function(e2) {
var t2 = 7.5625, o2 = 2.75;
return e2 < 1 / o2 ? t2 * e2 * e2 : e2 < 2 / o2 ? t2 * (e2 -= 1.5 / o2) * e2 + 0.75 : e2 < 2.5 / o2 ? t2 * (e2 -= 2.25 / o2) * e2 + 0.9375 : t2 * (e2 -= 2.625 / o2) * e2 + 0.984375;
}, zt = function(e2) {
return 1 - $t(1 - e2);
}, Pt = Object.freeze({ linear: function(e2) {
return e2;
}, quadIn: ht, quadOut: gt, quadInOut: yt, cubicIn: bt, cubicOut: Ct, cubicInOut: kt, quartIn: xt, quartOut: wt, quartInOut: St, quintIn: Vt, quintOut: Nt, quintInOut: Bt, sineIn: function(e2) {
return 1 + Math.sin(Math.PI / 2 * e2 - Math.PI / 2);
}, sineOut: function(e2) {
return Math.sin(Math.PI / 2 * e2);
}, sineInOut: function(e2) {
return (1 + Math.sin(Math.PI * e2 - Math.PI / 2)) / 2;
}, bounceOut: $t, bounceIn: zt, bounceInOut: function(e2) {
return e2 < 0.5 ? 0.5 * zt(2 * e2) : 0.5 * $t(2 * e2 - 1) + 0.5;
} }), Et = function(e2) {
var t2 = e2.from, o2 = e2.to, n2 = e2.duration, l2 = e2.delay, r2 = e2.easing, a2 = e2.onStart, i2 = e2.onUpdate, s2 = e2.onFinish;
for (var c2 in t2)
o2[c2] === void 0 && (o2[c2] = t2[c2]);
for (var u2 in o2)
t2[u2] === void 0 && (t2[u2] = o2[u2]);
this.from = t2, this.to = o2, this.duration = n2 || 500, this.delay = l2 || 0, this.easing = r2 || "linear", this.onStart = a2, this.onUpdate = i2 || function() {
}, this.onFinish = s2, this.startTime = Date.now() + this.delay, this.started = false, this.finished = false, this.timer = null, this.keys = {};
};
Et.prototype.update = function() {
if (this.time = Date.now(), !(this.time < this.startTime || this.finished))
if (this.elapsed !== this.duration) {
for (var e2 in this.elapsed = this.time - this.startTime, this.elapsed = this.elapsed > this.duration ? this.duration : this.elapsed, this.to)
this.keys[e2] = this.from[e2] + (this.to[e2] - this.from[e2]) * Pt[this.easing](this.elapsed / this.duration);
this.started || (this.onStart && this.onStart(this.keys), this.started = true), this.onUpdate(this.keys);
} else
this.finished || (this.finished = true, this.onFinish && this.onFinish(this.keys));
}, Et.prototype.start = function() {
var e2 = this;
this.startTime = Date.now() + this.delay;
var t2 = function() {
e2.update(), e2.timer = requestAnimationFrame(t2), e2.finished && (cancelAnimationFrame(e2.timer), e2.timer = null);
};
t2();
}, Et.prototype.stop = function() {
cancelAnimationFrame(this.timer), this.timer = null;
};
const Ot = Symbol("WinboxAnchor"), Lt = ["start", "end", "center", "nearest"], jt = e.defineComponent({ name: "Anchor", props: { boundary: { type: [Number, String], default: "start", validator: (e2) => s(e2) || Lt.includes(e2) }, lineLess: { type: Boolean, default: false }, scrollContainer: { type: [String, Object] }, changeHash: { type: Boolean, default: true }, smooth: { type: Boolean, default: true } }, emits: ["select", "change"], setup(t2, { emit: o2 }) {
const n2 = x("anchor"), l2 = e.ref(), r2 = e.ref(), a2 = e.reactive({}), i2 = e.ref(""), c2 = e.ref(false), p2 = e.ref(), m2 = e.ref(), f2 = (e2) => {
try {
const o3 = we(e2);
if (!o3)
return;
let n3, l3 = 0;
s(t2.boundary) ? (n3 = "start", l3 = t2.boundary) : n3 = t2.boundary;
const r3 = pt(o3, { block: n3 });
if (!r3.length)
return;
const { el: a3, top: i3 } = r3[0];
!function(e3, t3, o4) {
new Et({ from: { scrollTop: e3.scrollTop }, to: { scrollTop: t3 }, easing: "quartOut", duration: 300, onUpdate: (t4) => {
e3.scrollTop = t4.scrollTop;
}, onFinish: () => {
u(o4) && o4();
} }).start();
}(a3, i3 - l3, () => {
c2.value = false;
}), c2.value = true;
} catch (e3) {
console.error(e3);
}
}, v2 = he(() => {
if (c2.value)
return;
const e2 = g2();
if (e2 && e2.id) {
const t3 = `#${e2.id}`;
h2(t3);
}
}), h2 = (t3) => {
if (!a2[t3] && l2.value) {
const e2 = we(`a[data-href='${t3}']`, l2.value);
if (!e2)
return;
a2[t3] = e2;
}
t3 !== i2.value && (i2.value = t3, e.nextTick(() => {
o2("change", t3);
}));
}, g2 = () => {
if (!p2.value || !m2.value)
return;
const e2 = s(t2.boundary) ? t2.boundary : 0, o3 = m2.value.getBoundingClientRect();
for (const t3 of Object.keys(a2)) {
const n3 = we(t3);
if (n3) {
const { top: t4 } = n3.getBoundingClientRect(), l3 = d(p2.value) ? t4 - e2 : t4 - o3.top - e2;
if (l3 >= 0 && l3 <= o3.height / 2)
return n3;
}
}
};
e.watch(i2, () => {
const e2 = a2[i2.value];
!t2.lineLess && e2 && r2.value && (r2.value.style.top = `${e2.offsetTop}px`);
});
e.onMounted(() => {
t2.scrollContainer ? (p2.value = d(t2.scrollContainer) ? window : we(t2.scrollContainer), m2.value = d(t2.scrollContainer) ? document.documentElement : we(t2.scrollContainer)) : (p2.value = window, m2.value = document.documentElement);
const e2 = decodeURIComponent(window.location.hash);
e2 ? (f2(e2), h2(e2)) : v2(), p2.value && be(p2.value, "scroll", v2);
}), e.onBeforeUnmount(() => {
p2.value && Ce(p2.value, "scroll", v2);
}), e.provide(Ot, e.reactive({ currentLink: i2, addLink: (e2, t3) => {
e2 && (a2[e2] = t3);
}, removeLink: (e2) => {
delete a2[e2];
}, handleClick: (e2, n3) => {
t2.changeHash || e2.preventDefault(), n3 && (f2(n3), h2(n3)), o2(