@visitscotland/component-library
Version:
VisitScotland Component Library
1,760 lines (1,759 loc) • 434 kB
JavaScript
import { defineComponent as ie, computed as P, h as ft, Teleport as pa, ref as re, watch as qe, onMounted as va, nextTick as kn, toRef as H, openBlock as F, createBlock as Y, resolveDynamicComponent as Me, normalizeClass as ee, withCtx as ne, renderSlot as U, createTextVNode as Ee, toDisplayString as Oe, toValue as Nt, inject as Xt, useModel as Tt, withDirectives as ur, createElementBlock as X, unref as J, Fragment as et, renderList as dr, vModelSelect as mb, mergeModels as it, mergeProps as be, createCommentVNode as Ae, createVNode as yt, useAttrs as To, getCurrentInstance as ko, useSlots as Kn, onActivated as yb, provide as ha, createElementVNode as Ue, normalizeStyle as pn, vShow as Cl, shallowRef as ff, getCurrentScope as cf, onScopeDispose as pf, shallowReadonly as kr, normalizeProps as ct, vModelRadio as bb, vModelCheckbox as _b, guardReactiveProps as Ft, watchEffect as wb, onBeforeUnmount as xb, onUnmounted as Bb, withModifiers as ia, withKeys as Or, render as vf, readonly as go, Transition as Sb, customRef as Cb, resolveComponent as Kt, createStaticVNode as Tb } from "vue";
import { defineStore as kb, mapState as Ab } from "pinia";
const sn = (n, a) => {
const r = n.__vccOpts || n;
for (const [l, o] of a)
r[l] = o;
return r;
};
var Eb = {}, Ob = Object.defineProperty, Rb = (n, a, r) => a in n ? Ob(n, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[a] = r, Tn = (n, a, r) => (Rb(n, typeof a != "symbol" ? a + "" : a, r), r);
const hf = (n) => P(() => {
const a = Nt(n);
return a ? `justify-content-${a}` : "";
}), Tl = (n, a) => P(() => {
const r = Nt(n), l = Nt(a);
return r === !0 ? "true" : typeof r == "string" ? r : l === !1 ? "true" : r === !1 ? "false" : void 0;
});
class fa {
constructor(a, r = {}) {
if (Tn(this, "cancelable", !0), Tn(this, "componentId", null), Tn(this, "_defaultPrevented", !1), Tn(this, "eventType", ""), Tn(this, "nativeEvent", null), Tn(this, "_preventDefault"), Tn(this, "relatedTarget", null), Tn(this, "target", null), !a)
throw new TypeError(
`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`
);
Object.assign(this, fa.Defaults, r, { eventType: a }), this._preventDefault = function() {
this.cancelable && (this.defaultPrevented = !0);
};
}
// Readable by everyone,
// But only overwritten by inherrited constructors
get defaultPrevented() {
return this._defaultPrevented;
}
set defaultPrevented(a) {
this._defaultPrevented = a;
}
// I think this is right
// We want to be able to have it callable to everyone,
// But only overwritten by inherrited constructors
get preventDefault() {
return this._preventDefault;
}
// This may not be correct, because it doesn't get correct type inferences in children
// Ex overwrite this.preventDefault = () => true is valid. Could be a TS issue
set preventDefault(a) {
this._preventDefault = a;
}
static get Defaults() {
return {
cancelable: !0,
componentId: null,
eventType: "",
nativeEvent: null,
relatedTarget: null,
target: null
};
}
}
class kl extends fa {
constructor(a, r = {}) {
super(a, r), Tn(this, "trigger", null), Object.assign(this, fa.Defaults, r, { eventType: a });
}
static get Defaults() {
return {
...super.Defaults,
trigger: null
};
}
}
const Lb = (n, a = {}) => {
const r = (o = []) => {
const { activeElement: s } = document;
return s && !o.some((d) => d === s) ? s : null;
}, l = (o) => o === r();
try {
n.focus(a);
} catch (o) {
console.error(o);
}
return l(n);
}, vn = (n) => ((n == null ? void 0 : n()) ?? []).length === 0, $b = (n) => {
if (n.getAttribute("display") === "none")
return !1;
const a = n.getBoundingClientRect();
return !!(a && a.height > 0 && a.width > 0);
}, Fb = (n) => {
const a = window.getComputedStyle(n), r = a.transitionDelay.split(",")[0] || "", l = a.transitionDuration.split(",")[0] || "", o = Number(r.slice(0, -1)) * 1e3, s = Number(l.slice(0, -1)) * 1e3;
return o + s;
}, gf = typeof window < "u" && typeof document < "u" && typeof navigator < "u", mf = ["top", "right", "bottom", "left"], xd = ["start", "end"], Bd = /* @__PURE__ */ mf.reduce((n, a) => n.concat(a, a + "-" + xd[0], a + "-" + xd[1]), []), on = Math.min, pt = Math.max, _l = Math.round, cl = Math.floor, Gn = (n) => ({
x: n,
y: n
}), Ib = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
}, Pb = {
start: "end",
end: "start"
};
function mo(n, a, r) {
return pt(n, on(a, r));
}
function Rn(n, a) {
return typeof n == "function" ? n(a) : n;
}
function Jt(n) {
return n.split("-")[0];
}
function ln(n) {
return n.split("-")[1];
}
function yf(n) {
return n === "x" ? "y" : "x";
}
function Ao(n) {
return n === "y" ? "height" : "width";
}
function Vr(n) {
return ["top", "bottom"].includes(Jt(n)) ? "y" : "x";
}
function Eo(n) {
return yf(Vr(n));
}
function bf(n, a, r) {
r === void 0 && (r = !1);
const l = ln(n), o = Eo(n), s = Ao(o);
let d = o === "x" ? l === (r ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
return a.reference[s] > a.floating[s] && (d = xl(d)), [d, xl(d)];
}
function Nb(n) {
const a = xl(n);
return [wl(n), a, wl(a)];
}
function wl(n) {
return n.replace(/start|end/g, (a) => Pb[a]);
}
function Vb(n, a, r) {
const l = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], d = ["bottom", "top"];
switch (n) {
case "top":
case "bottom":
return r ? a ? o : l : a ? l : o;
case "left":
case "right":
return a ? s : d;
default:
return [];
}
}
function Db(n, a, r, l) {
const o = ln(n);
let s = Vb(Jt(n), r === "start", l);
return o && (s = s.map((d) => d + "-" + o), a && (s = s.concat(s.map(wl)))), s;
}
function xl(n) {
return n.replace(/left|right|bottom|top/g, (a) => Ib[a]);
}
function zb(n) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...n
};
}
function Oo(n) {
return typeof n != "number" ? zb(n) : {
top: n,
right: n,
bottom: n,
left: n
};
}
function Fr(n) {
return {
...n,
top: n.y,
left: n.x,
right: n.x + n.width,
bottom: n.y + n.height
};
}
function Sd(n, a, r) {
let {
reference: l,
floating: o
} = n;
const s = Vr(a), d = Eo(a), f = Ao(d), p = Jt(a), h = s === "y", m = l.x + l.width / 2 - o.width / 2, x = l.y + l.height / 2 - o.height / 2, w = l[f] / 2 - o[f] / 2;
let y;
switch (p) {
case "top":
y = {
x: m,
y: l.y - o.height
};
break;
case "bottom":
y = {
x: m,
y: l.y + l.height
};
break;
case "right":
y = {
x: l.x + l.width,
y: x
};
break;
case "left":
y = {
x: l.x - o.width,
y: x
};
break;
default:
y = {
x: l.x,
y: l.y
};
}
switch (ln(a)) {
case "start":
y[d] -= w * (r && h ? -1 : 1);
break;
case "end":
y[d] += w * (r && h ? -1 : 1);
break;
}
return y;
}
const Mb = async (n, a, r) => {
const {
placement: l = "bottom",
strategy: o = "absolute",
middleware: s = [],
platform: d
} = r, f = s.filter(Boolean), p = await (d.isRTL == null ? void 0 : d.isRTL(a));
let h = await d.getElementRects({
reference: n,
floating: a,
strategy: o
}), {
x: m,
y: x
} = Sd(h, l, p), w = l, y = {}, S = 0;
for (let b = 0; b < f.length; b++) {
const {
name: B,
fn: C
} = f[b], {
x: R,
y: I,
data: E,
reset: L
} = await C({
x: m,
y: x,
initialPlacement: l,
placement: w,
strategy: o,
middlewareData: y,
rects: h,
platform: d,
elements: {
reference: n,
floating: a
}
});
m = R ?? m, x = I ?? x, y = {
...y,
[B]: {
...y[B],
...E
}
}, L && S <= 50 && (S++, typeof L == "object" && (L.placement && (w = L.placement), L.rects && (h = L.rects === !0 ? await d.getElementRects({
reference: n,
floating: a,
strategy: o
}) : L.rects), {
x: m,
y: x
} = Sd(h, w, p)), b = -1);
}
return {
x: m,
y: x,
placement: w,
strategy: o,
middlewareData: y
};
};
async function Ir(n, a) {
var r;
a === void 0 && (a = {});
const {
x: l,
y: o,
platform: s,
rects: d,
elements: f,
strategy: p
} = n, {
boundary: h = "clippingAncestors",
rootBoundary: m = "viewport",
elementContext: x = "floating",
altBoundary: w = !1,
padding: y = 0
} = Rn(a, n), S = Oo(y), b = f[w ? x === "floating" ? "reference" : "floating" : x], B = Fr(await s.getClippingRect({
element: (r = await (s.isElement == null ? void 0 : s.isElement(b))) == null || r ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(f.floating)),
boundary: h,
rootBoundary: m,
strategy: p
})), C = x === "floating" ? {
...d.floating,
x: l,
y: o
} : d.reference, R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f.floating)), I = await (s.isElement == null ? void 0 : s.isElement(R)) ? await (s.getScale == null ? void 0 : s.getScale(R)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
}, E = Fr(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
elements: f,
rect: C,
offsetParent: R,
strategy: p
}) : C);
return {
top: (B.top - E.top + S.top) / I.y,
bottom: (E.bottom - B.bottom + S.bottom) / I.y,
left: (B.left - E.left + S.left) / I.x,
right: (E.right - B.right + S.right) / I.x
};
}
const Hb = (n) => ({
name: "arrow",
options: n,
async fn(a) {
const {
x: r,
y: l,
placement: o,
rects: s,
platform: d,
elements: f,
middlewareData: p
} = a, {
element: h,
padding: m = 0
} = Rn(n, a) || {};
if (h == null)
return {};
const x = Oo(m), w = {
x: r,
y: l
}, y = Eo(o), S = Ao(y), b = await d.getDimensions(h), B = y === "y", C = B ? "top" : "left", R = B ? "bottom" : "right", I = B ? "clientHeight" : "clientWidth", E = s.reference[S] + s.reference[y] - w[y] - s.floating[S], L = w[y] - s.reference[y], V = await (d.getOffsetParent == null ? void 0 : d.getOffsetParent(h));
let W = V ? V[I] : 0;
(!W || !await (d.isElement == null ? void 0 : d.isElement(V))) && (W = f.floating[I] || s.floating[S]);
const le = E / 2 - L / 2, ue = W / 2 - b[S] / 2 - 1, ce = on(x[C], ue), Re = on(x[R], ue), Z = ce, me = W - b[S] - Re, q = W / 2 - b[S] / 2 + le, he = mo(Z, q, me), xe = !p.arrow && ln(o) != null && q !== he && s.reference[S] / 2 - (q < Z ? ce : Re) - b[S] / 2 < 0, $e = xe ? q < Z ? q - Z : q - me : 0;
return {
[y]: w[y] + $e,
data: {
[y]: he,
centerOffset: q - he - $e,
...xe && {
alignmentOffset: $e
}
},
reset: xe
};
}
});
function Ub(n, a, r) {
return (n ? [...r.filter((l) => ln(l) === n), ...r.filter((l) => ln(l) !== n)] : r.filter((l) => Jt(l) === l)).filter((l) => n ? ln(l) === n || (a ? wl(l) !== l : !1) : !0);
}
const Wb = function(n) {
return n === void 0 && (n = {}), {
name: "autoPlacement",
options: n,
async fn(a) {
var r, l, o;
const {
rects: s,
middlewareData: d,
placement: f,
platform: p,
elements: h
} = a, {
crossAxis: m = !1,
alignment: x,
allowedPlacements: w = Bd,
autoAlignment: y = !0,
...S
} = Rn(n, a), b = x !== void 0 || w === Bd ? Ub(x || null, y, w) : w, B = await Ir(a, S), C = ((r = d.autoPlacement) == null ? void 0 : r.index) || 0, R = b[C];
if (R == null)
return {};
const I = bf(R, s, await (p.isRTL == null ? void 0 : p.isRTL(h.floating)));
if (f !== R)
return {
reset: {
placement: b[0]
}
};
const E = [B[Jt(R)], B[I[0]], B[I[1]]], L = [...((l = d.autoPlacement) == null ? void 0 : l.overflows) || [], {
placement: R,
overflows: E
}], V = b[C + 1];
if (V)
return {
data: {
index: C + 1,
overflows: L
},
reset: {
placement: V
}
};
const W = L.map((ue) => {
const ce = ln(ue.placement);
return [ue.placement, ce && m ? (
// Check along the mainAxis and main crossAxis side.
ue.overflows.slice(0, 2).reduce((Re, Z) => Re + Z, 0)
) : (
// Check only the mainAxis.
ue.overflows[0]
), ue.overflows];
}).sort((ue, ce) => ue[1] - ce[1]), le = ((o = W.filter((ue) => ue[2].slice(
0,
// Aligned placements should not check their opposite crossAxis
// side.
ln(ue[0]) ? 2 : 3
).every((ce) => ce <= 0))[0]) == null ? void 0 : o[0]) || W[0][0];
return le !== f ? {
data: {
index: C + 1,
overflows: L
},
reset: {
placement: le
}
} : {};
}
};
}, qb = function(n) {
return n === void 0 && (n = {}), {
name: "flip",
options: n,
async fn(a) {
var r, l;
const {
placement: o,
middlewareData: s,
rects: d,
initialPlacement: f,
platform: p,
elements: h
} = a, {
mainAxis: m = !0,
crossAxis: x = !0,
fallbackPlacements: w,
fallbackStrategy: y = "bestFit",
fallbackAxisSideDirection: S = "none",
flipAlignment: b = !0,
...B
} = Rn(n, a);
if ((r = s.arrow) != null && r.alignmentOffset)
return {};
const C = Jt(o), R = Jt(f) === f, I = await (p.isRTL == null ? void 0 : p.isRTL(h.floating)), E = w || (R || !b ? [xl(f)] : Nb(f));
!w && S !== "none" && E.push(...Db(f, b, S, I));
const L = [f, ...E], V = await Ir(a, B), W = [];
let le = ((l = s.flip) == null ? void 0 : l.overflows) || [];
if (m && W.push(V[C]), x) {
const Z = bf(o, d, I);
W.push(V[Z[0]], V[Z[1]]);
}
if (le = [...le, {
placement: o,
overflows: W
}], !W.every((Z) => Z <= 0)) {
var ue, ce;
const Z = (((ue = s.flip) == null ? void 0 : ue.index) || 0) + 1, me = L[Z];
if (me)
return {
data: {
index: Z,
overflows: le
},
reset: {
placement: me
}
};
let q = (ce = le.filter((he) => he.overflows[0] <= 0).sort((he, xe) => he.overflows[1] - xe.overflows[1])[0]) == null ? void 0 : ce.placement;
if (!q)
switch (y) {
case "bestFit": {
var Re;
const he = (Re = le.map((xe) => [xe.placement, xe.overflows.filter(($e) => $e > 0).reduce(($e, Se) => $e + Se, 0)]).sort((xe, $e) => xe[1] - $e[1])[0]) == null ? void 0 : Re[0];
he && (q = he);
break;
}
case "initialPlacement":
q = f;
break;
}
if (o !== q)
return {
reset: {
placement: q
}
};
}
return {};
}
};
};
function Cd(n, a) {
return {
top: n.top - a.height,
right: n.right - a.width,
bottom: n.bottom - a.height,
left: n.left - a.width
};
}
function Td(n) {
return mf.some((a) => n[a] >= 0);
}
const Gb = function(n) {
return n === void 0 && (n = {}), {
name: "hide",
options: n,
async fn(a) {
const {
rects: r
} = a, {
strategy: l = "referenceHidden",
...o
} = Rn(n, a);
switch (l) {
case "referenceHidden": {
const s = await Ir(a, {
...o,
elementContext: "reference"
}), d = Cd(s, r.reference);
return {
data: {
referenceHiddenOffsets: d,
referenceHidden: Td(d)
}
};
}
case "escaped": {
const s = await Ir(a, {
...o,
altBoundary: !0
}), d = Cd(s, r.floating);
return {
data: {
escapedOffsets: d,
escaped: Td(d)
}
};
}
default:
return {};
}
}
};
};
function _f(n) {
const a = on(...n.map((s) => s.left)), r = on(...n.map((s) => s.top)), l = pt(...n.map((s) => s.right)), o = pt(...n.map((s) => s.bottom));
return {
x: a,
y: r,
width: l - a,
height: o - r
};
}
function Kb(n) {
const a = n.slice().sort((o, s) => o.y - s.y), r = [];
let l = null;
for (let o = 0; o < a.length; o++) {
const s = a[o];
!l || s.y - l.y > l.height / 2 ? r.push([s]) : r[r.length - 1].push(s), l = s;
}
return r.map((o) => Fr(_f(o)));
}
const Xb = function(n) {
return n === void 0 && (n = {}), {
name: "inline",
options: n,
async fn(a) {
const {
placement: r,
elements: l,
rects: o,
platform: s,
strategy: d
} = a, {
padding: f = 2,
x: p,
y: h
} = Rn(n, a), m = Array.from(await (s.getClientRects == null ? void 0 : s.getClientRects(l.reference)) || []), x = Kb(m), w = Fr(_f(m)), y = Oo(f);
function S() {
if (x.length === 2 && x[0].left > x[1].right && p != null && h != null)
return x.find((B) => p > B.left - y.left && p < B.right + y.right && h > B.top - y.top && h < B.bottom + y.bottom) || w;
if (x.length >= 2) {
if (Vr(r) === "y") {
const ce = x[0], Re = x[x.length - 1], Z = Jt(r) === "top", me = ce.top, q = Re.bottom, he = Z ? ce.left : Re.left, xe = Z ? ce.right : Re.right, $e = xe - he, Se = q - me;
return {
top: me,
bottom: q,
left: he,
right: xe,
width: $e,
height: Se,
x: he,
y: me
};
}
const B = Jt(r) === "left", C = pt(...x.map((ce) => ce.right)), R = on(...x.map((ce) => ce.left)), I = x.filter((ce) => B ? ce.left === R : ce.right === C), E = I[0].top, L = I[I.length - 1].bottom, V = R, W = C, le = W - V, ue = L - E;
return {
top: E,
bottom: L,
left: V,
right: W,
width: le,
height: ue,
x: V,
y: E
};
}
return w;
}
const b = await s.getElementRects({
reference: {
getBoundingClientRect: S
},
floating: l.floating,
strategy: d
});
return o.reference.x !== b.reference.x || o.reference.y !== b.reference.y || o.reference.width !== b.reference.width || o.reference.height !== b.reference.height ? {
reset: {
rects: b
}
} : {};
}
};
};
async function Jb(n, a) {
const {
placement: r,
platform: l,
elements: o
} = n, s = await (l.isRTL == null ? void 0 : l.isRTL(o.floating)), d = Jt(r), f = ln(r), p = Vr(r) === "y", h = ["left", "top"].includes(d) ? -1 : 1, m = s && p ? -1 : 1, x = Rn(a, n);
let {
mainAxis: w,
crossAxis: y,
alignmentAxis: S
} = typeof x == "number" ? {
mainAxis: x,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: 0,
crossAxis: 0,
alignmentAxis: null,
...x
};
return f && typeof S == "number" && (y = f === "end" ? S * -1 : S), p ? {
x: y * m,
y: w * h
} : {
x: w * h,
y: y * m
};
}
const wf = function(n) {
return n === void 0 && (n = 0), {
name: "offset",
options: n,
async fn(a) {
var r, l;
const {
x: o,
y: s,
placement: d,
middlewareData: f
} = a, p = await Jb(a, n);
return d === ((r = f.offset) == null ? void 0 : r.placement) && (l = f.arrow) != null && l.alignmentOffset ? {} : {
x: o + p.x,
y: s + p.y,
data: {
...p,
placement: d
}
};
}
};
}, jb = function(n) {
return n === void 0 && (n = {}), {
name: "shift",
options: n,
async fn(a) {
const {
x: r,
y: l,
placement: o
} = a, {
mainAxis: s = !0,
crossAxis: d = !1,
limiter: f = {
fn: (B) => {
let {
x: C,
y: R
} = B;
return {
x: C,
y: R
};
}
},
...p
} = Rn(n, a), h = {
x: r,
y: l
}, m = await Ir(a, p), x = Vr(Jt(o)), w = yf(x);
let y = h[w], S = h[x];
if (s) {
const B = w === "y" ? "top" : "left", C = w === "y" ? "bottom" : "right", R = y + m[B], I = y - m[C];
y = mo(R, y, I);
}
if (d) {
const B = x === "y" ? "top" : "left", C = x === "y" ? "bottom" : "right", R = S + m[B], I = S - m[C];
S = mo(R, S, I);
}
const b = f.fn({
...a,
[w]: y,
[x]: S
});
return {
...b,
data: {
x: b.x - r,
y: b.y - l
}
};
}
};
}, Yb = function(n) {
return n === void 0 && (n = {}), {
name: "size",
options: n,
async fn(a) {
const {
placement: r,
rects: l,
platform: o,
elements: s
} = a, {
apply: d = () => {
},
...f
} = Rn(n, a), p = await Ir(a, f), h = Jt(r), m = ln(r), x = Vr(r) === "y", {
width: w,
height: y
} = l.floating;
let S, b;
h === "top" || h === "bottom" ? (S = h, b = m === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (b = h, S = m === "end" ? "top" : "bottom");
const B = y - p[S], C = w - p[b], R = !a.middlewareData.shift;
let I = B, E = C;
if (x) {
const V = w - p.left - p.right;
E = m || R ? on(C, V) : V;
} else {
const V = y - p.top - p.bottom;
I = m || R ? on(B, V) : V;
}
if (R && !m) {
const V = pt(p.left, 0), W = pt(p.right, 0), le = pt(p.top, 0), ue = pt(p.bottom, 0);
x ? E = w - 2 * (V !== 0 || W !== 0 ? V + W : pt(p.left, p.right)) : I = y - 2 * (le !== 0 || ue !== 0 ? le + ue : pt(p.top, p.bottom));
}
await d({
...a,
availableWidth: E,
availableHeight: I
});
const L = await o.getDimensions(s.floating);
return w !== L.width || y !== L.height ? {
reset: {
rects: !0
}
} : {};
}
};
};
function En(n) {
return Ro(n) ? (n.nodeName || "").toLowerCase() : "#document";
}
function Pt(n) {
var a;
return (n == null || (a = n.ownerDocument) == null ? void 0 : a.defaultView) || window;
}
function Ln(n) {
var a;
return (a = (Ro(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : a.documentElement;
}
function Ro(n) {
return n instanceof Node || n instanceof Pt(n).Node;
}
function On(n) {
return n instanceof Element || n instanceof Pt(n).Element;
}
function hn(n) {
return n instanceof HTMLElement || n instanceof Pt(n).HTMLElement;
}
function kd(n) {
return typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof Pt(n).ShadowRoot;
}
function ga(n) {
const {
overflow: a,
overflowX: r,
overflowY: l,
display: o
} = jt(n);
return /auto|scroll|overlay|hidden|clip/.test(a + l + r) && !["inline", "contents"].includes(o);
}
function Zb(n) {
return ["table", "td", "th"].includes(En(n));
}
function Lo(n) {
const a = $o(), r = jt(n);
return r.transform !== "none" || r.perspective !== "none" || (r.containerType ? r.containerType !== "normal" : !1) || !a && (r.backdropFilter ? r.backdropFilter !== "none" : !1) || !a && (r.filter ? r.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((l) => (r.willChange || "").includes(l)) || ["paint", "layout", "strict", "content"].some((l) => (r.contain || "").includes(l));
}
function Qb(n) {
let a = Pr(n);
for (; hn(a) && !Al(a); ) {
if (Lo(a))
return a;
a = Pr(a);
}
return null;
}
function $o() {
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function Al(n) {
return ["html", "body", "#document"].includes(En(n));
}
function jt(n) {
return Pt(n).getComputedStyle(n);
}
function El(n) {
return On(n) ? {
scrollLeft: n.scrollLeft,
scrollTop: n.scrollTop
} : {
scrollLeft: n.pageXOffset,
scrollTop: n.pageYOffset
};
}
function Pr(n) {
if (En(n) === "html")
return n;
const a = (
// Step into the shadow DOM of the parent of a slotted node.
n.assignedSlot || // DOM Element detected.
n.parentNode || // ShadowRoot detected.
kd(n) && n.host || // Fallback.
Ln(n)
);
return kd(a) ? a.host : a;
}
function xf(n) {
const a = Pr(n);
return Al(a) ? n.ownerDocument ? n.ownerDocument.body : n.body : hn(a) && ga(a) ? a : xf(a);
}
function ca(n, a, r) {
var l;
a === void 0 && (a = []), r === void 0 && (r = !0);
const o = xf(n), s = o === ((l = n.ownerDocument) == null ? void 0 : l.body), d = Pt(o);
return s ? a.concat(d, d.visualViewport || [], ga(o) ? o : [], d.frameElement && r ? ca(d.frameElement) : []) : a.concat(o, ca(o, [], r));
}
function Bf(n) {
const a = jt(n);
let r = parseFloat(a.width) || 0, l = parseFloat(a.height) || 0;
const o = hn(n), s = o ? n.offsetWidth : r, d = o ? n.offsetHeight : l, f = _l(r) !== s || _l(l) !== d;
return f && (r = s, l = d), {
width: r,
height: l,
$: f
};
}
function Fo(n) {
return On(n) ? n : n.contextElement;
}
function $r(n) {
const a = Fo(n);
if (!hn(a))
return Gn(1);
const r = a.getBoundingClientRect(), {
width: l,
height: o,
$: s
} = Bf(a);
let d = (s ? _l(r.width) : r.width) / l, f = (s ? _l(r.height) : r.height) / o;
return (!d || !Number.isFinite(d)) && (d = 1), (!f || !Number.isFinite(f)) && (f = 1), {
x: d,
y: f
};
}
const e_ = /* @__PURE__ */ Gn(0);
function Sf(n) {
const a = Pt(n);
return !$o() || !a.visualViewport ? e_ : {
x: a.visualViewport.offsetLeft,
y: a.visualViewport.offsetTop
};
}
function t_(n, a, r) {
return a === void 0 && (a = !1), !r || a && r !== Pt(n) ? !1 : a;
}
function or(n, a, r, l) {
a === void 0 && (a = !1), r === void 0 && (r = !1);
const o = n.getBoundingClientRect(), s = Fo(n);
let d = Gn(1);
a && (l ? On(l) && (d = $r(l)) : d = $r(n));
const f = t_(s, r, l) ? Sf(s) : Gn(0);
let p = (o.left + f.x) / d.x, h = (o.top + f.y) / d.y, m = o.width / d.x, x = o.height / d.y;
if (s) {
const w = Pt(s), y = l && On(l) ? Pt(l) : l;
let S = w, b = S.frameElement;
for (; b && l && y !== S; ) {
const B = $r(b), C = b.getBoundingClientRect(), R = jt(b), I = C.left + (b.clientLeft + parseFloat(R.paddingLeft)) * B.x, E = C.top + (b.clientTop + parseFloat(R.paddingTop)) * B.y;
p *= B.x, h *= B.y, m *= B.x, x *= B.y, p += I, h += E, S = Pt(b), b = S.frameElement;
}
}
return Fr({
width: m,
height: x,
x: p,
y: h
});
}
const n_ = [":popover-open", ":modal"];
function Cf(n) {
return n_.some((a) => {
try {
return n.matches(a);
} catch {
return !1;
}
});
}
function r_(n) {
let {
elements: a,
rect: r,
offsetParent: l,
strategy: o
} = n;
const s = o === "fixed", d = Ln(l), f = a ? Cf(a.floating) : !1;
if (l === d || f && s)
return r;
let p = {
scrollLeft: 0,
scrollTop: 0
}, h = Gn(1);
const m = Gn(0), x = hn(l);
if ((x || !x && !s) && ((En(l) !== "body" || ga(d)) && (p = El(l)), hn(l))) {
const w = or(l);
h = $r(l), m.x = w.x + l.clientLeft, m.y = w.y + l.clientTop;
}
return {
width: r.width * h.x,
height: r.height * h.y,
x: r.x * h.x - p.scrollLeft * h.x + m.x,
y: r.y * h.y - p.scrollTop * h.y + m.y
};
}
function a_(n) {
return Array.from(n.getClientRects());
}
function Tf(n) {
return or(Ln(n)).left + El(n).scrollLeft;
}
function l_(n) {
const a = Ln(n), r = El(n), l = n.ownerDocument.body, o = pt(a.scrollWidth, a.clientWidth, l.scrollWidth, l.clientWidth), s = pt(a.scrollHeight, a.clientHeight, l.scrollHeight, l.clientHeight);
let d = -r.scrollLeft + Tf(n);
const f = -r.scrollTop;
return jt(l).direction === "rtl" && (d += pt(a.clientWidth, l.clientWidth) - o), {
width: o,
height: s,
x: d,
y: f
};
}
function i_(n, a) {
const r = Pt(n), l = Ln(n), o = r.visualViewport;
let s = l.clientWidth, d = l.clientHeight, f = 0, p = 0;
if (o) {
s = o.width, d = o.height;
const h = $o();
(!h || h && a === "fixed") && (f = o.offsetLeft, p = o.offsetTop);
}
return {
width: s,
height: d,
x: f,
y: p
};
}
function o_(n, a) {
const r = or(n, !0, a === "fixed"), l = r.top + n.clientTop, o = r.left + n.clientLeft, s = hn(n) ? $r(n) : Gn(1), d = n.clientWidth * s.x, f = n.clientHeight * s.y, p = o * s.x, h = l * s.y;
return {
width: d,
height: f,
x: p,
y: h
};
}
function Ad(n, a, r) {
let l;
if (a === "viewport")
l = i_(n, r);
else if (a === "document")
l = l_(Ln(n));
else if (On(a))
l = o_(a, r);
else {
const o = Sf(n);
l = {
...a,
x: a.x - o.x,
y: a.y - o.y
};
}
return Fr(l);
}
function kf(n, a) {
const r = Pr(n);
return r === a || !On(r) || Al(r) ? !1 : jt(r).position === "fixed" || kf(r, a);
}
function s_(n, a) {
const r = a.get(n);
if (r)
return r;
let l = ca(n, [], !1).filter((f) => On(f) && En(f) !== "body"), o = null;
const s = jt(n).position === "fixed";
let d = s ? Pr(n) : n;
for (; On(d) && !Al(d); ) {
const f = jt(d), p = Lo(d);
!p && f.position === "fixed" && (o = null), (s ? !p && !o : !p && f.position === "static" && o && ["absolute", "fixed"].includes(o.position) || ga(d) && !p && kf(n, d)) ? l = l.filter((h) => h !== d) : o = f, d = Pr(d);
}
return a.set(n, l), l;
}
function u_(n) {
let {
element: a,
boundary: r,
rootBoundary: l,
strategy: o
} = n;
const s = [...r === "clippingAncestors" ? s_(a, this._c) : [].concat(r), l], d = s[0], f = s.reduce((p, h) => {
const m = Ad(a, h, o);
return p.top = pt(m.top, p.top), p.right = on(m.right, p.right), p.bottom = on(m.bottom, p.bottom), p.left = pt(m.left, p.left), p;
}, Ad(a, d, o));
return {
width: f.right - f.left,
height: f.bottom - f.top,
x: f.left,
y: f.top
};
}
function d_(n) {
const {
width: a,
height: r
} = Bf(n);
return {
width: a,
height: r
};
}
function f_(n, a, r) {
const l = hn(a), o = Ln(a), s = r === "fixed", d = or(n, !0, s, a);
let f = {
scrollLeft: 0,
scrollTop: 0
};
const p = Gn(0);
if (l || !l && !s)
if ((En(a) !== "body" || ga(o)) && (f = El(a)), l) {
const x = or(a, !0, s, a);
p.x = x.x + a.clientLeft, p.y = x.y + a.clientTop;
} else
o && (p.x = Tf(o));
const h = d.left + f.scrollLeft - p.x, m = d.top + f.scrollTop - p.y;
return {
x: h,
y: m,
width: d.width,
height: d.height
};
}
function Ed(n, a) {
return !hn(n) || jt(n).position === "fixed" ? null : a ? a(n) : n.offsetParent;
}
function Af(n, a) {
const r = Pt(n);
if (!hn(n) || Cf(n))
return r;
let l = Ed(n, a);
for (; l && Zb(l) && jt(l).position === "static"; )
l = Ed(l, a);
return l && (En(l) === "html" || En(l) === "body" && jt(l).position === "static" && !Lo(l)) ? r : l || Qb(n) || r;
}
const c_ = async function(n) {
const a = this.getOffsetParent || Af, r = this.getDimensions;
return {
reference: f_(n.reference, await a(n.floating), n.strategy),
floating: {
x: 0,
y: 0,
...await r(n.floating)
}
};
};
function p_(n) {
return jt(n).direction === "rtl";
}
const v_ = {
convertOffsetParentRelativeRectToViewportRelativeRect: r_,
getDocumentElement: Ln,
getClippingRect: u_,
getOffsetParent: Af,
getElementRects: c_,
getClientRects: a_,
getDimensions: d_,
getScale: $r,
isElement: On,
isRTL: p_
};
function h_(n, a) {
let r = null, l;
const o = Ln(n);
function s() {
var f;
clearTimeout(l), (f = r) == null || f.disconnect(), r = null;
}
function d(f, p) {
f === void 0 && (f = !1), p === void 0 && (p = 1), s();
const {
left: h,
top: m,
width: x,
height: w
} = n.getBoundingClientRect();
if (f || a(), !x || !w)
return;
const y = cl(m), S = cl(o.clientWidth - (h + x)), b = cl(o.clientHeight - (m + w)), B = cl(h), C = {
rootMargin: -y + "px " + -S + "px " + -b + "px " + -B + "px",
threshold: pt(0, on(1, p)) || 1
};
let R = !0;
function I(E) {
const L = E[0].intersectionRatio;
if (L !== p) {
if (!R)
return d();
L ? d(!1, L) : l = setTimeout(() => {
d(!1, 1e-7);
}, 100);
}
R = !1;
}
try {
r = new IntersectionObserver(I, {
...C,
// Handle <iframe>s
root: o.ownerDocument
});
} catch {
r = new IntersectionObserver(I, C);
}
r.observe(n);
}
return d(!0), s;
}
function Ef(n, a, r, l) {
l === void 0 && (l = {});
const {
ancestorScroll: o = !0,
ancestorResize: s = !0,
elementResize: d = typeof ResizeObserver == "function",
layoutShift: f = typeof IntersectionObserver == "function",
animationFrame: p = !1
} = l, h = Fo(n), m = o || s ? [...h ? ca(h) : [], ...ca(a)] : [];
m.forEach((C) => {
o && C.addEventListener("scroll", r, {
passive: !0
}), s && C.addEventListener("resize", r);
});
const x = h && f ? h_(h, r) : null;
let w = -1, y = null;
d && (y = new ResizeObserver((C) => {
let [R] = C;
R && R.target === h && y && (y.unobserve(a), cancelAnimationFrame(w), w = requestAnimationFrame(() => {
var I;
(I = y) == null || I.observe(a);
})), r();
}), h && !p && y.observe(h), y.observe(a));
let S, b = p ? or(n) : null;
p && B();
function B() {
const C = or(n);
b && (C.x !== b.x || C.y !== b.y || C.width !== b.width || C.height !== b.height) && r(), b = C, S = requestAnimationFrame(B);
}
return r(), () => {
var C;
m.forEach((R) => {
o && R.removeEventListener("scroll", r), s && R.removeEventListener("resize", r);
}), x == null || x(), (C = y) == null || C.disconnect(), y = null, p && cancelAnimationFrame(S);
};
}
const g_ = Wb, Of = jb, Rf = qb, Lf = Yb, m_ = Gb, y_ = Hb, b_ = Xb, __ = (n, a, r) => {
const l = /* @__PURE__ */ new Map(), o = {
platform: v_,
...r
}, s = {
...o.platform,
_c: l
};
return Mb(n, a, {
...o,
platform: s
});
};
function w_(n) {
return n != null && typeof n == "object" && "$el" in n;
}
function yo(n) {
if (w_(n)) {
const a = n.$el;
return Ro(a) && En(a) === "#comment" ? null : a;
}
return n;
}
function x_(n) {
return {
name: "arrow",
options: n,
fn(a) {
const r = yo(J(n.element));
return r == null ? {} : y_({
element: r,
padding: n.padding
}).fn(a);
}
};
}
function $f(n) {
return typeof window > "u" ? 1 : (n.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function Od(n, a) {
const r = $f(n);
return Math.round(a * r) / r;
}
function Ff(n, a, r) {
r === void 0 && (r = {});
const l = r.whileElementsMounted, o = P(() => {
var W;
return (W = J(r.open)) != null ? W : !0;
}), s = P(() => J(r.middleware)), d = P(() => {
var W;
return (W = J(r.placement)) != null ? W : "bottom";
}), f = P(() => {
var W;
return (W = J(r.strategy)) != null ? W : "absolute";
}), p = P(() => {
var W;
return (W = J(r.transform)) != null ? W : !0;
}), h = P(() => yo(n.value)), m = P(() => yo(a.value)), x = re(0), w = re(0), y = re(f.value), S = re(d.value), b = ff({}), B = re(!1), C = P(() => {
const W = {
position: y.value,
left: "0",
top: "0"
};
if (!m.value)
return W;
const le = Od(m.value, x.value), ue = Od(m.value, w.value);
return p.value ? {
...W,
transform: "translate(" + le + "px, " + ue + "px)",
...$f(m.value) >= 1.5 && {
willChange: "transform"
}
} : {
position: y.value,
left: le + "px",
top: ue + "px"
};
});
let R;
function I() {
h.value == null || m.value == null || __(h.value, m.value, {
middleware: s.value,
placement: d.value,
strategy: f.value
}).then((W) => {
x.value = W.x, w.value = W.y, y.value = W.strategy, S.value = W.placement, b.value = W.middlewareData, B.value = !0;
});
}
function E() {
typeof R == "function" && (R(), R = void 0);
}
function L() {
if (E(), l === void 0) {
I();
return;
}
if (h.value != null && m.value != null) {
R = l(h.value, m.value, I);
return;
}
}
function V() {
o.value || (B.value = !1);
}
return qe([s, d, f], I, {
flush: "sync"
}), qe([h, m], L, {
flush: "sync"
}), qe(o, V, {
flush: "sync"
}), cf() && pf(E), {
x: kr(x),
y: kr(w),
strategy: kr(y),
placement: kr(S),
middlewareData: kr(b),
isPositioned: kr(B),
floatingStyles: C,
update: I
};
}
const B_ = /* @__PURE__ */ new Set([
"background",
"cite",
"href",
"itemtype",
"longdesc",
"poster",
"src",
"xlink:href"
]), S_ = /^aria-[\w-]*$/i, C_ = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i, T_ = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i, k_ = (n, a) => {
const r = n.nodeName.toLowerCase();
return a.includes(r) ? B_.has(r) ? !!(C_.test(n.nodeValue || "") || T_.test(n.nodeValue || "")) : !0 : a.filter((l) => l instanceof RegExp).some((l) => l.test(r));
}, Rr = {
// Global attributes allowed on any supplied element below.
"*": ["class", "dir", "id", "lang", "role", S_],
a: ["target", "href", "title", "rel"],
area: [],
b: [],
br: [],
col: [],
code: [],
div: [],
em: [],
hr: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
i: [],
img: ["src", "srcset", "alt", "title", "width", "height"],
li: [],
ol: [],
p: [],
pre: [],
s: [],
small: [],
span: [],
sub: [],
sup: [],
strong: [],
u: [],
ul: []
}, Lr = (n, a, r) => {
if (!n.length)
return n;
const l = new window.DOMParser().parseFromString(n, "text/html"), o = l.body.querySelectorAll("*");
for (const s of o) {
const d = s.nodeName.toLowerCase();
if (!Object.keys(a).includes(d)) {
s.remove();
continue;
}
const f = s.attributes, p = [...a["*"] || [], ...a[d] || []];
for (const h of f)
k_(h, p) || s.removeAttribute(h.nodeName);
}
return l.body.innerHTML;
};
function Ol(n) {
return cf() ? (pf(n), !0) : !1;
}
function A_(n, a) {
if (typeof Symbol < "u") {
const r = { ...n };
return Object.defineProperty(r, Symbol.iterator, {
enumerable: !1,
value() {
let l = 0;
return {
next: () => ({
value: a[l++],
done: l > a.length
})
};
}
}), r;
} else
return Object.assign([...a], n);
}
function An(n) {
return typeof n == "function" ? n() : J(n);
}
const If = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const E_ = (n) => typeof n < "u", O_ = Object.prototype.toString, R_ = (n) => O_.call(n) === "[object Object]", ar = () => {
}, bo = /* @__PURE__ */ L_();
function L_() {
var n, a;
return If && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((a = window == null ? void 0 : window.navigator) == null ? void 0 : a.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
}
function $_(n, a) {
function r(...l) {
return new Promise((o, s) => {
Promise.resolve(n(() => a.apply(this, l), { fn: a, thisArg: this, args: l })).then(o).catch(s);
});
}
return r;
}
function F_(n, a = {}) {
let r, l, o = ar;
const s = (d) => {
clearTimeout(d), o(), o = ar;
};
return (d) => {
const f = An(n), p = An(a.maxWait);
return r && s(r), f <= 0 || p !== void 0 && p <= 0 ? (l && (s(l), l = null), Promise.resolve(d())) : new Promise((h, m) => {
o = a.rejectOnCancel ? m : h, p && !l && (l = setTimeout(() => {
r && s(r), l = null, h(d());
}, p)), r = setTimeout(() => {
l && s(l), l = null, h(d());
}, f);
});
};
}
function I_(n) {
const a = /* @__PURE__ */ Object.create(null);
return (r) => a[r] || (a[r] = n(r));
}
const P_ = /-(\w)/g, N_ = I_((n) => n.replace(P_, (a, r) => r ? r.toUpperCase() : ""));
function V_(...n) {
if (n.length !== 1)
return H(...n);
const a = n[0];
return typeof a == "function" ? go(Cb(() => ({ get: a, set: ar }))) : re(a);
}
function D_(n, a = 200, r = {}) {
return $_(
F_(a, r),
n
);
}
function It(n, a = {}) {
const {
method: r = "parseFloat",
radix: l,
nanToZero: o
} = a;
return P(() => {
let s = An(n);
return typeof s == "string" && (s = Number[r](s, l)), o && Number.isNaN(s) && (s = 0), s;
});
}
function Pf(n = {}) {
const {
inheritAttrs: a = !0
} = n, r = ff(), l = /* @__PURE__ */ ie({
setup(s, { slots: d }) {
return () => {
r.value = d.default;
};
}
}), o = /* @__PURE__ */ ie({
inheritAttrs: a,
setup(s, { attrs: d, slots: f }) {
return () => {
var p;
if (!r.value && Eb.NODE_ENV !== "production")
throw new Error("[VueUse] Failed to find the definition of reusable template");
const h = (p = r.value) == null ? void 0 : p.call(r, { ...z_(d), $slots: f });
return a && (h == null ? void 0 : h.length) === 1 ? h[0] : h;
};
}
});
return A_(
{ define: l, reuse: o },
[l, o]
);
}
function z_(n) {
const a = {};
for (const r in n)
a[N_(r)] = n[r];
return a;
}
function Wn(n) {
var a;
const r = An(n);
return (a = r == null ? void 0 : r.$el) != null ? a : r;
}
const ma = If ? window : void 0;
function St(...n) {
let a, r, l, o;
if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([r, l, o] = n, a = ma) : [a, r, l, o] = n, !a)
return ar;
Array.isArray(r) || (r = [r]), Array.isArray(l) || (l = [l]);
const s = [], d = () => {
s.forEach((m) => m()), s.length = 0;
}, f = (m, x, w, y) => (m.addEventListener(x, w, y), () => m.removeEventListener(x, w, y)), p = qe(
() => [Wn(a), An(o)],
([m, x]) => {
if (d(), !m)
return;
const w = R_(x) ? { ...x } : x;
s.push(
...r.flatMap((y) => l.map((S) => f(m, y, S, w)))
);
},
{ immediate: !0, flush: "post" }
), h = () => {
p(), d();
};
return Ol(h), h;
}
let Rd = !1;
function Nf(n, a, r = {}) {
const { window: l = ma, ignore: o = [], capture: s = !0, detectIframe: d = !1 } = r;
if (!l)
return ar;
bo && !Rd && (Rd = !0, Array.from(l.document.body.children).forEach((m) => m.addEventListener("click", ar)), l.document.documentElement.addEventListener("click", ar));
let f = !0;
const p = (m) => o.some((x) => {
if (typeof x == "string")
return Array.from(l.document.querySelectorAll(x)).some((w) => w === m.target || m.composedPath().includes(w));
{
const w = Wn(x);
return w && (m.target === w || m.composedPath().includes(w));
}
}), h = [
St(l, "click", (m) => {
const x = Wn(n);
if (!(!x || x === m.target || m.composedPath().includes(x))) {
if (m.detail === 0 && (f = !p(m)), !f) {
f = !0;
return;
}
a(m);
}
}, { passive: !0, capture: s }),
St(l, "pointerdown", (m) => {
const x = Wn(n);
f = !p(m) && !!(x && !m.composedPath().includes(x));
}, { passive: !0 }),
d && St(l, "blur", (m) => {
setTimeout(() => {
var x;
const w = Wn(n);
((x = l.document.activeElement) == null ? void 0 : x.tagName) === "IFRAME" && !(w != null && w.contains(l.document.activeElement)) && a(m);
}, 0);
})
].filter(Boolean);
return () => h.forEach((m) => m());
}
function M_(n) {
return typeof n == "function" ? n : typeof n == "string" ? (a) => a.key === n : Array.isArray(n) ? (a) => n.includes(a.key) : () => !0;
}
function Un(...n) {
let a, r, l = {};
n.length === 3 ? (a = n[0], r = n[1], l = n[2]) : n.length === 2 ? typeof n[1] == "object" ? (a = !0, r = n[0], l = n[1]) : (a = n[0], r = n[1]) : (a = !0, r = n[0]);
const {
target: o = ma,
eventName: s = "keydown",
passive: d = !1,
dedupe: f = !1
} = l, p = M_(a);
return St(o, s, (h) => {
h.repeat && An(f) || p(h) && r(h);
}, d);
}
function H_(n) {
return JSON.parse(JSON.stringify(n));
}
const pl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, vl = "__vueuse_ssr_handlers__", U_ = /* @__PURE__ */ W_();
function W_() {
return vl in pl || (pl[vl] = pl[vl] || {}), pl[vl];
}
function q_(n, a) {
return U_[n] || a;
}
function an(n, a = {}) {
const { initialValue: r = !1, focusVisible: l = !1 } = a, o = re(!1), s = P(() => Wn(n));
St(s, "focus", (f) => {
var p, h;
(!l || (h = (p = f.target).matches) != null && h.call(p, ":focus-visible")) && (o.value = !0);
}), St(s, "blur", () => o.value = !1);
const d = P({
get: () => o.value,
set(f) {
var p, h;
!f && o.value ? (p = s.value) == null || p.blur() : f && !o.value && ((h = s.value) == null || h.focus());
}
});
return qe(
s,
() => {
d.value = r;
},
{ immediate: !0, flush: "post" }
), { focused: d };
}
function oo(n) {
return typeof Window < "u" && n instanceof Window ? n.document.documentElement : typeof Document < "u" && n instanceof Document ? n.documentElement : n;
}
const G_ = {
page: (n) => [n.pageX, n.pageY],
client: (n) => [n.clientX, n.clientY],
screen: (n) => [n.screenX, n.screenY],
movement: (n) => n instanceof Touch ? null : [n.movementX, n.movementY]
};
function K_(n = {}) {
const {
type: a = "page",
touch: r = !0,
resetOnTouchEnds: l = !1,
initialValue: o = { x: 0, y: 0 },
window: s = ma,
target: d = s,
scroll: f = !0,
eventFilter: p
} = n;
let h = null;
const m = re(o.x), x = re(o.y), w = re(null), y = typeof a == "function" ? a : G_[a], S = (L) => {
const V = y(L);
h = L, V && ([m.value, x.value] = V, w.value = "mouse");
}, b = (L) => {
if (L.touches.length > 0) {
const V = y(L.touches[0]);
V && ([m.value, x.value] = V, w.value = "touch");
}
}, B = () => {
if (!h || !s)
return;
const L = y(h);
h instanceof MouseEvent && L && (m.value = L[0] + s.scrollX, x.value = L[1] + s.scrollY);
}, C = () => {
m.value = o.x, x.value = o.y;
}, R = p ? (L) => p(() => S(L), {}) : (L) => S(L), I = p ? (L) => p(() => b(L), {}) : (L) => b(L), E = p ? () => p(() => B(), {}) : () => B();
if (d) {
const L = { passive: !0 };
St(d, ["mousemove", "dragover"], R, L), r && a !== "movement" && (St(d, ["touchstart", "touchmove"], I, L), l && St(d, "touchend", C, L)), f && a === "page" && St(s, "scroll", E, { passive: !0 });
}
return {
x: m,
y: x,
sourceType: w
};
}
function Ld(n, a = {}) {
const {
handleOutside: r = !0,
window: l = ma
} = a, o = a.type || "page", { x: s, y: d, sourceType: f } = K_(a), p = re(n ?? (l == null ? void 0 : l.document.body)), h = re(0), m = re(0), x = re(0), w = re(0), y = re(0), S = re(0), b = re(!0);
let B = () => {
};
return l && (B = qe(
[p, s, d],
() => {
const C = Wn(p);
if (!C)
return;
const {
left: R,
top: I,
width: E,
height: L
} = C.getBoundingClientRect();
x.value = R + (o === "page" ? l.pageXOffset : 0), w.value = I + (o === "page" ? l.pageYOffset : 0), y.value = L, S.value = E;
const V = s.value - x.value, W = d.value - w.value;
b.value = E === 0 || L === 0 || V < 0 || W < 0 || V > E || W > L, (r || !b.value) && (h.value = V, m.value = W);
},
{ immediate: !0 }
), St(document, "mouseleave", () => {
b.value = !0;
})), {
x: s,
y: d,
sourceType: f,
elementX: h,
elementY: m,
elementPositionX: x,
elementPositionY: w,
elementHeight: y,
elementWidth: S,
isOutside: b,
stop: B
};
}
function Vf(n) {
const a = window.getComputedStyle(n);
if (a.overflowX === "scroll" || a.overflowY === "scroll" || a.overflowX === "auto" && n.clientWidth < n.scrollWidth || a.overflowY === "auto" && n.clientHeight < n.scrollHeight)
return !0;
{
const r = n.parentNode;
return !r || r.tagName === "BODY" ? !1 : Vf(r);
}
}
function X_(n) {
const a = n || window.event, r = a.target;
return Vf(r) ? !1 : a.touches.length > 1 ? !0 : (a.preventDefault && a.preventDefault(), !1);
}
const hl = /* @__PURE__ */ new WeakMap();
function J_(n, a = !1) {
const r = re(a);
let l = null;
qe(V_(n), (d) => {
const f = oo(An(d));
if (f) {
const p = f;
hl.get(p) || hl.set(p, p.style.overflow), r.value && (p.style.overflow = "hidden");
}
}, {
immediate: !0
});
const o = () => {
const d = oo(An(n));
!d || r.value || (bo && (l = St(
d,
"touchmove",
(f) => {