smart-chat-asp
Version:
smartChat component
1,825 lines (1,823 loc) • 3.71 MB
JavaScript
import { ref as le, readonly as Jo, watch as Kt, computed as ee, getCurrentInstance as ri, onMounted as jn, onBeforeUnmount as ar, onBeforeMount as ca, reactive as vd, inject as rt, onActivated as cI, onDeactivated as tv, createTextVNode as Jn, Fragment as rn, Comment as Xp, defineComponent as Pe, provide as Pt, withDirectives as Ar, toRef as nt, h as N, Teleport as Zp, nextTick as yn, renderSlot as na, mergeProps as Bo, isVNode as y6, shallowRef as Jp, watchEffect as On, Transition as uo, TransitionGroup as dI, vShow as Lo, cloneVNode as nv, Text as uI, markRaw as ta, onUnmounted as Pl, normalizeClass as rr, openBlock as je, createElementBlock as zt, createVNode as ft, unref as Ee, withCtx as wt, toDisplayString as dn, createBlock as kt, useAttrs as T6, effectScope as rv, toRaw as ka, hasInjectionContext as x6, isRef as _s, isReactive as em, getCurrentScope as pI, onScopeDispose as mI, toRefs as S1, createElementVNode as lt, createCommentVNode as un, renderList as bs, onUpdated as R6, resolveDynamicComponent as vr, normalizeStyle as zb, createStaticVNode as fI, defineAsyncComponent as A6, useSlots as O6 } from "vue";
function w6(e) {
let t = ".", n = "__", r = "--", o;
if (e) {
let _ = e.blockPrefix;
_ && (t = _), _ = e.elementPrefix, _ && (n = _), _ = e.modifierPrefix, _ && (r = _);
}
const i = {
install(_) {
o = _.c;
const S = _.context;
S.bem = {}, S.bem.b = null, S.bem.els = null;
}
};
function a(_) {
let S, b;
return {
before(E) {
S = E.bem.b, b = E.bem.els, E.bem.els = null;
},
after(E) {
E.bem.b = S, E.bem.els = b;
},
$({ context: E, props: C }) {
return _ = typeof _ == "string" ? _ : _({ context: E, props: C }), E.bem.b = _, `${(C == null ? void 0 : C.bPrefix) || t}${E.bem.b}`;
}
};
}
function s(_) {
let S;
return {
before(b) {
S = b.bem.els;
},
after(b) {
b.bem.els = S;
},
$({ context: b, props: E }) {
return _ = typeof _ == "string" ? _ : _({ context: b, props: E }), b.bem.els = _.split(",").map((C) => C.trim()), b.bem.els.map((C) => `${(E == null ? void 0 : E.bPrefix) || t}${b.bem.b}${n}${C}`).join(", ");
}
};
}
function l(_) {
return {
$({ context: S, props: b }) {
_ = typeof _ == "string" ? _ : _({ context: S, props: b });
const E = _.split(",").map((O) => O.trim());
function C(O) {
return E.map((I) => `&${(b == null ? void 0 : b.bPrefix) || t}${S.bem.b}${O !== void 0 ? `${n}${O}` : ""}${r}${I}`).join(", ");
}
const R = S.bem.els;
if (R !== null) {
if (process.env.NODE_ENV !== "production" && R.length >= 2)
throw Error(`[css-render/plugin-bem]: m(${_}) is invalid, using modifier inside multiple elements is not allowed`);
return C(R[0]);
} else
return C();
}
};
}
function c(_) {
return {
$({ context: S, props: b }) {
_ = typeof _ == "string" ? _ : _({ context: S, props: b });
const E = S.bem.els;
if (process.env.NODE_ENV !== "production" && E !== null && E.length >= 2)
throw Error(`[css-render/plugin-bem]: notM(${_}) is invalid, using modifier inside multiple elements is not allowed`);
return `&:not(${(b == null ? void 0 : b.bPrefix) || t}${S.bem.b}${E !== null && E.length > 0 ? `${n}${E[0]}` : ""}${r}${_})`;
}
};
}
return Object.assign(i, {
cB: (..._) => o(a(_[0]), _[1], _[2]),
cE: (..._) => o(s(_[0]), _[1], _[2]),
cM: (..._) => o(l(_[0]), _[1], _[2]),
cNotM: (..._) => o(c(_[0]), _[1], _[2])
}), i;
}
function N6(e) {
let t = 0;
for (let n = 0; n < e.length; ++n)
e[n] === "&" && ++t;
return t;
}
const hI = /\s*,(?![^(]*\))\s*/g, I6 = /\s+/g;
function D6(e, t) {
const n = [];
return t.split(hI).forEach((r) => {
let o = N6(r);
if (o) {
if (o === 1) {
e.forEach((a) => {
n.push(r.replace("&", a));
});
return;
}
} else {
e.forEach((a) => {
n.push(
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(a && a + " ") + r
);
});
return;
}
let i = [
r
];
for (; o--; ) {
const a = [];
i.forEach((s) => {
e.forEach((l) => {
a.push(s.replace("&", l));
});
}), i = a;
}
i.forEach((a) => n.push(a));
}), n;
}
function k6(e, t) {
const n = [];
return t.split(hI).forEach((r) => {
e.forEach((o) => {
n.push((o && o + " ") + r);
});
}), n;
}
function M6(e) {
let t = [""];
return e.forEach((n) => {
n = n && n.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
n && (n.includes("&") ? t = D6(t, n) : t = k6(t, n));
}), t.join(", ").replace(I6, " ");
}
function v1(e) {
if (!e)
return;
const t = e.parentElement;
t && t.removeChild(e);
}
function tm(e, t) {
return (t ?? document.head).querySelector(`style[cssr-id="${e}"]`);
}
function L6(e) {
const t = document.createElement("style");
return t.setAttribute("cssr-id", e), t;
}
function jd(e) {
return e ? /^\s*@(s|m)/.test(e) : !1;
}
const P6 = /[A-Z]/g;
function gI(e) {
return e.replace(P6, (t) => "-" + t.toLowerCase());
}
function F6(e, t = " ") {
return typeof e == "object" && e !== null ? ` {
` + Object.entries(e).map((n) => t + ` ${gI(n[0])}: ${n[1]};`).join(`
`) + `
` + t + "}" : `: ${e};`;
}
function B6(e, t, n) {
return typeof e == "function" ? e({
context: t.context,
props: n
}) : e;
}
function E1(e, t, n, r) {
if (!t)
return "";
const o = B6(t, n, r);
if (!o)
return "";
if (typeof o == "string")
return `${e} {
${o}
}`;
const i = Object.keys(o);
if (i.length === 0)
return n.config.keepEmptyBlock ? e + ` {
}` : "";
const a = e ? [
e + " {"
] : [];
return i.forEach((s) => {
const l = o[s];
if (s === "raw") {
a.push(`
` + l + `
`);
return;
}
s = gI(s), l != null && a.push(` ${s}${F6(l)}`);
}), e && a.push("}"), a.join(`
`);
}
function $b(e, t, n) {
e && e.forEach((r) => {
if (Array.isArray(r))
$b(r, t, n);
else if (typeof r == "function") {
const o = r(t);
Array.isArray(o) ? $b(o, t, n) : o && n(o);
} else
r && n(r);
});
}
function _I(e, t, n, r, o) {
const i = e.$;
let a = "";
if (!i || typeof i == "string")
jd(i) ? a = i : t.push(i);
else if (typeof i == "function") {
const c = i({
context: r.context,
props: o
});
jd(c) ? a = c : t.push(c);
} else if (i.before && i.before(r.context), !i.$ || typeof i.$ == "string")
jd(i.$) ? a = i.$ : t.push(i.$);
else if (i.$) {
const c = i.$({
context: r.context,
props: o
});
jd(c) ? a = c : t.push(c);
}
const s = M6(t), l = E1(s, e.props, r, o);
a ? n.push(`${a} {`) : l.length && n.push(l), e.children && $b(e.children, {
context: r.context,
props: o
}, (c) => {
if (typeof c == "string") {
const d = E1(s, { raw: c }, r, o);
n.push(d);
} else
_I(c, t, n, r, o);
}), t.pop(), a && n.push("}"), i && i.after && i.after(r.context);
}
function U6(e, t, n) {
const r = [];
return _I(e, [], r, t, n), r.join(`
`);
}
function jc(e) {
for (var t = 0, n, r = 0, o = e.length; o >= 4; ++r, o -= 4)
n = e.charCodeAt(r) & 255 | (e.charCodeAt(++r) & 255) << 8 | (e.charCodeAt(++r) & 255) << 16 | (e.charCodeAt(++r) & 255) << 24, n = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
n >>> 24, t = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
switch (o) {
case 3:
t ^= (e.charCodeAt(r + 2) & 255) << 16;
case 2:
t ^= (e.charCodeAt(r + 1) & 255) << 8;
case 1:
t ^= e.charCodeAt(r) & 255, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
}
return t ^= t >>> 13, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
typeof window < "u" && (window.__cssrContext = {});
function z6(e, t, n, r) {
const { els: o } = t;
if (n === void 0)
o.forEach(v1), t.els = [];
else {
const i = tm(n, r);
i && o.includes(i) && (v1(i), t.els = o.filter((a) => a !== i));
}
}
function C1(e, t) {
e.push(t);
}
function $6(e, t, n, r, o, i, a, s, l) {
let c;
if (n === void 0 && (c = t.render(r), n = jc(c)), l) {
l.adapter(n, c ?? t.render(r));
return;
}
s === void 0 && (s = document.head);
const d = tm(n, s);
if (d !== null && !i)
return d;
const m = d ?? L6(n);
if (c === void 0 && (c = t.render(r)), m.textContent = c, d !== null)
return d;
if (a) {
const f = s.querySelector(`meta[name="${a}"]`);
if (f)
return s.insertBefore(m, f), C1(t.els, m), m;
}
return o ? s.insertBefore(m, s.querySelector("style, link")) : s.appendChild(m), C1(t.els, m), m;
}
function H6(e) {
return U6(this, this.instance, e);
}
function G6(e = {}) {
const { id: t, ssr: n, props: r, head: o = !1, force: i = !1, anchorMetaName: a, parent: s } = e;
return $6(this.instance, this, t, r, o, i, a, s, n);
}
function q6(e = {}) {
const { id: t, parent: n } = e;
z6(this.instance, this, t, n);
}
const Xd = function(e, t, n, r) {
return {
instance: e,
$: t,
props: n,
children: r,
els: [],
render: H6,
mount: G6,
unmount: q6
};
}, Y6 = function(e, t, n, r) {
return Array.isArray(t) ? Xd(e, { $: null }, null, t) : Array.isArray(n) ? Xd(e, t, null, n) : Array.isArray(r) ? Xd(e, t, n, r) : Xd(e, t, n, null);
};
function bI(e = {}) {
const t = {
c: (...n) => Y6(t, ...n),
use: (n, ...r) => n.install(t, ...r),
find: tm,
context: {},
config: e
};
return t;
}
function V6(e, t) {
if (e === void 0)
return !1;
if (t) {
const { context: { ids: n } } = t;
return n.has(e);
}
return tm(e) !== null;
}
const W6 = "n", Xc = `.${W6}-`, K6 = "__", Q6 = "--", SI = bI(), vI = w6({
blockPrefix: Xc,
elementPrefix: K6,
modifierPrefix: Q6
});
SI.use(vI);
const {
c: me,
find: bnt
} = SI, {
cB: Z,
cE: ue,
cM: pe,
cNotM: Cn
} = vI;
function Fl(e) {
return me(({
props: {
bPrefix: t
}
}) => `${t || Xc}modal, ${t || Xc}drawer`, [e]);
}
function Ed(e) {
return me(({
props: {
bPrefix: t
}
}) => `${t || Xc}popover`, [e]);
}
function EI(e) {
return me(({
props: {
bPrefix: t
}
}) => `&${t || Xc}modal`, e);
}
const j6 = (...e) => me(">", [Z(...e)]);
function Qe(e, t) {
return e + (t === "default" ? "" : t.replace(/^[a-z]/, (n) => n.toUpperCase()));
}
let op = [];
const CI = /* @__PURE__ */ new WeakMap();
function X6() {
op.forEach((e) => e(...CI.get(e))), op = [];
}
function ip(e, ...t) {
CI.set(e, t), !op.includes(e) && op.push(e) === 1 && requestAnimationFrame(X6);
}
function Po(e, t) {
let { target: n } = e;
for (; n; ) {
if (n.dataset && n.dataset[t] !== void 0)
return !0;
n = n.parentElement;
}
return !1;
}
function Ss(e) {
return e.composedPath()[0] || null;
}
function ei(e) {
return typeof e == "string" ? e.endsWith("px") ? Number(e.slice(0, e.length - 2)) : Number(e) : e;
}
function Rr(e) {
if (e != null)
return typeof e == "number" ? `${e}px` : e.endsWith("px") ? e : `${e}px`;
}
function gr(e, t) {
const n = e.trim().split(/\s+/g), r = {
top: n[0]
};
switch (n.length) {
case 1:
r.right = n[0], r.bottom = n[0], r.left = n[0];
break;
case 2:
r.right = n[1], r.left = n[1], r.bottom = n[0];
break;
case 3:
r.right = n[1], r.bottom = n[2], r.left = n[1];
break;
case 4:
r.right = n[1], r.bottom = n[2], r.left = n[3];
break;
default:
throw new Error("[seemly/getMargin]:" + e + " is not a valid value.");
}
return t === void 0 ? r : r[t];
}
function Z6(e, t) {
const [n, r] = e.split(" ");
return t ? t === "row" ? n : r : {
row: n,
col: r || n
};
}
const y1 = {
aliceblue: "#F0F8FF",
antiquewhite: "#FAEBD7",
aqua: "#0FF",
aquamarine: "#7FFFD4",
azure: "#F0FFFF",
beige: "#F5F5DC",
bisque: "#FFE4C4",
black: "#000",
blanchedalmond: "#FFEBCD",
blue: "#00F",
blueviolet: "#8A2BE2",
brown: "#A52A2A",
burlywood: "#DEB887",
cadetblue: "#5F9EA0",
chartreuse: "#7FFF00",
chocolate: "#D2691E",
coral: "#FF7F50",
cornflowerblue: "#6495ED",
cornsilk: "#FFF8DC",
crimson: "#DC143C",
cyan: "#0FF",
darkblue: "#00008B",
darkcyan: "#008B8B",
darkgoldenrod: "#B8860B",
darkgray: "#A9A9A9",
darkgrey: "#A9A9A9",
darkgreen: "#006400",
darkkhaki: "#BDB76B",
darkmagenta: "#8B008B",
darkolivegreen: "#556B2F",
darkorange: "#FF8C00",
darkorchid: "#9932CC",
darkred: "#8B0000",
darksalmon: "#E9967A",
darkseagreen: "#8FBC8F",
darkslateblue: "#483D8B",
darkslategray: "#2F4F4F",
darkslategrey: "#2F4F4F",
darkturquoise: "#00CED1",
darkviolet: "#9400D3",
deeppink: "#FF1493",
deepskyblue: "#00BFFF",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1E90FF",
firebrick: "#B22222",
floralwhite: "#FFFAF0",
forestgreen: "#228B22",
fuchsia: "#F0F",
gainsboro: "#DCDCDC",
ghostwhite: "#F8F8FF",
gold: "#FFD700",
goldenrod: "#DAA520",
gray: "#808080",
grey: "#808080",
green: "#008000",
greenyellow: "#ADFF2F",
honeydew: "#F0FFF0",
hotpink: "#FF69B4",
indianred: "#CD5C5C",
indigo: "#4B0082",
ivory: "#FFFFF0",
khaki: "#F0E68C",
lavender: "#E6E6FA",
lavenderblush: "#FFF0F5",
lawngreen: "#7CFC00",
lemonchiffon: "#FFFACD",
lightblue: "#ADD8E6",
lightcoral: "#F08080",
lightcyan: "#E0FFFF",
lightgoldenrodyellow: "#FAFAD2",
lightgray: "#D3D3D3",
lightgrey: "#D3D3D3",
lightgreen: "#90EE90",
lightpink: "#FFB6C1",
lightsalmon: "#FFA07A",
lightseagreen: "#20B2AA",
lightskyblue: "#87CEFA",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#B0C4DE",
lightyellow: "#FFFFE0",
lime: "#0F0",
limegreen: "#32CD32",
linen: "#FAF0E6",
magenta: "#F0F",
maroon: "#800000",
mediumaquamarine: "#66CDAA",
mediumblue: "#0000CD",
mediumorchid: "#BA55D3",
mediumpurple: "#9370DB",
mediumseagreen: "#3CB371",
mediumslateblue: "#7B68EE",
mediumspringgreen: "#00FA9A",
mediumturquoise: "#48D1CC",
mediumvioletred: "#C71585",
midnightblue: "#191970",
mintcream: "#F5FFFA",
mistyrose: "#FFE4E1",
moccasin: "#FFE4B5",
navajowhite: "#FFDEAD",
navy: "#000080",
oldlace: "#FDF5E6",
olive: "#808000",
olivedrab: "#6B8E23",
orange: "#FFA500",
orangered: "#FF4500",
orchid: "#DA70D6",
palegoldenrod: "#EEE8AA",
palegreen: "#98FB98",
paleturquoise: "#AFEEEE",
palevioletred: "#DB7093",
papayawhip: "#FFEFD5",
peachpuff: "#FFDAB9",
peru: "#CD853F",
pink: "#FFC0CB",
plum: "#DDA0DD",
powderblue: "#B0E0E6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#F00",
rosybrown: "#BC8F8F",
royalblue: "#4169E1",
saddlebrown: "#8B4513",
salmon: "#FA8072",
sandybrown: "#F4A460",
seagreen: "#2E8B57",
seashell: "#FFF5EE",
sienna: "#A0522D",
silver: "#C0C0C0",
skyblue: "#87CEEB",
slateblue: "#6A5ACD",
slategray: "#708090",
slategrey: "#708090",
snow: "#FFFAFA",
springgreen: "#00FF7F",
steelblue: "#4682B4",
tan: "#D2B48C",
teal: "#008080",
thistle: "#D8BFD8",
tomato: "#FF6347",
turquoise: "#40E0D0",
violet: "#EE82EE",
wheat: "#F5DEB3",
white: "#FFF",
whitesmoke: "#F5F5F5",
yellow: "#FF0",
yellowgreen: "#9ACD32",
transparent: "#0000"
};
function J6(e, t, n) {
t /= 100, n /= 100;
let r = (o, i = (o + e / 60) % 6) => n - n * t * Math.max(Math.min(i, 4 - i, 1), 0);
return [r(5) * 255, r(3) * 255, r(1) * 255];
}
function eF(e, t, n) {
t /= 100, n /= 100;
let r = t * Math.min(n, 1 - n), o = (i, a = (i + e / 30) % 12) => n - r * Math.max(Math.min(a - 3, 9 - a, 1), -1);
return [o(0) * 255, o(8) * 255, o(4) * 255];
}
const Mi = "^\\s*", Li = "\\s*$", Ma = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*", bo = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", is = "([0-9A-Fa-f])", as = "([0-9A-Fa-f]{2})", yI = new RegExp(`${Mi}hsl\\s*\\(${bo},${Ma},${Ma}\\)${Li}`), TI = new RegExp(`${Mi}hsv\\s*\\(${bo},${Ma},${Ma}\\)${Li}`), xI = new RegExp(`${Mi}hsla\\s*\\(${bo},${Ma},${Ma},${bo}\\)${Li}`), RI = new RegExp(`${Mi}hsva\\s*\\(${bo},${Ma},${Ma},${bo}\\)${Li}`), tF = new RegExp(`${Mi}rgb\\s*\\(${bo},${bo},${bo}\\)${Li}`), nF = new RegExp(`${Mi}rgba\\s*\\(${bo},${bo},${bo},${bo}\\)${Li}`), rF = new RegExp(`${Mi}#${is}${is}${is}${Li}`), oF = new RegExp(`${Mi}#${as}${as}${as}${Li}`), iF = new RegExp(`${Mi}#${is}${is}${is}${is}${Li}`), aF = new RegExp(`${Mi}#${as}${as}${as}${as}${Li}`);
function eo(e) {
return parseInt(e, 16);
}
function sF(e) {
try {
let t;
if (t = xI.exec(e))
return [
ap(t[1]),
xa(t[5]),
xa(t[9]),
us(t[13])
];
if (t = yI.exec(e))
return [ap(t[1]), xa(t[5]), xa(t[9]), 1];
throw new Error(`[seemly/hsla]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function lF(e) {
try {
let t;
if (t = RI.exec(e))
return [
ap(t[1]),
xa(t[5]),
xa(t[9]),
us(t[13])
];
if (t = TI.exec(e))
return [ap(t[1]), xa(t[5]), xa(t[9]), 1];
throw new Error(`[seemly/hsva]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function aa(e) {
try {
let t;
if (t = oF.exec(e))
return [eo(t[1]), eo(t[2]), eo(t[3]), 1];
if (t = tF.exec(e))
return [Lr(t[1]), Lr(t[5]), Lr(t[9]), 1];
if (t = nF.exec(e))
return [
Lr(t[1]),
Lr(t[5]),
Lr(t[9]),
us(t[13])
];
if (t = rF.exec(e))
return [
eo(t[1] + t[1]),
eo(t[2] + t[2]),
eo(t[3] + t[3]),
1
];
if (t = aF.exec(e))
return [
eo(t[1]),
eo(t[2]),
eo(t[3]),
us(eo(t[4]) / 255)
];
if (t = iF.exec(e))
return [
eo(t[1] + t[1]),
eo(t[2] + t[2]),
eo(t[3] + t[3]),
us(eo(t[4] + t[4]) / 255)
];
if (e in y1)
return aa(y1[e]);
if (yI.test(e) || xI.test(e)) {
const [n, r, o, i] = sF(e);
return [...eF(n, r, o), i];
} else if (TI.test(e) || RI.test(e)) {
const [n, r, o, i] = lF(e);
return [...J6(n, r, o), i];
}
throw new Error(`[seemly/rgba]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function cF(e) {
return e > 1 ? 1 : e < 0 ? 0 : e;
}
function Hb(e, t, n, r) {
return `rgba(${Lr(e)}, ${Lr(t)}, ${Lr(n)}, ${cF(r)})`;
}
function qf(e, t, n, r, o) {
return Lr((e * t * (1 - r) + n * r) / o);
}
function Et(e, t) {
Array.isArray(e) || (e = aa(e)), Array.isArray(t) || (t = aa(t));
const n = e[3], r = t[3], o = us(n + r - n * r);
return Hb(qf(e[0], n, t[0], r, o), qf(e[1], n, t[1], r, o), qf(e[2], n, t[2], r, o), o);
}
function Ke(e, t) {
const [n, r, o, i = 1] = Array.isArray(e) ? e : aa(e);
return typeof t.alpha == "number" ? Hb(n, r, o, t.alpha) : Hb(n, r, o, i);
}
function or(e, t) {
const [n, r, o, i = 1] = Array.isArray(e) ? e : aa(e), { lightness: a = 1, alpha: s = 1 } = t;
return dF([n * a, r * a, o * a, i * s]);
}
function us(e) {
const t = Math.round(Number(e) * 100) / 100;
return t > 1 ? 1 : t < 0 ? 0 : t;
}
function ap(e) {
const t = Math.round(Number(e));
return t >= 360 || t < 0 ? 0 : t;
}
function Lr(e) {
const t = Math.round(Number(e));
return t > 255 ? 255 : t < 0 ? 0 : t;
}
function xa(e) {
const t = Math.round(Number(e));
return t > 100 ? 100 : t < 0 ? 0 : t;
}
function dF(e) {
const [t, n, r] = e;
return 3 in e ? `rgba(${Lr(t)}, ${Lr(n)}, ${Lr(r)}, ${us(e[3])})` : `rgba(${Lr(t)}, ${Lr(n)}, ${Lr(r)}, 1)`;
}
function Bl(e = 8) {
return Math.random().toString(16).slice(2, 2 + e);
}
function uF(e, t) {
const n = [];
for (let r = 0; r < e; ++r)
n.push(t);
return n;
}
function Du(e) {
return e.composedPath()[0];
}
const pF = {
mousemoveoutside: /* @__PURE__ */ new WeakMap(),
clickoutside: /* @__PURE__ */ new WeakMap()
};
function mF(e, t, n) {
if (e === "mousemoveoutside") {
const r = (o) => {
t.contains(Du(o)) || n(o);
};
return {
mousemove: r,
touchstart: r
};
} else if (e === "clickoutside") {
let r = !1;
const o = (a) => {
r = !t.contains(Du(a));
}, i = (a) => {
r && (t.contains(Du(a)) || n(a));
};
return {
mousedown: o,
mouseup: i,
touchstart: o,
touchend: i
};
}
return console.error(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`
), {};
}
function AI(e, t, n) {
const r = pF[e];
let o = r.get(t);
o === void 0 && r.set(t, o = /* @__PURE__ */ new WeakMap());
let i = o.get(n);
return i === void 0 && o.set(n, i = mF(e, t, n)), i;
}
function fF(e, t, n, r) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = AI(e, t, n);
return Object.keys(o).forEach((i) => {
Sn(i, document, o[i], r);
}), !0;
}
return !1;
}
function hF(e, t, n, r) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const o = AI(e, t, n);
return Object.keys(o).forEach((i) => {
bn(i, document, o[i], r);
}), !0;
}
return !1;
}
function gF() {
if (typeof window > "u")
return {
on: () => {
},
off: () => {
}
};
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
function n() {
e.set(this, !0);
}
function r() {
e.set(this, !0), t.set(this, !0);
}
function o(A, k, M) {
const F = A[k];
return A[k] = function() {
return M.apply(A, arguments), F.apply(A, arguments);
}, A;
}
function i(A, k) {
A[k] = Event.prototype[k];
}
const a = /* @__PURE__ */ new WeakMap(), s = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
function l() {
var A;
return (A = a.get(this)) !== null && A !== void 0 ? A : null;
}
function c(A, k) {
s !== void 0 && Object.defineProperty(A, "currentTarget", {
configurable: !0,
enumerable: !0,
get: k ?? s.get
});
}
const d = {
bubble: {},
capture: {}
}, m = {};
function f() {
const A = function(k) {
const { type: M, eventPhase: F, bubbles: $ } = k, q = Du(k);
if (F === 2)
return;
const J = F === 1 ? "capture" : "bubble";
let Y = q;
const H = [];
for (; Y === null && (Y = window), H.push(Y), Y !== window; )
Y = Y.parentNode || null;
const P = d.capture[M], Q = d.bubble[M];
if (o(k, "stopPropagation", n), o(k, "stopImmediatePropagation", r), c(k, l), J === "capture") {
if (P === void 0)
return;
for (let ne = H.length - 1; ne >= 0 && !e.has(k); --ne) {
const ae = H[ne], z = P.get(ae);
if (z !== void 0) {
a.set(k, ae);
for (const G of z) {
if (t.has(k))
break;
G(k);
}
}
if (ne === 0 && !$ && Q !== void 0) {
const G = Q.get(ae);
if (G !== void 0)
for (const j of G) {
if (t.has(k))
break;
j(k);
}
}
}
} else if (J === "bubble") {
if (Q === void 0)
return;
for (let ne = 0; ne < H.length && !e.has(k); ++ne) {
const ae = H[ne], z = Q.get(ae);
if (z !== void 0) {
a.set(k, ae);
for (const G of z) {
if (t.has(k))
break;
G(k);
}
}
}
}
i(k, "stopPropagation"), i(k, "stopImmediatePropagation"), c(k);
};
return A.displayName = "evtdUnifiedHandler", A;
}
function g() {
const A = function(k) {
const { type: M, eventPhase: F } = k;
if (F !== 2)
return;
const $ = m[M];
$ !== void 0 && $.forEach((q) => q(k));
};
return A.displayName = "evtdUnifiedWindowEventHandler", A;
}
const _ = f(), S = g();
function b(A, k) {
const M = d[A];
return M[k] === void 0 && (M[k] = /* @__PURE__ */ new Map(), window.addEventListener(k, _, A === "capture")), M[k];
}
function E(A) {
return m[A] === void 0 && (m[A] = /* @__PURE__ */ new Set(), window.addEventListener(A, S)), m[A];
}
function C(A, k) {
let M = A.get(k);
return M === void 0 && A.set(k, M = /* @__PURE__ */ new Set()), M;
}
function R(A, k, M, F) {
const $ = d[k][M];
if ($ !== void 0) {
const q = $.get(A);
if (q !== void 0 && q.has(F))
return !0;
}
return !1;
}
function O(A, k) {
const M = m[A];
return !!(M !== void 0 && M.has(k));
}
function I(A, k, M, F) {
let $;
if (typeof F == "object" && F.once === !0 ? $ = (P) => {
T(A, k, $, F), M(P);
} : $ = M, fF(A, k, $, F))
return;
const J = F === !0 || typeof F == "object" && F.capture === !0 ? "capture" : "bubble", Y = b(J, A), H = C(Y, k);
if (H.has($) || H.add($), k === window) {
const P = E(A);
P.has($) || P.add($);
}
}
function T(A, k, M, F) {
if (hF(A, k, M, F))
return;
const q = F === !0 || typeof F == "object" && F.capture === !0, J = q ? "capture" : "bubble", Y = b(J, A), H = C(Y, k);
if (k === window && !R(k, q ? "bubble" : "capture", A, M) && O(A, M)) {
const Q = m[A];
Q.delete(M), Q.size === 0 && (window.removeEventListener(A, S), m[A] = void 0);
}
H.has(M) && H.delete(M), H.size === 0 && Y.delete(k), Y.size === 0 && (window.removeEventListener(A, _, J === "capture"), d[J][A] = void 0);
}
return {
on: I,
off: T
};
}
const { on: Sn, off: bn } = gF();
function _F(e) {
const t = le(!!e.value);
if (t.value)
return Jo(t);
const n = Kt(e, (r) => {
r && (t.value = !0, n());
});
return Jo(t);
}
function Tn(e) {
const t = ee(e), n = le(t.value);
return Kt(t, (r) => {
n.value = r;
}), typeof e == "function" ? n : {
__v_isRef: !0,
get value() {
return n.value;
},
set value(r) {
e.set(r);
}
};
}
function nm() {
return ri() !== null;
}
const ov = typeof window < "u";
let fl, Fc;
const bF = () => {
var e, t;
fl = ov ? (t = (e = document) === null || e === void 0 ? void 0 : e.fonts) === null || t === void 0 ? void 0 : t.ready : void 0, Fc = !1, fl !== void 0 ? fl.then(() => {
Fc = !0;
}) : Fc = !0;
};
bF();
function OI(e) {
if (Fc)
return;
let t = !1;
jn(() => {
Fc || fl == null || fl.then(() => {
t || e();
});
}), ar(() => {
t = !0;
});
}
const Dc = le(null);
function T1(e) {
if (e.clientX > 0 || e.clientY > 0)
Dc.value = {
x: e.clientX,
y: e.clientY
};
else {
const { target: t } = e;
if (t instanceof Element) {
const { left: n, top: r, width: o, height: i } = t.getBoundingClientRect();
n > 0 || r > 0 ? Dc.value = {
x: n + o / 2,
y: r + i / 2
} : Dc.value = { x: 0, y: 0 };
} else
Dc.value = null;
}
}
let Zd = 0, x1 = !0;
function wI() {
if (!ov)
return Jo(le(null));
Zd === 0 && Sn("click", document, T1, !0);
const e = () => {
Zd += 1;
};
return x1 && (x1 = nm()) ? (ca(e), ar(() => {
Zd -= 1, Zd === 0 && bn("click", document, T1, !0);
})) : e(), Jo(Dc);
}
const SF = le(void 0);
let Jd = 0;
function R1() {
SF.value = Date.now();
}
let A1 = !0;
function NI(e) {
if (!ov)
return Jo(le(!1));
const t = le(!1);
let n = null;
function r() {
n !== null && window.clearTimeout(n);
}
function o() {
r(), t.value = !0, n = window.setTimeout(() => {
t.value = !1;
}, e);
}
Jd === 0 && Sn("click", window, R1, !0);
const i = () => {
Jd += 1, Sn("click", window, o, !0);
};
return A1 && (A1 = nm()) ? (ca(i), ar(() => {
Jd -= 1, Jd === 0 && bn("click", window, R1, !0), bn("click", window, o, !0), r();
})) : i(), Jo(t);
}
let eu = 0;
const vF = typeof window < "u" && window.matchMedia !== void 0, Na = le(null);
let Ko, ss;
function sp(e) {
e.matches && (Na.value = "dark");
}
function lp(e) {
e.matches && (Na.value = "light");
}
function EF() {
Ko = window.matchMedia("(prefers-color-scheme: dark)"), ss = window.matchMedia("(prefers-color-scheme: light)"), Ko.matches ? Na.value = "dark" : ss.matches ? Na.value = "light" : Na.value = null, Ko.addEventListener ? (Ko.addEventListener("change", sp), ss.addEventListener("change", lp)) : Ko.addListener && (Ko.addListener(sp), ss.addListener(lp));
}
function CF() {
"removeEventListener" in Ko ? (Ko.removeEventListener("change", sp), ss.removeEventListener("change", lp)) : "removeListener" in Ko && (Ko.removeListener(sp), ss.removeListener(lp)), Ko = void 0, ss = void 0;
}
let O1 = !0;
function yF() {
return process.env.NODE_ENV !== "test" && !vF ? Jo(Na) : process.env.NODE_ENV === "test" && window.matchMedia === void 0 ? Jo(Na) : (eu === 0 && EF(), O1 && (O1 = nm()) && (ca(() => {
eu += 1;
}), ar(() => {
eu -= 1, eu === 0 && CF();
})), Jo(Na));
}
function wr(e, t) {
return Kt(e, (n) => {
n !== void 0 && (t.value = n);
}), ee(() => e.value === void 0 ? t.value : e.value);
}
function Is() {
const e = le(!1);
return jn(() => {
e.value = !0;
}), Jo(e);
}
function cp(e, t) {
return ee(() => {
for (const n of t)
if (e[n] !== void 0)
return e[n];
return e[t[t.length - 1]];
});
}
const TF = (typeof window > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
!window.MSStream;
function xF() {
return TF;
}
function RF(e = {}, t) {
const n = vd({
ctrl: !1,
command: !1,
win: !1,
shift: !1,
tab: !1
}), { keydown: r, keyup: o } = e, i = (l) => {
switch (l.key) {
case "Control":
n.ctrl = !0;
break;
case "Meta":
n.command = !0, n.win = !0;
break;
case "Shift":
n.shift = !0;
break;
case "Tab":
n.tab = !0;
break;
}
r !== void 0 && Object.keys(r).forEach((c) => {
if (c !== l.key)
return;
const d = r[c];
if (typeof d == "function")
d(l);
else {
const { stop: m = !1, prevent: f = !1 } = d;
m && l.stopPropagation(), f && l.preventDefault(), d.handler(l);
}
});
}, a = (l) => {
switch (l.key) {
case "Control":
n.ctrl = !1;
break;
case "Meta":
n.command = !1, n.win = !1;
break;
case "Shift":
n.shift = !1;
break;
case "Tab":
n.tab = !1;
break;
}
o !== void 0 && Object.keys(o).forEach((c) => {
if (c !== l.key)
return;
const d = o[c];
if (typeof d == "function")
d(l);
else {
const { stop: m = !1, prevent: f = !1 } = d;
m && l.stopPropagation(), f && l.preventDefault(), d.handler(l);
}
});
}, s = () => {
(t === void 0 || t.value) && (Sn("keydown", document, i), Sn("keyup", document, a)), t !== void 0 && Kt(t, (l) => {
l ? (Sn("keydown", document, i), Sn("keyup", document, a)) : (bn("keydown", document, i), bn("keyup", document, a));
});
};
return nm() ? (ca(s), ar(() => {
(t === void 0 || t.value) && (bn("keydown", document, i), bn("keyup", document, a));
})) : s(), Jo(n);
}
const iv = "n-internal-select-menu", II = "n-internal-select-menu-body", rm = "n-drawer-body", om = "n-modal-body", AF = "n-modal-provider", DI = "n-modal", Cd = "n-popover-body", kI = "__disabled__";
function vo(e) {
const t = rt(om, null), n = rt(rm, null), r = rt(Cd, null), o = rt(II, null), i = le();
if (typeof document < "u") {
i.value = document.fullscreenElement;
const a = () => {
i.value = document.fullscreenElement;
};
jn(() => {
Sn("fullscreenchange", document, a);
}), ar(() => {
bn("fullscreenchange", document, a);
});
}
return Tn(() => {
var a;
const {
to: s
} = e;
return s !== void 0 ? s === !1 ? kI : s === !0 ? i.value || "body" : s : t != null && t.value ? (a = t.value.$el) !== null && a !== void 0 ? a : t.value : n != null && n.value ? n.value : r != null && r.value ? r.value : o != null && o.value ? o.value : s ?? (i.value || "body");
});
}
vo.tdkey = kI;
vo.propTo = {
type: [String, Object, Boolean],
default: void 0
};
function OF(e, t, n) {
if (!t)
return e;
const r = le(e.value);
let o = null;
return Kt(e, (i) => {
o !== null && window.clearTimeout(o), i === !0 ? n && !n.value ? r.value = !0 : o = window.setTimeout(() => {
r.value = !0;
}, t) : r.value = !1;
}), r;
}
const Ds = typeof document < "u" && typeof window < "u", av = le(!1);
function w1() {
av.value = !0;
}
function N1() {
av.value = !1;
}
let gc = 0;
function wF() {
return Ds && (ca(() => {
gc || (window.addEventListener("compositionstart", w1), window.addEventListener("compositionend", N1)), gc++;
}), ar(() => {
gc <= 1 ? (window.removeEventListener("compositionstart", w1), window.removeEventListener("compositionend", N1), gc = 0) : gc--;
})), av;
}
let js = 0, I1 = "", D1 = "", k1 = "", M1 = "";
const L1 = le("0px");
function NF(e) {
if (typeof document > "u")
return;
const t = document.documentElement;
let n, r = !1;
const o = () => {
t.style.marginRight = I1, t.style.overflow = D1, t.style.overflowX = k1, t.style.overflowY = M1, L1.value = "0px";
};
jn(() => {
n = Kt(e, (i) => {
if (i) {
if (!js) {
const a = window.innerWidth - t.offsetWidth;
a > 0 && (I1 = t.style.marginRight, t.style.marginRight = `${a}px`, L1.value = `${a}px`), D1 = t.style.overflow, k1 = t.style.overflowX, M1 = t.style.overflowY, t.style.overflow = "hidden", t.style.overflowX = "hidden", t.style.overflowY = "hidden";
}
r = !0, js++;
} else
js--, js || o(), r = !1;
}, {
immediate: !0
});
}), ar(() => {
n == null || n(), r && (js--, js || o(), r = !1);
});
}
function sv(e) {
const t = {
isDeactivated: !1
};
let n = !1;
return cI(() => {
if (t.isDeactivated = !1, !n) {
n = !0;
return;
}
e();
}), tv(() => {
t.isDeactivated = !0, n || (n = !0);
}), t;
}
function Gb(e, t, n = "default") {
const r = t[n];
if (r === void 0)
throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);
return r();
}
function qb(e, t = !0, n = []) {
return e.forEach((r) => {
if (r !== null) {
if (typeof r != "object") {
(typeof r == "string" || typeof r == "number") && n.push(Jn(String(r)));
return;
}
if (Array.isArray(r)) {
qb(r, t, n);
return;
}
if (r.type === rn) {
if (r.children === null)
return;
Array.isArray(r.children) && qb(r.children, t, n);
} else
r.type !== Xp && n.push(r);
}
}), n;
}
function P1(e, t, n = "default") {
const r = t[n];
if (r === void 0)
throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);
const o = qb(r());
if (o.length === 1)
return o[0];
throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`);
}
let Sa = null;
function MI() {
if (Sa === null && (Sa = document.getElementById("v-binder-view-measurer"), Sa === null)) {
Sa = document.createElement("div"), Sa.id = "v-binder-view-measurer";
const { style: e } = Sa;
e.position = "fixed", e.left = "0", e.right = "0", e.top = "0", e.bottom = "0", e.pointerEvents = "none", e.visibility = "hidden", document.body.appendChild(Sa);
}
return Sa.getBoundingClientRect();
}
function IF(e, t) {
const n = MI();
return {
top: t,
left: e,
height: 0,
width: 0,
right: n.width - e,
bottom: n.height - t
};
}
function Yf(e) {
const t = e.getBoundingClientRect(), n = MI();
return {
left: t.left - n.left,
top: t.top - n.top,
bottom: n.height + n.top - t.bottom,
right: n.width + n.left - t.right,
width: t.width,
height: t.height
};
}
function DF(e) {
return e.nodeType === 9 ? null : e.parentNode;
}
function LI(e) {
if (e === null)
return null;
const t = DF(e);
if (t === null)
return null;
if (t.nodeType === 9)
return document;
if (t.nodeType === 1) {
const { overflow: n, overflowX: r, overflowY: o } = getComputedStyle(t);
if (/(auto|scroll|overlay)/.test(n + o + r))
return t;
}
return LI(t);
}
const kF = Pe({
name: "Binder",
props: {
syncTargetWithParent: Boolean,
syncTarget: {
type: Boolean,
default: !0
}
},
setup(e) {
var t;
Pt("VBinder", (t = ri()) === null || t === void 0 ? void 0 : t.proxy);
const n = rt("VBinder", null), r = le(null), o = (E) => {
r.value = E, n && e.syncTargetWithParent && n.setTargetRef(E);
};
let i = [];
const a = () => {
let E = r.value;
for (; E = LI(E), E !== null; )
i.push(E);
for (const C of i)
Sn("scroll", C, m, !0);
}, s = () => {
for (const E of i)
bn("scroll", E, m, !0);
i = [];
}, l = /* @__PURE__ */ new Set(), c = (E) => {
l.size === 0 && a(), l.has(E) || l.add(E);
}, d = (E) => {
l.has(E) && l.delete(E), l.size === 0 && s();
}, m = () => {
ip(f);
}, f = () => {
l.forEach((E) => E());
}, g = /* @__PURE__ */ new Set(), _ = (E) => {
g.size === 0 && Sn("resize", window, b), g.has(E) || g.add(E);
}, S = (E) => {
g.has(E) && g.delete(E), g.size === 0 && bn("resize", window, b);
}, b = () => {
g.forEach((E) => E());
};
return ar(() => {
bn("resize", window, b), s();
}), {
targetRef: r,
setTargetRef: o,
addScrollListener: c,
removeScrollListener: d,
addResizeListener: _,
removeResizeListener: S
};
},
render() {
return Gb("binder", this.$slots);
}
}), im = kF, am = Pe({
name: "Target",
setup() {
const { setTargetRef: e, syncTarget: t } = rt("VBinder");
return {
syncTarget: t,
setTargetDirective: {
mounted: e,
updated: e
}
};
},
render() {
const { syncTarget: e, setTargetDirective: t } = this;
return e ? Ar(P1("follower", this.$slots), [
[t]
]) : P1("follower", this.$slots);
}
}), Xs = "@@mmoContext", MF = {
mounted(e, { value: t }) {
e[Xs] = {
handler: void 0
}, typeof t == "function" && (e[Xs].handler = t, Sn("mousemoveoutside", e, t));
},
updated(e, { value: t }) {
const n = e[Xs];
typeof t == "function" ? n.handler ? n.handler !== t && (bn("mousemoveoutside", e, n.handler), n.handler = t, Sn("mousemoveoutside", e, t)) : (e[Xs].handler = t, Sn("mousemoveoutside", e, t)) : n.handler && (bn("mousemoveoutside", e, n.handler), n.handler = void 0);
},
unmounted(e) {
const { handler: t } = e[Xs];
t && bn("mousemoveoutside", e, t), e[Xs].handler = void 0;
}
}, LF = MF, Zs = "@@coContext", PF = {
mounted(e, { value: t, modifiers: n }) {
e[Zs] = {
handler: void 0
}, typeof t == "function" && (e[Zs].handler = t, Sn("clickoutside", e, t, {
capture: n.capture
}));
},
updated(e, { value: t, modifiers: n }) {
const r = e[Zs];
typeof t == "function" ? r.handler ? r.handler !== t && (bn("clickoutside", e, r.handler, {
capture: n.capture
}), r.handler = t, Sn("clickoutside", e, t, {
capture: n.capture
})) : (e[Zs].handler = t, Sn("clickoutside", e, t, {
capture: n.capture
})) : r.handler && (bn("clickoutside", e, r.handler, {
capture: n.capture
}), r.handler = void 0);
},
unmounted(e, { modifiers: t }) {
const { handler: n } = e[Zs];
n && bn("clickoutside", e, n, {
capture: t.capture
}), e[Zs].handler = void 0;
}
}, Sl = PF;
function FF(e, t) {
console.error(`[vdirs/${e}]: ${t}`);
}
class BF {
constructor() {
this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3;
}
get elementCount() {
return this.elementZIndex.size;
}
ensureZIndex(t, n) {
const { elementZIndex: r } = this;
if (n !== void 0) {
t.style.zIndex = `${n}`, r.delete(t);
return;
}
const { nextZIndex: o } = this;
r.has(t) && r.get(t) + 1 === this.nextZIndex || (t.style.zIndex = `${o}`, r.set(t, o), this.nextZIndex = o + 1, this.squashState());
}
unregister(t, n) {
const { elementZIndex: r } = this;
r.has(t) ? r.delete(t) : n === void 0 && FF("z-index-manager/unregister-element", "Element not found when unregistering."), this.squashState();
}
squashState() {
const { elementCount: t } = this;
t || (this.nextZIndex = 2e3), this.nextZIndex - t > 2500 && this.rearrange();
}
rearrange() {
const t = Array.from(this.elementZIndex.entries());
t.sort((n, r) => n[1] - r[1]), this.nextZIndex = 2e3, t.forEach((n) => {
const r = n[0], o = this.nextZIndex++;
`${o}` !== r.style.zIndex && (r.style.zIndex = `${o}`);
});
}
}
const Vf = new BF(), Js = "@@ziContext", UF = {
mounted(e, t) {
const { value: n = {} } = t, { zIndex: r, enabled: o } = n;
e[Js] = {
enabled: !!o,
initialized: !1
}, o && (Vf.ensureZIndex(e, r), e[Js].initialized = !0);
},
updated(e, t) {
const { value: n = {} } = t, { zIndex: r, enabled: o } = n, i = e[Js].enabled;
o && !i && (Vf.ensureZIndex(e, r), e[Js].initialized = !0), e[Js].enabled = !!o;
},
unmounted(e, t) {
if (!e[Js].initialized)
return;
const { value: n = {} } = t, { zIndex: r } = n;
Vf.unregister(e, r);
}
}, lv = UF, zF = "@css-render/vue3-ssr";
function $F(e, t) {
return `<style cssr-id="${e}">
${t}
</style>`;
}
function HF(e, t, n) {
const { styles: r, ids: o } = n;
o.has(e) || r !== null && (o.add(e), r.push($F(e, t)));
}
const GF = typeof document < "u";
function za() {
if (GF)
return;
const e = rt(zF, null);
if (e !== null)
return {
adapter: (t, n) => HF(t, n, e),
context: e
};
}
function F1(e, t) {
console.error(`[vueuc/${e}]: ${t}`);
}
const { c: yi } = bI(), sm = "vueuc-style";
function B1(e) {
return e & -e;
}
class PI {
/**
* @param l length of the array
* @param min min value of the array
*/
constructor(t, n) {
this.l = t, this.min = n;
const r = new Array(t + 1);
for (let o = 0; o < t + 1; ++o)
r[o] = 0;
this.ft = r;
}
/**
* Add arr[i] by n, start from 0
* @param i the index of the element to be added
* @param n the value to be added
*/
add(t, n) {
if (n === 0)
return;
const { l: r, ft: o } = this;
for (t += 1; t <= r; )
o[t] += n, t += B1(t);
}
/**
* Get the value of index i
* @param i index
* @returns value of the index
*/
get(t) {
return this.sum(t + 1) - this.sum(t);
}
/**
* Get the sum of first i elements
* @param i count of head elements to be added
* @returns the sum of first i elements
*/
sum(t) {
if (t === void 0 && (t = this.l), t <= 0)
return 0;
const { ft: n, min: r, l: o } = this;
if (t > o)
throw new Error("[FinweckTree.sum]: `i` is larger than length.");
let i = t * r;
for (; t > 0; )
i += n[t], t -= B1(t);
return i;
}
/**
* Get the largest count of head elements whose sum are <= threshold
* @param threshold
* @returns the largest count of head elements whose sum are <= threshold
*/
getBound(t) {
let n = 0, r = this.l;
for (; r > n; ) {
const o = Math.floor((n + r) / 2), i = this.sum(o);
if (i > t) {
r = o;
continue;
} else if (i < t) {
if (n === o)
return this.sum(n + 1) <= t ? n + 1 : o;
n = o;
} else
return o;
}
return n;
}
}
function U1(e) {
return typeof e == "string" ? document.querySelector(e) : e() || null;
}
const FI = Pe({
name: "LazyTeleport",
props: {
to: {
type: [String, Object],
default: void 0
},
disabled: Boolean,
show: {
type: Boolean,
required: !0
}
},
setup(e) {
return {
showTeleport: _F(nt(e, "show")),
mergedTo: ee(() => {
const { to: t } = e;
return t ?? "body";
})
};
},
render() {
return this.showTeleport ? this.disabled ? Gb("lazy-teleport", this.$slots) : N(Zp, {
disabled: this.disabled,
to: this.mergedTo
}, Gb("lazy-teleport", this.$slots)) : null;
}
}), tu = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}, z1 = {
start: "end",
center: "center",
end: "start"
}, Wf = {
top: "height",
bottom: "height",
left: "width",
right: "width"
}, qF = {
"bottom-start": "top left",
bottom: "top center",
"bottom-end": "top right",
"top-start": "bottom left",
top: "bottom center",
"top-end": "bottom right",
"right-start": "top left",
right: "center left",
"right-end": "bottom left",
"left-start": "top right",
left: "center right",
"left-end": "bottom right"
}, YF = {
"bottom-start": "bottom left",
bottom: "bottom center",
"bottom-end": "bottom right",
"top-start": "top left",
top: "top center",
"top-end": "top right",
"right-start": "top right",
right: "center right",
"right-end": "bottom right",
"left-start": "top left",
left: "center left",
"left-end": "bottom left"
}, VF = {
"bottom-start": "right",
"bottom-end": "left",
"top-start": "right",
"top-end": "left",
"right-start": "bottom",
"right-end": "top",
"left-start": "bottom",
"left-end": "top"
}, $1 = {
top: !0,
// top++
bottom: !1,
// top--
left: !0,
// left++
right: !1
// left--
}, H1 = {
top: "end",
bottom: "start",
left: "end",
right: "start"
};
function WF(e, t, n, r, o, i) {
if (!o || i)
return { placement: e, top: 0, left: 0 };
const [a, s] = e.split("-");
let l = s ?? "center", c = {
top: 0,
left: 0
};
const d = (g, _, S) => {
let b = 0, E = 0;
const C = n[g] - t[_] - t[g];
return C > 0 && r && (S ? E = $1[_] ? C : -C : b = $1[_] ? C : -C), {
left: b,
top: E
};
}, m = a === "left" || a === "right";
if (l !== "center") {
const g = VF[e], _ = tu[g], S = Wf[g];
if (n[S] > t[S]) {
if (
// current space is not enough
// ----------[ target ]---------|
// -------[ follower ]
t[g] + t[S] < n[S]
) {
const b = (n[S] - t[S]) / 2;
t[g] < b || t[_] < b ? t[g] < t[_] ? (l = z1[s], c = d(S, _, m)) : c = d(S, g, m) : l = "center";
}
} else
n[S] < t[S] && t[_] < 0 && // opposite align has larger space
// ------------[ target ]
// ----------------[follower]
t[g] > t[_] && (l = z1[s]);
} else {
const g = a === "bottom" || a === "top" ? "left" : "top", _ = tu[g], S = Wf[g], b = (n[S] - t[S]) / 2;
// center is not enough
// ----------- [ target ]--|
// -------[ follower ]
(t[g] < b || t[_] < b) && (t[g] > t[_] ? (l = H1[g], c = d(S, g, m)) : (l = H1[_], c = d(S, _, m)));
}
let f = a;
return (
// space is not enough
t[a] < n[Wf[a]] && // opposite position's space is larger
t[a] < t[tu[a]] && (f = tu[a]), {
placement: l !== "center" ? `${f}-${l}` : f,
left: c.left,
top: c.top
}
);
}
function KF(e, t) {
return t ? YF[e] : qF[e];
}
function QF(e, t, n, r, o, i) {
if (i)
switch (e) {
case "bottom-start":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "bottom-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: ""
};
case "top-end":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%)"
};
case "right-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%)"
};
case "right-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left + n.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: ""
};
case "left-end":
return {
top: `${Math.round(n.top - t.top + n.height)}px`,
left: `${Math.round(n.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "top":
return {
top: `${Math.round(n.top - t.top)}px`,
left: `${Math.round(n.left - t.left + n.width / 2)}px`,
transform: "translateX(-50%)"
};
case "right":
return {
top: `${Math.round(n.top - t.top + n.height / 2)}px`,