import { jsx as Y, jsxs as Xe, Fragment as Ct } from "react/jsx-runtime";
import * as S from "react";
import ke, { useRef as le, useCallback as Ge, useEffect as Ee, useState as $e, useMemo as Ye, useLayoutEffect as Xi, useContext as Ke, createContext as dt, forwardRef as fb, Fragment as mt, isValidElement as lc, cloneElement as cc, createElement as Kx, useId as Or, useReducer as Xx, useSyncExternalStore as Qx } from "react";
import * as na from "react-dom";
import Jx, { createPortal as Zx, flushSync as uc, unstable_batchedUpdates as ew } from "react-dom";
const db = typeof document < "u" ? ke.useLayoutEffect : () => {
};
function tw(e) {
const t = le(null);
return db(() => {
t.current = e;
}, [
e
]), Ge((...n) => {
const r = t.current;
return r == null ? void 0 : r(...n);
}, []);
}
const tr = (e) => {
var t;
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
}, rr = (e) => e && "window" in e && e.window === e ? e : tr(e).defaultView || window;
function nw(e) {
return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number";
}
function rw(e) {
return nw(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e;
}
let ow = !1;
function af() {
return ow;
}
function pb(e, t) {
if (!af()) return t && e ? e.contains(t) : !1;
if (!e || !t) return !1;
let n = t;
for (; n !== null; ) {
if (n === e) return !0;
n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : rw(n) ? n = n.host : n = n.parentNode;
}
return !1;
}
const fc = (e = document) => {
var t;
if (!af()) return e.activeElement;
let n = e.activeElement;
for (; n && "shadowRoot" in n && (!((t = n.shadowRoot) === null || t === void 0) && t.activeElement); ) n = n.shadowRoot.activeElement;
return n;
};
function mb(e) {
return af() && e.target.shadowRoot && e.composedPath ? e.composedPath()[0] : e.target;
}
function aw(e) {
var t;
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
}
function iw(e) {
var t;
return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
}
function gb(e) {
let t = null;
return () => (t == null && (t = e()), t);
}
const sw = gb(function() {
return iw(/^Mac/i);
}), lw = gb(function() {
return aw(/Android/i);
});
function hb() {
let e = le(/* @__PURE__ */ new Map()), t = Ge((o, a, i, s) => {
let l = s != null && s.once ? (...c) => {
e.current.delete(i), i(...c);
} : i;
e.current.set(i, {
type: a,
eventTarget: o,
fn: l,
options: s
}), o.addEventListener(a, l, s);
}, []), n = Ge((o, a, i, s) => {
var l;
let c = ((l = e.current.get(i)) === null || l === void 0 ? void 0 : l.fn) || i;
o.removeEventListener(a, c, s), e.current.delete(i);
}, []), r = Ge(() => {
e.current.forEach((o, a) => {
n(o.eventTarget, o.type, a, o.options);
});
}, [
n
]);
return Ee(() => r, [
r
]), {
addGlobalListener: t,
removeGlobalListener: n,
removeAllGlobalListeners: r
};
}
function cw(e) {
return e.mozInputSource === 0 && e.isTrusted ? !0 : lw() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
}
class bb {
isDefaultPrevented() {
return this.nativeEvent.defaultPrevented;
}
preventDefault() {
this.defaultPrevented = !0, this.nativeEvent.preventDefault();
}
stopPropagation() {
this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0;
}
isPropagationStopped() {
return !1;
}
persist() {
}
constructor(t, n) {
this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t;
}
}
function yb(e) {
let t = le({
isFocused: !1,
observer: null
});
db(() => {
const r = t.current;
return () => {
r.observer && (r.observer.disconnect(), r.observer = null);
};
}, []);
let n = tw((r) => {
e == null || e(r);
});
return Ge((r) => {
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
t.current.isFocused = !0;
let o = r.target, a = (i) => {
t.current.isFocused = !1, o.disabled && n(new bb("blur", i)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
};
o.addEventListener("focusout", a, {
once: !0
}), t.current.observer = new MutationObserver(() => {
if (t.current.isFocused && o.disabled) {
var i;
(i = t.current.observer) === null || i === void 0 || i.disconnect();
let s = o === document.activeElement ? null : document.activeElement;
o.dispatchEvent(new FocusEvent("blur", {
relatedTarget: s
})), o.dispatchEvent(new FocusEvent("focusout", {
bubbles: !0,
relatedTarget: s
}));
}
}), t.current.observer.observe(o, {
attributes: !0,
attributeFilter: [
"disabled"
]
});
}
}, [
n
]);
}
let uw = !1, Sa = null, dc = /* @__PURE__ */ new Set(), Wo = /* @__PURE__ */ new Map(), ur = !1, pc = !1;
const fw = {
Tab: !0,
Escape: !0
};
function sf(e, t) {
for (let n of dc) n(e, t);
}
function dw(e) {
return !(e.metaKey || !sw() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
}
function Oi(e) {
ur = !0, dw(e) && (Sa = "keyboard", sf("keyboard", e));
}
function Ot(e) {
Sa = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (ur = !0, sf("pointer", e));
}
function vb(e) {
cw(e) && (ur = !0, Sa = "virtual");
}
function xb(e) {
e.target === window || e.target === document || uw || !e.isTrusted || (!ur && !pc && (Sa = "virtual", sf("virtual", e)), ur = !1, pc = !1);
}
function wb() {
ur = !1, pc = !0;
}
function mc(e) {
if (typeof window > "u" || Wo.get(rr(e))) return;
const t = rr(e), n = tr(e);
let r = t.HTMLElement.prototype.focus;
t.HTMLElement.prototype.focus = function() {
ur = !0, r.apply(this, arguments);
}, n.addEventListener("keydown", Oi, !0), n.addEventListener("keyup", Oi, !0), n.addEventListener("click", vb, !0), t.addEventListener("focus", xb, !0), t.addEventListener("blur", wb, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", Ot, !0), n.addEventListener("pointermove", Ot, !0), n.addEventListener("pointerup", Ot, !0)) : (n.addEventListener("mousedown", Ot, !0), n.addEventListener("mousemove", Ot, !0), n.addEventListener("mouseup", Ot, !0)), t.addEventListener("beforeunload", () => {
kb(e);
}, {
once: !0
}), Wo.set(t, {
focus: r
});
}
const kb = (e, t) => {
const n = rr(e), r = tr(e);
t && r.removeEventListener("DOMContentLoaded", t), Wo.has(n) && (n.HTMLElement.prototype.focus = Wo.get(n).focus, r.removeEventListener("keydown", Oi, !0), r.removeEventListener("keyup", Oi, !0), r.removeEventListener("click", vb, !0), n.removeEventListener("focus", xb, !0), n.removeEventListener("blur", wb, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", Ot, !0), r.removeEventListener("pointermove", Ot, !0), r.removeEventListener("pointerup", Ot, !0)) : (r.removeEventListener("mousedown", Ot, !0), r.removeEventListener("mousemove", Ot, !0), r.removeEventListener("mouseup", Ot, !0)), Wo.delete(n));
};
function pw(e) {
const t = tr(e);
let n;
return t.readyState !== "loading" ? mc(e) : (n = () => {
mc(e);
}, t.addEventListener("DOMContentLoaded", n)), () => kb(e, n);
}
typeof document < "u" && pw();
function Eb() {
return Sa !== "pointer";
}
const mw = /* @__PURE__ */ new Set([
"checkbox",
"radio",
"range",
"color",
"file",
"image",
"button",
"submit",
"reset"
]);
function gw(e, t, n) {
let r = tr(n == null ? void 0 : n.target);
const o = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, a = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, i = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLElement : HTMLElement, s = typeof window < "u" ? rr(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent;
return e = e || r.activeElement instanceof o && !mw.has(r.activeElement.type) || r.activeElement instanceof a || r.activeElement instanceof i && r.activeElement.isContentEditable, !(e && t === "keyboard" && n instanceof s && !fw[n.key]);
}
function hw(e, t, n) {
mc(), Ee(() => {
let r = (o, a) => {
gw(!!(n != null && n.isTextInput), o, a) && e(Eb());
};
return dc.add(r), () => {
dc.delete(r);
};
}, t);
}
function bw(e) {
let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: o } = e;
const a = Ge((l) => {
if (l.target === l.currentTarget)
return r && r(l), o && o(!1), !0;
}, [
r,
o
]), i = yb(a), s = Ge((l) => {
const c = tr(l.target), u = c ? fc(c) : fc();
l.target === l.currentTarget && u === mb(l.nativeEvent) && (n && n(l), o && o(!0), i(l));
}, [
o,
n,
i
]);
return {
focusProps: {
onFocus: !t && (n || o || r) ? s : void 0,
onBlur: !t && (r || o) ? a : void 0
}
};
}
function yw(e) {
let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, a = le({
isFocusWithin: !1
}), { addGlobalListener: i, removeAllGlobalListeners: s } = hb(), l = Ge((f) => {
f.currentTarget.contains(f.target) && a.current.isFocusWithin && !f.currentTarget.contains(f.relatedTarget) && (a.current.isFocusWithin = !1, s(), n && n(f), o && o(!1));
}, [
n,
o,
a,
s
]), c = yb(l), u = Ge((f) => {
if (!f.currentTarget.contains(f.target)) return;
const d = tr(f.target), p = fc(d);
if (!a.current.isFocusWithin && p === mb(f.nativeEvent)) {
r && r(f), o && o(!0), a.current.isFocusWithin = !0, c(f);
let b = f.currentTarget;
i(d, "focus", (m) => {
if (a.current.isFocusWithin && !pb(b, m.target)) {
let g = new bb("blur", new d.defaultView.FocusEvent("blur", {
relatedTarget: m.target
}));
g.target = b, g.currentTarget = b, l(g);
}
}, {
capture: !0
});
}
}, [
r,
o,
c,
i,
l
]);
return t ? {
focusWithinProps: {
// These cannot be null, that would conflict in mergeProps
onFocus: void 0,
onBlur: void 0
}
} : {
focusWithinProps: {
onFocus: u,
onBlur: l
}
};
}
let Si = !1, Fs = 0;
function gc() {
Si = !0, setTimeout(() => {
Si = !1;
}, 50);
}
function Vd(e) {
e.pointerType === "touch" && gc();
}
function vw() {
if (!(typeof document > "u"))
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", Vd) : document.addEventListener("touchend", gc), Fs++, () => {
Fs--, !(Fs > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", Vd) : document.removeEventListener("touchend", gc));
};
}
function xw(e) {
let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: o } = e, [a, i] = $e(!1), s = le({
isHovered: !1,
ignoreEmulatedMouseEvents: !1,
pointerType: "",
target: null
}).current;
Ee(vw, []);
let { addGlobalListener: l, removeAllGlobalListeners: c } = hb(), { hoverProps: u, triggerHoverEnd: f } = Ye(() => {
let d = (m, g) => {
if (s.pointerType = g, o || g === "touch" || s.isHovered || !m.currentTarget.contains(m.target)) return;
s.isHovered = !0;
let v = m.currentTarget;
s.target = v, l(tr(m.target), "pointerover", (k) => {
s.isHovered && s.target && !pb(s.target, k.target) && p(k, k.pointerType);
}, {
capture: !0
}), t && t({
type: "hoverstart",
target: v,
pointerType: g
}), n && n(!0), i(!0);
}, p = (m, g) => {
let v = s.target;
s.pointerType = "", s.target = null, !(g === "touch" || !s.isHovered || !v) && (s.isHovered = !1, c(), r && r({
type: "hoverend",
target: v,
pointerType: g
}), n && n(!1), i(!1));
}, b = {};
return typeof PointerEvent < "u" ? (b.onPointerEnter = (m) => {
Si && m.pointerType === "mouse" || d(m, m.pointerType);
}, b.onPointerLeave = (m) => {
!o && m.currentTarget.contains(m.target) && p(m, m.pointerType);
}) : (b.onTouchStart = () => {
s.ignoreEmulatedMouseEvents = !0;
}, b.onMouseEnter = (m) => {
!s.ignoreEmulatedMouseEvents && !Si && d(m, "mouse"), s.ignoreEmulatedMouseEvents = !1;
}, b.onMouseLeave = (m) => {
!o && m.currentTarget.contains(m.target) && p(m, "mouse");
}), {
hoverProps: b,
triggerHoverEnd: p
};
}, [
t,
n,
r,
o,
s,
l,
c
]);
return Ee(() => {
o && f({
currentTarget: s.target
}, s.pointerType);
}, [
o
]), {
hoverProps: u,
isHovered: a
};
}
function ww(e = {}) {
let { autoFocus: t = !1, isTextInput: n, within: r } = e, o = le({
isFocused: !1,
isFocusVisible: t || Eb()
}), [a, i] = $e(!1), [s, l] = $e(() => o.current.isFocused && o.current.isFocusVisible), c = Ge(() => l(o.current.isFocused && o.current.isFocusVisible), []), u = Ge((p) => {
o.current.isFocused = p, i(p), c();
}, [
c
]);
hw((p) => {
o.current.isFocusVisible = p, c();
}, [], {
isTextInput: n
});
let { focusProps: f } = bw({
isDisabled: r,
onFocusChange: u
}), { focusWithinProps: d } = yw({
isDisabled: !r,
onFocusWithinChange: u
});
return {
isFocused: a,
isFocusVisible: s,
focusProps: r ? d : f
};
}
var kw = Object.defineProperty, Ew = (e, t, n) => t in e ? kw(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ls = (e, t, n) => (Ew(e, typeof t != "symbol" ? t + "" : t, n), n);
let Ow = class {
constructor() {
Ls(this, "current", this.detect()), Ls(this, "handoffState", "pending"), Ls(this, "currentId", 0);
}
set(t) {
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
}
reset() {
this.set(this.detect());
}
nextId() {
return ++this.currentId;
}
get isServer() {
return this.current === "server";
}
get isClient() {
return this.current === "client";
}
detect() {
return typeof window > "u" || typeof document > "u" ? "server" : "client";
}
handoff() {
this.handoffState === "pending" && (this.handoffState = "complete");
}
get isHandoffComplete() {
return this.handoffState === "complete";
}
}, cr = new Ow();
function io(e) {
var t, n;
return cr.isServer ? null : e ? "ownerDocument" in e ? e.ownerDocument : "current" in e ? (n = (t = e.current) == null ? void 0 : t.ownerDocument) != null ? n : document : null : document;
}
function Ob(e) {
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
throw t;
}));
}
function Rt() {
let e = [], t = { addEventListener(n, r, o, a) {
return n.addEventListener(r, o, a), t.add(() => n.removeEventListener(r, o, a));
}, requestAnimationFrame(...n) {
let r = requestAnimationFrame(...n);
return t.add(() => cancelAnimationFrame(r));
}, nextFrame(...n) {
return t.requestAnimationFrame(() => t.requestAnimationFrame(...n));
}, setTimeout(...n) {
let r = setTimeout(...n);
return t.add(() => clearTimeout(r));
}, microTask(...n) {
let r = { current: !0 };
return Ob(() => {
r.current && n[0]();
}), t.add(() => {
r.current = !1;
});
}, style(n, r, o) {
let a = n.style.getPropertyValue(r);
return Object.assign(n.style, { [r]: o }), this.add(() => {
Object.assign(n.style, { [r]: a });
});
}, group(n) {
let r = Rt();
return n(r), this.add(() => r.dispose());
}, add(n) {
return e.includes(n) || e.push(n), () => {
let r = e.indexOf(n);
if (r >= 0) for (let o of e.splice(r, 1)) o();
};
}, dispose() {
for (let n of e.splice(0)) n();
} };
return t;
}
function Pa() {
let [e] = $e(Rt);
return Ee(() => () => e.dispose(), [e]), e;
}
let _e = (e, t) => {
cr.isServer ? Ee(e, t) : Xi(e, t);
};
function so(e) {
let t = le(e);
return _e(() => {
t.current = e;
}, [e]), t;
}
let we = function(e) {
let t = so(e);
return ke.useCallback((...n) => t.current(...n), [t]);
};
function Sw(e) {
let t = e.width / 2, n = e.height / 2;
return { top: e.clientY - n, right: e.clientX + t, bottom: e.clientY + n, left: e.clientX - t };
}
function Pw(e, t) {
return !(!e || !t || e.right < t.left || e.left > t.right || e.bottom < t.top || e.top > t.bottom);
}
function Aw({ disabled: e = !1 } = {}) {
let t = le(null), [n, r] = $e(!1), o = Pa(), a = we(() => {
t.current = null, r(!1), o.dispose();
}), i = we((s) => {
if (o.dispose(), t.current === null) {
t.current = s.currentTarget, r(!0);
{
let l = io(s.currentTarget);
o.addEventListener(l, "pointerup", a, !1), o.addEventListener(l, "pointermove", (c) => {
if (t.current) {
let u = Sw(c);
r(Pw(u, t.current.getBoundingClientRect()));
}
}, !1), o.addEventListener(l, "pointercancel", a, !1);
}
}
});
return { pressed: n, pressProps: e ? {} : { onPointerDown: i, onPointerUp: a, onClick: a } };
}
let Cw = dt(void 0);
function Sb() {
return Ke(Cw);
}
function hc(...e) {
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
}
function Sr(e, t, ...n) {
if (e in t) {
let o = t[e];
return typeof o == "function" ? o(...n) : o;
}
let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((o) => `"${o}"`).join(", ")}.`);
throw Error.captureStackTrace && Error.captureStackTrace(r, Sr), r;
}
var Pi = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Pi || {}), jn = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(jn || {});
function pt() {
let e = Nw();
return Ge((t) => $w({ mergeRefs: e, ...t }), [e]);
}
function $w({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, visible: a = !0, name: i, mergeRefs: s }) {
s = s ?? Iw;
let l = Pb(t, e);
if (a) return za(l, n, r, i, s);
let c = o ?? 0;
if (c & 2) {
let { static: u = !1, ...f } = l;
if (u) return za(f, n, r, i, s);
}
if (c & 1) {
let { unmount: u = !0, ...f } = l;
return Sr(u ? 0 : 1, { 0() {
return null;
}, 1() {
return za({ ...f, hidden: !0, style: { display: "none" } }, n, r, i, s);
} });
}
return za(l, n, r, i, s);
}
function za(e, t = {}, n, r, o) {
let { as: a = n, children: i, refName: s = "ref", ...l } = Ds(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, u = typeof i == "function" ? i(t) : i;
"className" in l && l.className && typeof l.className == "function" && (l.className = l.className(t)), l["aria-labelledby"] && l["aria-labelledby"] === l.id && (l["aria-labelledby"] = void 0);
let f = {};
if (t) {
let d = !1, p = [];
for (let [b, m] of Object.entries(t)) typeof m == "boolean" && (d = !0), m === !0 && p.push(b.replace(/([A-Z])/g, (g) => `-${g.toLowerCase()}`));
if (d) {
f["data-headlessui-state"] = p.join(" ");
for (let b of p) f[`data-${b}`] = "";
}
}
if (a === mt && (Object.keys(nr(l)).length > 0 || Object.keys(nr(f)).length > 0)) if (!lc(u) || Array.isArray(u) && u.length > 1) {
if (Object.keys(nr(l)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(nr(l)).concat(Object.keys(nr(f))).map((d) => ` - ${d}`).join(`
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((d) => ` - ${d}`).join(`
`)].join(`
`));
} else {
let d = u.props, p = d == null ? void 0 : d.className, b = typeof p == "function" ? (...v) => hc(p(...v), l.className) : hc(p, l.className), m = b ? { className: b } : {}, g = Pb(u.props, nr(Ds(l, ["ref"])));
for (let v in f) v in g && delete f[v];
return cc(u, Object.assign({}, g, f, c, { ref: o(Tw(u), c.ref) }, m));
}
return Kx(a, Object.assign({}, Ds(l, ["ref"]), a !== mt && c, a !== mt && f), u);
}
function Nw() {
let e = le([]), t = Ge((n) => {
for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n);
}, []);
return (...n) => {
if (!n.every((r) => r == null)) return e.current = n, t;
};
}
function Iw(...e) {
return e.every((t) => t == null) ? void 0 : (t) => {
for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
};
}
function Pb(...e) {
if (e.length === 0) return {};
if (e.length === 1) return e[0];
let t = {}, n = {};
for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o];
if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(o) => {
var a;
return (a = o == null ? void 0 : o.preventDefault) == null ? void 0 : a.call(o);
}]);
for (let r in n) Object.assign(t, { [r](o, ...a) {
let i = n[r];
for (let s of i) {
if ((o instanceof Event || (o == null ? void 0 : o.nativeEvent) instanceof Event) && o.defaultPrevented) return;
s(o, ...a);
}
} });
return t;
}
function Ab(...e) {
if (e.length === 0) return {};
if (e.length === 1) return e[0];
let t = {}, n = {};
for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o];
for (let r in n) Object.assign(t, { [r](...o) {
let a = n[r];
for (let i of a) i == null || i(...o);
} });
return t;
}
function lt(e) {
var t;
return Object.assign(fb(e), { displayName: (t = e.displayName) != null ? t : e.name });
}
function nr(e) {
let t = Object.assign({}, e);
for (let n in t) t[n] === void 0 && delete t[n];
return t;
}
function Ds(e, t = []) {
let n = Object.assign({}, e);
for (let r of t) r in n && delete n[r];
return n;
}
function Tw(e) {
return ke.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
}
let Mw = dt(void 0);
function Rw() {
return Ke(Mw);
}
function jw(e) {
let t = e.parentElement, n = null;
for (; t && !(t instanceof HTMLFieldSetElement); ) t instanceof HTMLLegendElement && (n = t), t = t.parentElement;
let r = (t == null ? void 0 : t.getAttribute("disabled")) === "";
return r && _w(n) ? !1 : r;
}
function _w(e) {
if (!e) return !1;
let t = e.previousElementSibling;
for (; t !== null; ) {
if (t instanceof HTMLLegendElement) return !1;
t = t.previousElementSibling;
}
return !0;
}
let Cb = Symbol();
function Fw(e, t = !0) {
return Object.assign(e, { [Cb]: t });
}
function jt(...e) {
let t = le(e);
Ee(() => {
t.current = e;
}, [e]);
let n = we((r) => {
for (let o of t.current) o != null && (typeof o == "function" ? o(r) : o.current = r);
});
return e.every((r) => r == null || (r == null ? void 0 : r[Cb])) ? void 0 : n;
}
let lf = dt(null);
lf.displayName = "DescriptionContext";
function $b() {
let e = Ke(lf);
if (e === null) {
let t = new Error("You used a component, but it is not inside a relevant parent.");
throw Error.captureStackTrace && Error.captureStackTrace(t, $b), t;
}
return e;
}
function Lw() {
let [e, t] = $e([]);
return [e.length > 0 ? e.join(" ") : void 0, Ye(() => function(n) {
let r = we((a) => (t((i) => [...i, a]), () => t((i) => {
let s = i.slice(), l = s.indexOf(a);
return l !== -1 && s.splice(l, 1), s;
}))), o = Ye(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
return ke.createElement(lf.Provider, { value: o }, n.children);
}, [t])];
}
let Dw = "p";
function zw(e, t) {
let n = Or(), r = Sb(), { id: o = `headlessui-description-${n}`, ...a } = e, i = $b(), s = jt(t);
_e(() => i.register(o), [o, i.register]);
let l = r || !1, c = Ye(() => ({ ...i.slot, disabled: l }), [i.slot, l]), u = { ref: s, ...i.props, id: o };
return pt()({ ourProps: u, theirProps: a, slot: c, defaultTag: Dw, name: i.name || "Description" });
}
let Ww = lt(zw);
Object.assign(Ww, {});
var Je = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(Je || {});
let Qi = dt(null);
Qi.displayName = "LabelContext";
function cf() {
let e = Ke(Qi);
if (e === null) {
let t = new Error("You used a component, but it is not inside a relevant parent.");
throw Error.captureStackTrace && Error.captureStackTrace(t, cf), t;
}
return e;
}
function Vw(e) {
var t, n, r;
let o = (n = (t = Ke(Qi)) == null ? void 0 : t.value) != null ? n : void 0;
return ((r = void 0) != null ? r : 0) > 0 ? [o, ...e].filter(Boolean).join(" ") : o;
}
function Nb({ inherit: e = !1 } = {}) {
let t = Vw(), [n, r] = $e([]), o = e ? [t, ...n].filter(Boolean) : n;
return [o.length > 0 ? o.join(" ") : void 0, Ye(() => function(a) {
let i = we((l) => (r((c) => [...c, l]), () => r((c) => {
let u = c.slice(), f = u.indexOf(l);
return f !== -1 && u.splice(f, 1), u;
}))), s = Ye(() => ({ register: i, slot: a.slot, name: a.name, props: a.props, value: a.value }), [i, a.slot, a.name, a.props, a.value]);
return ke.createElement(Qi.Provider, { value: s }, a.children);
}, [r])];
}
let Hw = "label";
function Uw(e, t) {
var n;
let r = Or(), o = cf(), a = Rw(), i = Sb(), { id: s = `headlessui-label-${r}`, htmlFor: l = a ?? ((n = o.props) == null ? void 0 : n.htmlFor), passive: c = !1, ...u } = e, f = jt(t);
_e(() => o.register(s), [s, o.register]);
let d = we((g) => {
let v = g.currentTarget;
if (v instanceof HTMLLabelElement && g.preventDefault(), o.props && "onClick" in o.props && typeof o.props.onClick == "function" && o.props.onClick(g), v instanceof HTMLLabelElement) {
let k = document.getElementById(v.htmlFor);
if (k) {
let x = k.getAttribute("disabled");
if (x === "true" || x === "") return;
let O = k.getAttribute("aria-disabled");
if (O === "true" || O === "") return;
(k instanceof HTMLInputElement && (k.type === "radio" || k.type === "checkbox") || k.role === "radio" || k.role === "checkbox" || k.role === "switch") && k.click(), k.focus({ preventScroll: !0 });
}
}
}), p = i || !1, b = Ye(() => ({ ...o.slot, disabled: p }), [o.slot, p]), m = { ref: f, ...o.props, id: s, htmlFor: l, onClick: d };
return c && ("onClick" in m && (delete m.htmlFor, delete m.onClick), "onClick" in u && delete u.onClick), pt()({ ourProps: m, theirProps: u, slot: b, defaultTag: l ? Hw : "div", name: o.name || "Label" });
}
let Yw = lt(Uw);
Object.assign(Yw, {});
function Bw(e) {
if (e === null) return { width: 0, height: 0 };
let { width: t, height: n } = e.getBoundingClientRect();
return { width: t, height: n };
}
function Gw(e, t = !1) {
let [n, r] = Xx(() => ({}), {}), o = Ye(() => Bw(e), [e, n]);
return _e(() => {
if (!e) return;
let a = new ResizeObserver(r);
return a.observe(e), () => {
a.disconnect();
};
}, [e]), t ? { width: `${o.width}px`, height: `${o.height}px` } : o;
}
let Ib = class extends Map {
constructor(t) {
super(), this.factory = t;
}
get(t) {
let n = super.get(t);
return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
}
};
function Tb(e, t) {
let n = e(), r = /* @__PURE__ */ new Set();
return { getSnapshot() {
return n;
}, subscribe(o) {
return r.add(o), () => r.delete(o);
}, dispatch(o, ...a) {
let i = t[o].call(n, ...a);
i && (n = i, r.forEach((s) => s()));
} };
}
function Mb(e) {
return Qx(e.subscribe, e.getSnapshot, e.getSnapshot);
}
let qw = new Ib(() => Tb(() => [], { ADD(e) {
return this.includes(e) ? this : [...this, e];
}, REMOVE(e) {
let t = this.indexOf(e);
if (t === -1) return this;
let n = this.slice();
return n.splice(t, 1), n;
} }));
function uf(e, t) {
let n = qw.get(t), r = Or(), o = Mb(n);
if (_e(() => {
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
}, [n, e]), !e) return !1;
let a = o.indexOf(r), i = o.length;
return a === -1 && (a = i, i += 1), a === i - 1;
}
let bc = /* @__PURE__ */ new Map(), Vo = /* @__PURE__ */ new Map();
function Hd(e) {
var t;
let n = (t = Vo.get(e)) != null ? t : 0;
return Vo.set(e, n + 1), n !== 0 ? () => Ud(e) : (bc.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Ud(e));
}
function Ud(e) {
var t;
let n = (t = Vo.get(e)) != null ? t : 1;
if (n === 1 ? Vo.delete(e) : Vo.set(e, n - 1), n !== 1) return;
let r = bc.get(e);
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, bc.delete(e));
}
function Kw(e, { allowed: t, disallowed: n } = {}) {
let r = uf(e, "inert-others");
_e(() => {
var o, a;
if (!r) return;
let i = Rt();
for (let l of (o = n == null ? void 0 : n()) != null ? o : []) l && i.add(Hd(l));
let s = (a = t == null ? void 0 : t()) != null ? a : [];
for (let l of s) {
if (!l) continue;
let c = io(l);
if (!c) continue;
let u = l.parentElement;
for (; u && u !== c.body; ) {
for (let f of u.children) s.some((d) => f.contains(d)) || i.add(Hd(f));
u = u.parentElement;
}
}
return i.dispose;
}, [r, t, n]);
}
function Xw(e, t, n) {
let r = so((o) => {
let a = o.getBoundingClientRect();
a.x === 0 && a.y === 0 && a.width === 0 && a.height === 0 && n();
});
Ee(() => {
if (!e) return;
let o = t === null ? null : t instanceof HTMLElement ? t : t.current;
if (!o) return;
let a = Rt();
if (typeof ResizeObserver < "u") {
let i = new ResizeObserver(() => r.current(o));
i.observe(o), a.add(() => i.disconnect());
}
if (typeof IntersectionObserver < "u") {
let i = new IntersectionObserver(() => r.current(o));
i.observe(o), a.add(() => i.disconnect());
}
return () => a.dispose();
}, [t, r, e]);
}
let yc = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), Qw = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
var vc = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(vc || {}), Jw = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Jw || {}), Zw = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Zw || {});
function Rb(e = document.body) {
return e == null ? [] : Array.from(e.querySelectorAll(yc)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
}
function e2(e = document.body) {
return e == null ? [] : Array.from(e.querySelectorAll(Qw)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
}
var ff = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(ff || {});
function df(e, t = 0) {
var n;
return e === ((n = io(e)) == null ? void 0 : n.body) ? !1 : Sr(t, { 0() {
return e.matches(yc);
}, 1() {
let r = e;
for (; r !== null; ) {
if (r.matches(yc)) return !0;
r = r.parentElement;
}
return !1;
} });
}
function jb(e) {
let t = io(e);
Rt().nextFrame(() => {
t && !df(t.activeElement, 0) && n2(e);
});
}
var t2 = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(t2 || {});
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
}, !0), document.addEventListener("click", (e) => {
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
}, !0));
function n2(e) {
e == null || e.focus({ preventScroll: !0 });
}
let r2 = ["textarea", "input"].join(",");
function o2(e) {
var t, n;
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, r2)) != null ? n : !1;
}
function _b(e, t = (n) => n) {
return e.slice().sort((n, r) => {
let o = t(n), a = t(r);
if (o === null || a === null) return 0;
let i = o.compareDocumentPosition(a);
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
});
}
function a2(e, t) {
return i2(Rb(), t, { relativeTo: e });
}
function i2(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: o = [] } = {}) {
let a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, i = Array.isArray(e) ? n ? _b(e) : e : t & 64 ? e2(e) : Rb(e);
o.length > 0 && i.length > 1 && (i = i.filter((p) => !o.some((b) => b != null && "current" in b ? (b == null ? void 0 : b.current) === p : b === p))), r = r ?? a.activeElement;
let s = (() => {
if (t & 5) return 1;
if (t & 10) return -1;
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
})(), l = (() => {
if (t & 1) return 0;
if (t & 2) return Math.max(0, i.indexOf(r)) - 1;
if (t & 4) return Math.max(0, i.indexOf(r)) + 1;
if (t & 8) return i.length - 1;
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
})(), c = t & 32 ? { preventScroll: !0 } : {}, u = 0, f = i.length, d;
do {
if (u >= f || u + f <= 0) return 0;
let p = l + u;
if (t & 16) p = (p + f) % f;
else {
if (p < 0) return 3;
if (p >= f) return 1;
}
d = i[p], d == null || d.focus(c), u += s;
} while (d !== a.activeElement);
return t & 6 && o2(d) && d.select(), 2;
}
function Fb() {
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
}
function s2() {
return /Android/gi.test(window.navigator.userAgent);
}
function l2() {
return Fb() || s2();
}
function wo(e, t, n, r) {
let o = so(n);
Ee(() => {
if (!e) return;
function a(i) {
o.current(i);
}
return document.addEventListener(t, a, r), () => document.removeEventListener(t, a, r);
}, [e, t, r]);
}
function c2(e, t, n, r) {
let o = so(n);
Ee(() => {
if (!e) return;
function a(i) {
o.current(i);
}
return window.addEventListener(t, a, r), () => window.removeEventListener(t, a, r);
}, [e, t, r]);
}
const Yd = 30;
function u2(e, t, n) {
let r = uf(e, "outside-click"), o = so(n), a = Ge(function(l, c) {
if (l.defaultPrevented) return;
let u = c(l);
if (u === null || !u.getRootNode().contains(u) || !u.isConnected) return;
let f = function d(p) {
return typeof p == "function" ? d(p()) : Array.isArray(p) || p instanceof Set ? p : [p];
}(t);
for (let d of f) if (d !== null && (d.contains(u) || l.composed && l.composedPath().includes(d))) return;
return !df(u, ff.Loose) && u.tabIndex !== -1 && l.preventDefault(), o.current(l, u);
}, [o, t]), i = le(null);
wo(r, "pointerdown", (l) => {
var c, u;
i.current = ((u = (c = l.composedPath) == null ? void 0 : c.call(l)) == null ? void 0 : u[0]) || l.target;
}, !0), wo(r, "mousedown", (l) => {
var c, u;
i.current = ((u = (c = l.composedPath) == null ? void 0 : c.call(l)) == null ? void 0 : u[0]) || l.target;
}, !0), wo(r, "click", (l) => {
l2() || i.current && (a(l, () => i.current), i.current = null);
}, !0);
let s = le({ x: 0, y: 0 });
wo(r, "touchstart", (l) => {
s.current.x = l.touches[0].clientX, s.current.y = l.touches[0].clientY;
}, !0), wo(r, "touchend", (l) => {
let c = { x: l.changedTouches[0].clientX, y: l.changedTouches[0].clientY };
if (!(Math.abs(c.x - s.current.x) >= Yd || Math.abs(c.y - s.current.y) >= Yd)) return a(l, () => l.target instanceof HTMLElement ? l.target : null);
}, !0), c2(r, "blur", (l) => a(l, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
}
function xc(...e) {
return Ye(() => io(...e), [...e]);
}
function f2(e, t) {
return Ye(() => {
var n;
if (e.type) return e.type;
let r = (n = e.as) != null ? n : "button";
if (typeof r == "string" && r.toLowerCase() === "button" || (t == null ? void 0 : t.tagName) === "BUTTON" && !t.hasAttribute("type")) return "button";
}, [e.type, e.as, t]);
}
function d2() {
let e;
return { before({ doc: t }) {
var n;
let r = t.documentElement, o = (n = t.defaultView) != null ? n : window;
e = Math.max(0, o.innerWidth - r.clientWidth);
}, after({ doc: t, d: n }) {
let r = t.documentElement, o = Math.max(0, r.clientWidth - r.offsetWidth), a = Math.max(0, e - o);
n.style(r, "paddingRight", `${a}px`);
} };
}
function p2() {
return Fb() ? { before({ doc: e, d: t, meta: n }) {
function r(o) {
return n.containers.flatMap((a) => a()).some((a) => a.contains(o));
}
t.microTask(() => {
var o;
if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
let s = Rt();
s.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => s.dispose()));
}
let a = (o = window.scrollY) != null ? o : window.pageYOffset, i = null;
t.addEventListener(e, "click", (s) => {
if (s.target instanceof HTMLElement) try {
let l = s.target.closest("a");
if (!l) return;
let { hash: c } = new URL(l.href), u = e.querySelector(c);
u && !r(u) && (i = u);
} catch {
}
}, !0), t.addEventListener(e, "touchstart", (s) => {
if (s.target instanceof HTMLElement) if (r(s.target)) {
let l = s.target;
for (; l.parentElement && r(l.parentElement); ) l = l.parentElement;
t.style(l, "overscrollBehavior", "contain");
} else t.style(s.target, "touchAction", "none");
}), t.addEventListener(e, "touchmove", (s) => {
if (s.target instanceof HTMLElement) {
if (s.target.tagName === "INPUT") return;
if (r(s.target)) {
let l = s.target;
for (; l.parentElement && l.dataset.headlessuiPortal !== "" && !(l.scrollHeight > l.clientHeight || l.scrollWidth > l.clientWidth); ) l = l.parentElement;
l.dataset.headlessuiPortal === "" && s.preventDefault();
} else s.preventDefault();
}
}, { passive: !1 }), t.add(() => {
var s;
let l = (s = window.scrollY) != null ? s : window.pageYOffset;
a !== l && window.scrollTo(0, a), i && i.isConnected && (i.scrollIntoView({ block: "nearest" }), i = null);
});
});
} } : {};
}
function m2() {
return { before({ doc: e, d: t }) {
t.style(e.documentElement, "overflow", "hidden");
} };
}
function g2(e) {
let t = {};
for (let n of e) Object.assign(t, n(t));
return t;
}
let or = Tb(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
var n;
let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: Rt(), meta: /* @__PURE__ */ new Set() };
return r.count++, r.meta.add(t), this.set(e, r), this;
}, POP(e, t) {
let n = this.get(e);
return n && (n.count--, n.meta.delete(t)), this;
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
let r = { doc: e, d: t, meta: g2(n) }, o = [p2(), d2(), m2()];
o.forEach(({ before: a }) => a == null ? void 0 : a(r)), o.forEach(({ after: a }) => a == null ? void 0 : a(r));
}, SCROLL_ALLOW({ d: e }) {
e.dispose();
}, TEARDOWN({ doc: e }) {
this.delete(e);
} });
or.subscribe(() => {
let e = or.getSnapshot(), t = /* @__PURE__ */ new Map();
for (let [n] of e) t.set(n, n.documentElement.style.overflow);
for (let n of e.values()) {
let r = t.get(n.doc) === "hidden", o = n.count !== 0;
(o && !r || !o && r) && or.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && or.dispatch("TEARDOWN", n);
}
});
function h2(e, t, n = () => ({ containers: [] })) {
let r = Mb(or), o = t ? r.get(t) : void 0, a = o ? o.count > 0 : !1;
return _e(() => {
if (!(!t || !e)) return or.dispatch("PUSH", t, n), () => or.dispatch("POP", t, n);
}, [e, t]), a;
}
function b2(e, t, n = () => [document.body]) {
let r = uf(e, "scroll-lock");
h2(r, t, (o) => {
var a;
return { containers: [...(a = o.containers) != null ? a : [], n] };
});
}
function Bd(e) {
return [e.screenX, e.screenY];
}
function y2() {
let e = le([-1, -1]);
return { wasMoved(t) {
let n = Bd(t);
return e.current[0] === n[0] && e.current[1] === n[1] ? !1 : (e.current = n, !0);
}, update(t) {
e.current = Bd(t);
} };
}
function v2(e = 0) {
let [t, n] = $e(e), r = Ge((l) => n(l), [t]), o = Ge((l) => n((c) => c | l), [t]), a = Ge((l) => (t & l) === l, [t]), i = Ge((l) => n((c) => c & ~l), [n]), s = Ge((l) => n((c) => c ^ l), [n]);
return { flags: t, setFlag: r, addFlag: o, hasFlag: a, removeFlag: i, toggleFlag: s };
}
var Gd, qd;
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Gd = process == null ? void 0 : process.env) == null ? void 0 : Gd.NODE_ENV) === "test" && typeof ((qd = Element == null ? void 0 : Element.prototype) == null ? void 0 : qd.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
`)), [];
});
var x2 = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(x2 || {});
function Lb(e) {
let t = {};
for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
return t;
}
function Db(e, t, n, r) {
let [o, a] = $e(n), { hasFlag: i, addFlag: s, removeFlag: l } = v2(e && o ? 3 : 0), c = le(!1), u = le(!1), f = Pa();
return _e(() => {
var d;
if (e) {
if (n && a(!0), !t) {
n && s(3);
return;
}
return (d = r == null ? void 0 : r.start) == null || d.call(r, n), w2(t, { inFlight: c, prepare() {
u.current ? u.current = !1 : u.current = c.current, c.current = !0, !u.current && (n ? (s(3), l(4)) : (s(4), l(2)));
}, run() {
u.current ? n ? (l(3), s(4)) : (l(4), s(3)) : n ? l(1) : s(1);
}, done() {
var p;
u.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (c.current = !1, l(7), n || a(!1), (p = r == null ? void 0 : r.end) == null || p.call(r, n));
} });
}
}, [e, n, t, f]), e ? [o, { closed: i(1), enter: i(2), leave: i(4), transition: i(2) || i(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
}
function w2(e, { prepare: t, run: n, done: r, inFlight: o }) {
let a = Rt();
return E2(e, { prepare: t, inFlight: o }), a.nextFrame(() => {
n(), a.requestAnimationFrame(() => {
a.add(k2(e, r));
});
}), a.dispose;
}
function k2(e, t) {
var n, r;
let o = Rt();
if (!e) return o.dispose;
let a = !1;
o.add(() => {
a = !0;
});
let i = (r = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((s) => s instanceof CSSTransition)) != null ? r : [];
return i.length === 0 ? (t(), o.dispose) : (Promise.allSettled(i.map((s) => s.finished)).then(() => {
a || t();
}), o.dispose);
}
function E2(e, { inFlight: t, prepare: n }) {
if (t != null && t.current) {
n();
return;
}
let r = e.style.transition;
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
}
function O2(e, { container: t, accept: n, walk: r }) {
let o = le(n), a = le(r);
Ee(() => {
o.current = n, a.current = r;
}, [n, r]), _e(() => {
if (!t || !e) return;
let i = io(t);
if (!i) return;
let s = o.current, l = a.current, c = Object.assign((f) => s(f), { acceptNode: s }), u = i.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, c, !1);
for (; u.nextNode(); ) l(u.currentNode);
}, [t, e, o, a]);
}
function Ji() {
return typeof window < "u";
}
function lo(e) {
return zb(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function gt(e) {
var t;
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
}
function en(e) {
var t;
return (t = (zb(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
}
function zb(e) {
return Ji() ? e instanceof Node || e instanceof gt(e).Node : !1;
}
function tt(e) {
return Ji() ? e instanceof Element || e instanceof gt(e).Element : !1;
}
function Jt(e) {
return Ji() ? e instanceof HTMLElement || e instanceof gt(e).HTMLElement : !1;
}
function Kd(e) {
return !Ji() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof gt(e).ShadowRoot;
}
function Aa(e) {
const {
overflow: t,
overflowX: n,
overflowY: r,
display: o
} = Tt(e);
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
}
function S2(e) {
return ["table", "td", "th"].includes(lo(e));
}
function Zi(e) {
return [":popover-open", ":modal"].some((t) => {
try {
return e.matches(t);
} catch {
return !1;
}
});
}
function pf(e) {
const t = mf(), n = tt(e) ? Tt(e) : e;
return ["transform", "translate", "scale", "rotate", "perspective"].some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
}
function P2(e) {
let t = Wn(e);
for (; Jt(t) && !eo(t); ) {
if (pf(t))
return t;
if (Zi(t))
return null;
t = Wn(t);
}
return null;
}
function mf() {
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function eo(e) {
return ["html", "body", "#document"].includes(lo(e));
}
function Tt(e) {
return gt(e).getComputedStyle(e);
}
function es(e) {
return tt(e) ? {
scrollLeft: e.scrollLeft,
scrollTop: e.scrollTop
} : {
scrollLeft: e.scrollX,
scrollTop: e.scrollY
};
}
function Wn(e) {
if (lo(e) === "html")
return e;
const t = (
// Step into the shadow DOM of the parent of a slotted node.
e.assignedSlot || // DOM Element detected.
e.parentNode || // ShadowRoot detected.
Kd(e) && e.host || // Fallback.
en(e)
);
return Kd(t) ? t.host : t;
}
function Wb(e) {
const t = Wn(e);
return eo(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Jt(t) && Aa(t) ? t : Wb(t);
}
function ra(e, t, n) {
var r;
t === void 0 && (t = []), n === void 0 && (n = !0);
const o = Wb(e), a = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = gt(o);
if (a) {
const s = wc(i);
return t.concat(i, i.visualViewport || [], Aa(o) ? o : [], s && n ? ra(s) : []);
}
return t.concat(o, ra(o, [], n));
}
function wc(e) {
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
}
function A2() {
const e = navigator.userAgentData;
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
let {
brand: n,
version: r
} = t;
return n + "/" + r;
}).join(" ") : navigator.userAgent;
}
const fr = Math.min, et = Math.max, oa = Math.round, Wa = Math.floor, Qt = (e) => ({
x: e,
y: e
}), C2 = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
}, $2 = {
start: "end",
end: "start"
};
function Xd(e, t, n) {
return et(e, fr(t, n));
}
function co(e, t) {
return typeof e == "function" ? e(t) : e;
}
function Vn(e) {
return e.split("-")[0];
}
function Ca(e) {
return e.split("-")[1];
}
function Vb(e) {
return e === "x" ? "y" : "x";
}
function Hb(e) {
return e === "y" ? "height" : "width";
}
function dr(e) {
return ["top", "bottom"].includes(Vn(e)) ? "y" : "x";
}
function Ub(e) {
return Vb(dr(e));
}
function N2(e, t, n) {
n === void 0 && (n = !1);
const r = Ca(e), o = Ub(e), a = Hb(o);
let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
return t.reference[a] > t.floating[a] && (i = Ai(i)), [i, Ai(i)];
}
function I2(e) {
const t = Ai(e);
return [kc(e), t, kc(t)];
}
function kc(e) {
return e.replace(/start|end/g, (t) => $2[t]);
}
function T2(e, t, n) {
const r = ["left", "right"], o = ["right", "left"], a = ["top", "bottom"], i = ["bottom", "top"];
switch (e) {
case "top":
case "bottom":
return n ? t ? o : r : t ? r : o;
case "left":
case "right":
return t ? a : i;
default:
return [];
}
}
function M2(e, t, n, r) {
const o = Ca(e);
let a = T2(Vn(e), n === "start", r);
return o && (a = a.map((i) => i + "-" + o), t && (a = a.concat(a.map(kc)))), a;
}
function Ai(e) {
return e.replace(/left|right|bottom|top/g, (t) => C2[t]);
}
function R2(e) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...e
};
}
function j2(e) {
return typeof e != "number" ? R2(e) : {
top: e,
right: e,
bottom: e,
left: e
};
}
function Ci(e) {
const {
x: t,
y: n,
width: r,
height: o
} = e;
return {
width: r,
height: o,
top: n,
left: t,
right: t + r,
bottom: n + o,
x: t,
y: n
};
}
function Qd(e, t, n) {
let {
reference: r,
floating: o
} = e;
const a = dr(t), i = Ub(t), s = Hb(i), l = Vn(t), c = a === "y", u = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, d = r[s] / 2 - o[s] / 2;
let p;
switch (l) {
case "top":
p = {
x: u,
y: r.y - o.height
};
break;
case "bottom":
p = {
x: u,
y: r.y + r.height
};
break;
case "right":
p = {
x: r.x + r.width,
y: f
};
break;
case "left":
p = {
x: r.x - o.width,
y: f
};
break;
default:
p = {
x: r.x,
y: r.y
};
}
switch (Ca(t)) {
case "start":
p[i] -= d * (n && c ? -1 : 1);
break;
case "end":
p[i] += d * (n && c ? -1 : 1);
break;
}
return p;
}
const _2 = async (e, t, n) => {
const {
placement: r = "bottom",
strategy: o = "absolute",
middleware: a = [],
platform: i
} = n, s = a.filter(Boolean), l = await (i.isRTL == null ? void 0 : i.isRTL(t));
let c = await i.getElementRects({
reference: e,
floating: t,
strategy: o
}), {
x: u,
y: f
} = Qd(c, r, l), d = r, p = {}, b = 0;
for (let m = 0; m < s.length; m++) {
const {
name: g,
fn: v
} = s[m], {
x: k,
y: x,
data: O,
reset: h
} = await v({
x: u,
y: f,
initialPlacement: r,
placement: d,
strategy: o,
middlewareData: p,
rects: c,
platform: i,
elements: {
reference: e,
floating: t
}
});
u = k ?? u, f = x ?? f, p = {
...p,
[g]: {
...p[g],
...O
}
}, h && b <= 50 && (b++, typeof h == "object" && (h.placement && (d = h.placement), h.rects && (c = h.rects === !0 ? await i.getElementRects({
reference: e,
floating: t,
strategy: o
}) : h.rects), {
x: u,
y: f
} = Qd(c, d, l)), m = -1);
}
return {
x: u,
y: f,
placement: d,
strategy: o,
middlewareData: p
};
};
async function ts(e, t) {
var n;
t === void 0 && (t = {});
const {
x: r,
y: o,
platform: a,
rects: i,
elements: s,
strategy: l
} = e, {
boundary: c = "clippingAncestors",
rootBoundary: u = "viewport",
elementContext: f = "floating",
altBoundary: d = !1,
padding: p = 0
} = co(t, e), b = j2(p), g = s[d ? f === "floating" ? "reference" : "floating" : f], v = Ci(await a.getClippingRect({
element: (n = await (a.isElement == null ? void 0 : a.isElement(g))) == null || n ? g : g.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(s.floating)),
boundary: c,
rootBoundary: u,
strategy: l
})), k = f === "floating" ? {
x: r,
y: o,
width: i.floating.width,
height: i.floating.height
} : i.reference, x = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(s.floating)), O = await (a.isElement == null ? void 0 : a.isElement(x)) ? await (a.getScale == null ? void 0 : a.getScale(x)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
}, h = Ci(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
elements: s,
rect: k,
offsetParent: x,
strategy: l
}) : k);
return {
top: (v.top - h.top + b.top) / O.y,
bottom: (h.bottom - v.bottom + b.bottom) / O.y,
left: (v.left - h.left + b.left) / O.x,
right: (h.right - v.right + b.right) / O.x
};
}
const F2 = function(e) {
return e === void 0 && (e = {}), {
name: "flip",
options: e,
async fn(t) {
var n, r;
const {
placement: o,
middlewareData: a,
rects: i,
initialPlacement: s,
platform: l,
elements: c
} = t, {
mainAxis: u = !0,
crossAxis: f = !0,
fallbackPlacements: d,
fallbackStrategy: p = "bestFit",
fallbackAxisSideDirection: b = "none",
flipAlignment: m = !0,
...g
} = co(e, t);
if ((n = a.arrow) != null && n.alignmentOffset)
return {};
const v = Vn(o), k = dr(s), x = Vn(s) === s, O = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), h = d || (x || !m ? [Ai(s)] : I2(s)), L = b !== "none";
!d && L && h.push(...M2(s, m, b, O));
const _ = [s, ...h], H = await ts(t, g), J = [];
let Z = ((r = a.flip) == null ? void 0 : r.overflows) || [];
if (u && J.push(H[v]), f) {
const W = N2(o, i, O);
J.push(H[W[0]], H[W[1]]);
}
if (Z = [...Z, {
placement: o,
overflows: J
}], !J.every((W) => W <= 0)) {
var U, T;
const W = (((U = a.flip) == null ? void 0 : U.index) || 0) + 1, j = _[W];
if (j)
return {
data: {
index: W,
overflows: Z
},
reset: {
placement: j
}
};
let D = (T = Z.filter((Q) => Q.overflows[0] <= 0).sort((Q, V) => Q.overflows[1] - V.overflows[1])[0]) == null ? void 0 : T.placement;
if (!D)
switch (p) {
case "bestFit": {
var te;
const Q = (te = Z.filter((V) => {
if (L) {
const z = dr(V.placement);
return z === k || // Create a bias to the `y` side axis due to horizontal
// reading directions favoring greater width.
z === "y";
}
return !0;
}).map((V) => [V.placement, V.overflows.filter((z) => z > 0).reduce((z, y) => z + y, 0)]).sort((V, z) => V[1] - z[1])[0]) == null ? void 0 : te[0];
Q && (D = Q);
break;
}
case "initialPlacement":
D = s;
break;
}
if (o !== D)
return {
reset: {
placement: D
}
};
}
return {};
}
};
};
async function L2(e, t) {
const {
placement: n,
platform: r,
elements: o
} = e, a = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Vn(n), s = Ca(n), l = dr(n) === "y", c = ["left", "top"].includes(i) ? -1 : 1, u = a && l ? -1 : 1, f = co(t, e);
let {
mainAxis: d,
crossAxis: p,
alignmentAxis: b
} = typeof f == "number" ? {
mainAxis: f,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: f.mainAxis || 0,
crossAxis: f.crossAxis || 0,
alignmentAxis: f.alignmentAxis
};
return s && typeof b == "number" && (p = s === "end" ? b * -1 : b), l ? {
x: p * u,
y: d * c
} : {
x: d * c,
y: p * u
};
}
const D2 = function(e) {
return e === void 0 && (e = 0), {
name: "offset",
options: e,
async fn(t) {
var n, r;
const {
x: o,
y: a,
placement: i,
middlewareData: s
} = t, l = await L2(t, e);
return i === ((n = s.offset) == null ? void 0 : n.placement) && (r = s.arrow) != null && r.alignmentOffset ? {} : {
x: o + l.x,
y: a + l.y,
data: {
...l,
placement: i
}
};
}
};
}, z2 = function(e) {
return e === void 0 && (e = {}), {
name: "shift",
options: e,
async fn(t) {
const {
x: n,
y: r,
placement: o
} = t, {
mainAxis: a = !0,
crossAxis: i = !1,
limiter: s = {
fn: (g) => {
let {
x: v,
y: k
} = g;
return {
x: v,
y: k
};
}
},
...l
} = co(e, t), c = {
x: n,
y: r
}, u = await ts(t, l), f = dr(Vn(o)), d = Vb(f);
let p = c[d], b = c[f];
if (a) {
const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", k = p + u[g], x = p - u[v];
p = Xd(k, p, x);
}
if (i) {
const g = f === "y" ? "top" : "left", v = f === "y" ? "bottom" : "right", k = b + u[g], x = b - u[v];
b = Xd(k, b, x);
}
const m = s.fn({
...t,
[d]: p,
[f]: b
});
return {
...m,
data: {
x: m.x - n,
y: m.y - r,
enabled: {
[d]: a,
[f]: i
}
}
};
}
};
}, W2 = function(e) {
return e === void 0 && (e = {}), {
name: "size",
options: e,
async fn(t) {
var n, r;
const {
placement: o,
rects: a,
platform: i,
elements: s
} = t, {
apply: l = () => {
},
...c
} = co(e, t), u = await ts(t, c), f = Vn(o), d = Ca(o), p = dr(o) === "y", {
width: b,
height: m
} = a.floating;
let g, v;
f === "top" || f === "bottom" ? (g = f, v = d === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (v = f, g = d === "end" ? "top" : "bottom");
const k = m - u.top - u.bottom, x = b - u.left - u.right, O = fr(m - u[g], k), h = fr(b - u[v], x), L = !t.middlewareData.shift;
let _ = O, H = h;
if ((n = t.middlewareData.shift) != null && n.enabled.x && (H = x), (r = t.middlewareData.shift) != null && r.enabled.y && (_ = k), L && !d) {
const Z = et(u.left, 0), U = et(u.right, 0), T = et(u.top, 0), te = et(u.bottom, 0);
p ? H = b - 2 * (Z !== 0 || U !== 0 ? Z + U : et(u.left, u.right)) : _ = m - 2 * (T !== 0 || te !== 0 ? T + te : et(u.top, u.bottom));
}
await l({
...t,
availableWidth: H,
availableHeight: _
});
const J = await i.getDimensions(s.floating);
return b !== J.width || m !== J.height ? {
reset: {
rects: !0
}
} : {};
}
};
};
function Yb(e) {
const t = Tt(e);
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
const o = Jt(e), a = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, s = oa(n) !== a || oa(r) !== i;
return s && (n = a, r = i), {
width: n,
height: r,
$: s
};
}
function gf(e) {
return tt(e) ? e : e.contextElement;
}
function Vr(e) {
const t = gf(e);
if (!Jt(t))
return Qt(1);
const n = t.getBoundingClientRect(), {
width: r,
height: o,
$: a
} = Yb(t);
let i = (a ? oa(n.width) : n.width) / r, s = (a ? oa(n.height) : n.height) / o;
return (!i || !Number.isFinite(i)) && (i = 1), (!s || !Number.isFinite(s)) && (s = 1), {
x: i,
y: s
};
}
const V2 = /* @__PURE__ */ Qt(0);
function Bb(e) {
const t = gt(e);
return !mf() || !t.visualViewport ? V2 : {
x: t.visualViewport.offsetLeft,
y: t.visualViewport.offsetTop
};
}
function H2(e, t, n) {
return t === void 0 && (t = !1), !n || t && n !== gt(e) ? !1 : t;
}
function pr(e, t, n, r) {
t === void 0 && (t = !1), n === void 0 && (n = !1);
const o = e.getBoundingClientRect(), a = gf(e);
let i = Qt(1);
t && (r ? tt(r) && (i = Vr(r)) : i = Vr(e));
const s = H2(a, n, r) ? Bb(a) : Qt(0);
let l = (o.left + s.x) / i.x, c = (o.top + s.y) / i.y, u = o.width / i.x, f = o.height / i.y;
if (a) {
const d = gt(a), p = r && tt(r) ? gt(r) : r;
let b = d, m = wc(b);
for (; m && r && p !== b; ) {
const g = Vr(m), v = m.getBoundingClientRect(), k = Tt(m), x = v.left + (m.clientLeft + parseFloat(k.paddingLeft)) * g.x, O = v.top + (m.clientTop + parseFloat(k.paddingTop)) * g.y;
l *= g.x, c *= g.y, u *= g.x, f *= g.y, l += x, c += O, b = gt(m), m = wc(b);
}
}
return Ci({
width: u,
height: f,
x: l,
y: c
});
}
function hf(e, t) {
const n = es(e).scrollLeft;
return t ? t.left + n : pr(en(e)).left + n;
}
function Gb(e, t, n) {
n === void 0 && (n = !1);
const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
// RTL
scrollbar.
hf(e, r)
)), a = r.top + t.scrollTop;
return {
x: o,
y: a
};
}
function U2(e) {
let {
elements: t,
rect: n,
offsetParent: r,
strategy: o
} = e;
const a = o === "fixed", i = en(r), s = t ? Zi(t.floating) : !1;
if (r === i || s && a)
return n;
let l = {
scrollLeft: 0,
scrollTop: 0
}, c = Qt(1);
const u = Qt(0), f = Jt(r);
if ((f || !f && !a) && ((lo(r) !== "body" || Aa(i)) && (l = es(r)), Jt(r))) {
const p = pr(r);
c = Vr(r), u.x = p.x + r.clientLeft, u.y = p.y + r.clientTop;
}
const d = i && !f && !a ? Gb(i, l, !0) : Qt(0);
return {
width: n.width * c.x,
height: n.height * c.y,
x: n.x * c.x - l.scrollLeft * c.x + u.x + d.x,
y: n.y * c.y - l.scrollTop * c.y + u.y + d.y
};
}
function Y2(e) {
return Array.from(e.getClientRects());
}
function B2(e) {
const t = en(e), n = es(e), r = e.ownerDocument.body, o = et(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = et(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
let i = -n.scrollLeft + hf(e);
const s = -n.scrollTop;
return Tt(r).direction === "rtl" && (i += et(t.clientWidth, r.clientWidth) - o), {
width: o,
height: a,
x: i,
y: s
};
}
function G2(e, t) {
const n = gt(e), r = en(e), o = n.visualViewport;
let a = r.clientWidth, i = r.clientHeight, s = 0, l = 0;
if (o) {
a = o.width, i = o.height;
const c = mf();
(!c || c && t === "fixed") && (s = o.offsetLeft, l = o.offsetTop);
}
return {
width: a,
height: i,
x: s,
y: l
};
}
function q2(e, t) {
const n = pr(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, a = Jt(e) ? Vr(e) : Qt(1), i = e.clientWidth * a.x, s = e.clientHeight * a.y, l = o * a.x, c = r * a.y;
return {
width: i,
height: s,
x: l,
y: c
};
}
function Jd(e, t, n) {
let r;
if (t === "viewport")
r = G2(e, n);
else if (t === "document")
r = B2(en(e));
else if (tt(t))
r = q2(t, n);
else {
const o = Bb(e);
r = {
x: t.x - o.x,
y: t.y - o.y,
width: t.width,
height: t.height
};
}
return Ci(r);
}
function qb(e, t) {
const n = Wn(e);
return n === t || !tt(n) || eo(n) ? !1 : Tt(n).position === "fixed" || qb(n, t);
}
function K2(e, t) {
const n = t.get(e);
if (n)
return n;
let r = ra(e, [], !1).filter((s) => tt(s) && lo(s) !== "body"), o = null;
const a = Tt(e).position === "fixed";
let i = a ? Wn(e) : e;
for (; tt(i) && !eo(i); ) {
const s = Tt(i), l = pf(i);
!l && s.position === "fixed" && (o = null), (a ? !l && !o : !l && s.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Aa(i) && !l && qb(e, i)) ? r = r.filter((u) => u !== i) : o = s, i = Wn(i);
}
return t.set(e, r), r;
}
function X2(e) {
let {
element: t,
boundary: n,
rootBoundary: r,
strategy: o
} = e;
const i = [...n === "clippingAncestors" ? Zi(t) ? [] : K2(t, this._c) : [].concat(n), r], s = i[0], l = i.reduce((c, u) => {
const f = Jd(t, u, o);
return c.top = et(f.top, c.top), c.right = fr(f.right, c.right), c.bottom = fr(f.bottom, c.bottom), c.left = et(f.left, c.left), c;
}, Jd(t, s, o));
return {
width: l.right - l.left,
height: l.bottom - l.top,
x: l.left,
y: l.top
};
}
function Q2(e) {
const {
width: t,
height: n
} = Yb(e);
return {
width: t,
height: n
};
}
function J2(e, t, n) {
const r = Jt(t), o = en(t), a = n === "fixed", i = pr(e, !0, a, t);
let s = {
scrollLeft: 0,
scrollTop: 0
};
const l = Qt(0);
if (r || !r && !a)
if ((lo(t) !== "body" || Aa(o)) && (s = es(t)), r) {
const d = pr(t, !0, a, t);
l.x = d.x + t.clientLeft, l.y = d.y + t.clientTop;
} else o && (l.x = hf(o));
const c = o && !r && !a ? Gb(o, s) : Qt(0), u = i.left + s.scrollLeft - l.x - c.x, f = i.top + s.scrollTop - l.y - c.y;
return {
x: u,
y: f,
width: i.width,
height: i.height
};
}
function zs(e) {
return Tt(e).position === "static";
}
function Zd(e, t) {
if (!Jt(e) || Tt(e).position === "fixed")
return null;
if (t)
return t(e);
let n = e.offsetParent;
return en(e) === n && (n = n.ownerDocument.body), n;
}
function Kb(e, t) {
const n = gt(e);
if (Zi(e))
return n;
if (!Jt(e)) {
let o = Wn(e);
for (; o && !eo(o); ) {
if (tt(o) && !zs(o))
return o;
o = Wn(o);
}
return n;
}
let r = Zd(e, t);
for (; r && S2(r) && zs(r); )
r = Zd(r, t);
return r && eo(r) && zs(r) && !pf(r) ? n : r || P2(e) || n;
}
const Z2 = async function(e) {
const t = this.getOffsetParent || Kb, n = this.getDimensions, r = await n(e.floating);
return {
reference: J2(e.reference, await t(e.floating), e.strategy),
floating: {
x: 0,
y: 0,
width: r.width,
height: r.height
}
};
};
function ek(e) {
return Tt(e).direction === "rtl";
}
const tk = {
convertOffsetParentRelativeRectToViewportRelativeRect: U2,
getDocumentElement: en,
getClippingRect: X2,
getOffsetParent: Kb,
getElementRects: Z2,
getClientRects: Y2,
getDimensions: Q2,
getScale: Vr,
isElement: tt,
isRTL: ek
};
function Xb(e, t) {
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
}
function nk(e, t) {
let n = null, r;
const o = en(e);
function a() {
var s;
clearTimeout(r), (s = n) == null || s.disconnect(), n = null;
}
function i(s, l) {
s === void 0 && (s = !1), l === void 0 && (l = 1), a();
const c = e.getBoundingClientRect(), {
left: u,
top: f,
width: d,
height: p
} = c;
if (s || t(), !d || !p)
return;
const b = Wa(f), m = Wa(o.clientWidth - (u + d)), g = Wa(o.clientHeight - (f + p)), v = Wa(u), x = {
rootMargin: -b + "px " + -m + "px " + -g + "px " + -v + "px",
threshold: et(0, fr(1, l)) || 1
};
let O = !0;
function h(L) {
const _ = L[0].intersectionRatio;
if (_ !== l) {
if (!O)
return i();
_ ? i(!1, _) : r = setTimeout(() => {
i(!1, 1e-7);
}, 1e3);
}
_ === 1 && !Xb(c, e.getBoundingClientRect()) && i(), O = !1;
}
try {
n = new IntersectionObserver(h, {
...x,
// Handle