"use client";
import { t as e } from "./chunk-Dqa2HsxW.js";
import { t } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { c as n, f as r, o as i, s as a, t as o, u as s } from "./useRenderElement-CmuWsiNa.js";
import { t as c } from "./useStableCallback-CqEVb76s.js";
import { S as l, _ as u, s as d, t as f } from "./createBaseUIEventDetails-ChcQXp54.js";
import { n as p } from "./useBaseUiId-DOm5ACje.js";
import { i as m, o as h, t as g } from "./useOpenChangeComplete-DjMFUwhi.js";
import { a as _, c as v, d as y, f as b, g as x, m as S, p as ee, t as te, y as ne } from "./floating-ui.utils.dom-5U5b4xPf.js";
import { a as C } from "./detectBrowser-FBYSu3xM.js";
import { a as re } from "./constants-VB9bsA8p.js";
import { n as w, r as ie, t as T } from "./shadowDom-C-4Ejp9R.js";
import { i as ae, n as oe, o as se, t as E } from "./shim-ieZ_MRlN.js";
import { r as D, t as O } from "./event-DWcDp5kt.js";
import { c as ce } from "./composite-HOje5ugx.js";
import { t as k } from "./owner-BrzQrszh.js";
import { t as A } from "./addEventListener-B4Gs94GY.js";
import { n as le, t as ue } from "./useTimeout-B1x6NSZb.js";
import { t as j } from "./visuallyHidden-CEAV1xeA.js";
import * as M from "react";
import { jsx as N, jsxs as P } from "react/jsx-runtime";
import * as F from "react-dom";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/utils/nodes.js
function de(e, t, n = !0) {
	return e.filter((e) => e.parentId === t).flatMap((t) => [...!n || t.context?.open ? [t] : [], ...de(e, t.id, n)]);
}
function I(e, t) {
	let n = [], r = e.find((e) => e.id === t)?.parentId;
	for (; r;) {
		let t = e.find((e) => e.id === r);
		r = t?.parentId, t && (n = n.concat(t));
	}
	return n;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/utils/tabbable.js
var L = "a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]";
function R(e) {
	let t = e.assignedSlot;
	if (t) return t;
	if (e.parentElement) return e.parentElement;
	let n = e.getRootNode();
	return x(n) ? n.host : null;
}
function z(e) {
	for (let t of Array.from(e.children)) if (_(t) === "summary") return t;
	return null;
}
function B(e, t) {
	let n = z(t);
	return !!n && (e === n || w(n, e));
}
function V(e) {
	let t = e ? _(e) : "";
	return e != null && e.matches(L) && (t !== "summary" || e.parentElement != null && _(e.parentElement) === "details" && z(e.parentElement) === e) && (t !== "details" || z(e) == null) && (t !== "input" || e.type !== "hidden");
}
function H(e) {
	if (!V(e) || !e.isConnected || e.matches(":disabled")) return !1;
	for (let t = e; t; t = R(t)) {
		let n = t !== e, r = _(t) === "slot";
		if (t.hasAttribute("inert") || n && _(t) === "details" && !t.open && !B(e, t) || t.hasAttribute("hidden") || !r && !U(t, n)) return !1;
	}
	return !0;
}
function U(e, t) {
	let n = te(e);
	return t ? n.display !== "none" : ce(e, n);
}
function W(e) {
	let t = e.tabIndex;
	if (t < 0) {
		let t = _(e);
		if (t === "details" || t === "audio" || t === "video" || b(e) && e.isContentEditable) return 0;
	}
	return t;
}
function G(e) {
	if (_(e) !== "input") return null;
	let t = e;
	return t.type === "radio" && t.name !== "" ? t : null;
}
function K(e, t) {
	let n = G(e);
	if (!n) return !0;
	let r = t.find((e) => {
		let t = G(e);
		return t?.name === n.name && t.form === n.form && t.checked;
	});
	return r ? r === n : t.find((e) => {
		let t = G(e);
		return t?.name === n.name && t.form === n.form;
	}) === n;
}
function q(e) {
	if (b(e) && _(e) === "slot") {
		let t = e.assignedElements({ flatten: !0 });
		if (t.length > 0) return t;
	}
	return b(e) && e.shadowRoot ? Array.from(e.shadowRoot.children) : Array.from(e.children);
}
function J(e, t) {
	q(e).forEach((e) => {
		V(e) && t.push(e), J(e, t);
	});
}
function Y(e, t, n) {
	q(e).forEach((e) => {
		b(e) && e.matches(t) && n.push(e), Y(e, t, n);
	});
}
function fe(e) {
	return H(e) && W(e) >= 0;
}
function pe(e) {
	let t = [];
	return J(e, t), t.filter(H);
}
function X(e) {
	let t = pe(e);
	return t.filter((e) => W(e) >= 0 && K(e, t));
}
function me(e, t) {
	let n = X(e), r = n.length;
	if (r === 0) return;
	let i = T(k(e)), a = n.indexOf(i);
	return n[a === -1 ? t === 1 ? 0 : r - 1 : a + t];
}
function he(e) {
	return me(k(e).body, 1) || e;
}
function ge(e) {
	return me(k(e).body, -1) || e;
}
function _e(e, t) {
	if (!e) return null;
	let n = X(k(e).body), r = n.length;
	if (r === 0) return null;
	let i = n.indexOf(e);
	return i === -1 ? null : n[(i + t + r) % r];
}
function ve(e) {
	return _e(e, 1);
}
function ye(e) {
	return _e(e, -1);
}
function Z(e, t) {
	let n = t || e.currentTarget, r = e.relatedTarget;
	return !r || !w(n, r);
}
function be(e) {
	X(e).forEach((e) => {
		e.dataset.tabindex = e.getAttribute("tabindex") || "", e.setAttribute("tabindex", "-1");
	});
}
function xe(e) {
	let t = [];
	Y(e, "[data-tabindex]", t), t.forEach((e) => {
		let t = e.dataset.tabindex;
		delete e.dataset.tabindex, t ? e.setAttribute("tabindex", t) : e.removeAttribute("tabindex");
	});
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/useOnFirstRender.js
function Se(e) {
	let t = M.useRef(!0);
	t.current && (t.current = !1, e());
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/mergeCleanups.js
function Q(...e) {
	return () => {
		for (let t = 0; t < e.length; t += 1) {
			let n = e[t];
			n && n();
		}
	};
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/FocusGuard.js
var Ce = /*#__PURE__*/ M.forwardRef(function(e, n) {
	let [r, i] = M.useState();
	t(() => {
		C && i("button");
	}, []);
	let a = {
		tabIndex: 0,
		role: r
	};
	return /*#__PURE__*/ N("span", {
		...e,
		ref: n,
		style: j,
		"aria-hidden": r ? void 0 : !0,
		...a,
		"data-base-ui-focus-guard": ""
	});
});
process.env.NODE_ENV !== "production" && (Ce.displayName = "FocusGuard");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js
function we(e) {
	return `data-base-ui-${e}`;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/internals/constants.js
var Te = { style: { transition: "none" } }, Ee = "data-base-ui-click-trigger", De = { fallbackAxisSide: "none" }, Oe = { fallbackAxisSide: "end" }, ke = {
	clipPath: "inset(50%)",
	position: "fixed",
	top: 0,
	left: 0
}, Ae = /*#__PURE__*/ M.createContext(null);
process.env.NODE_ENV !== "production" && (Ae.displayName = "PortalContext");
var je = () => M.useContext(Ae), Me = we("portal");
function Ne(e = {}) {
	let { ref: n, container: r, componentProps: a = i, elementProps: s } = e, l = p(), u = je()?.portalNode, [d, f] = M.useState(null), [m, h] = M.useState(null), g = c((e) => {
		e !== null && h(e);
	}), _ = M.useRef(null);
	t(() => {
		if (r === null) {
			_.current && (_.current = null, h(null), f(null));
			return;
		}
		if (l == null) return;
		let e = (r && (S(r) ? r : r.current)) ?? u ?? document.body;
		if (e == null) {
			_.current && (_.current = null, h(null), f(null));
			return;
		}
		_.current !== e && (_.current = e, h(null), f(e));
	}, [
		r,
		u,
		l
	]);
	let v = o("div", a, {
		ref: [n, g],
		props: [{
			id: l,
			[Me]: ""
		}, s]
	});
	return {
		portalNode: m,
		portalSubtree: d && v ? /*#__PURE__*/ F.createPortal(v, d) : null
	};
}
var Pe = /*#__PURE__*/ M.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, children: a, container: o, renderGuards: s, ...c } = e, { portalNode: l, portalSubtree: u } = Ne({
		container: o,
		ref: t,
		componentProps: e,
		elementProps: c
	}), d = M.useRef(null), p = M.useRef(null), m = M.useRef(null), h = M.useRef(null), [g, _] = M.useState(null), v = M.useRef(!1), y = g?.modal, b = g?.open, x = typeof s == "boolean" ? s : !!g && !g.modal && g.open && !!l;
	M.useEffect(() => {
		if (!l || y) return;
		function e(e) {
			l && e.relatedTarget && Z(e) && (e.type === "focusin" ? v.current &&= (xe(l), !1) : (be(l), v.current = !0));
		}
		return Q(A(l, "focusin", e, !0), A(l, "focusout", e, !0));
	}, [l, y]), M.useEffect(() => {
		!l || b !== !1 || (xe(l), v.current = !1);
	}, [b, l]);
	let S = M.useMemo(() => ({
		beforeOutsideRef: d,
		afterOutsideRef: p,
		beforeInsideRef: m,
		afterInsideRef: h,
		portalNode: l,
		setFocusManagerState: _
	}), [l]);
	return /*#__PURE__*/ P(M.Fragment, { children: [u, /*#__PURE__*/ P(Ae.Provider, {
		value: S,
		children: [
			x && l && /*#__PURE__*/ N(Ce, {
				"data-type": "outside",
				ref: d,
				onFocus: (e) => {
					Z(e, l) ? m.current?.focus() : ge(g ? g.domReference : null)?.focus();
				}
			}),
			x && l && /*#__PURE__*/ N("span", {
				"aria-owns": l.id,
				style: ke
			}),
			l && /*#__PURE__*/ F.createPortal(a, l),
			x && l && /*#__PURE__*/ N(Ce, {
				"data-type": "outside",
				ref: p,
				onFocus: (e) => {
					Z(e, l) ? h.current?.focus() : (he(g ? g.domReference : null)?.focus(), g?.closeOnFocusOut && g?.onOpenChange(!1, f("focus-out", e.nativeEvent)));
				}
			})
		]
	})] });
});
process.env.NODE_ENV !== "production" && (Pe.displayName = "FloatingPortal");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js
function Fe() {
	let e = /* @__PURE__ */ new Map();
	return {
		emit(t, n) {
			e.get(t)?.forEach((e) => e(n));
		},
		on(t, n) {
			e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
		},
		off(t, n) {
			e.get(t)?.delete(n);
		}
	};
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTreeStore.js
var Ie = class {
	nodesRef = { current: [] };
	events = Fe();
	addNode(e) {
		this.nodesRef.current.push(e);
	}
	removeNode(e) {
		let t = this.nodesRef.current.findIndex((t) => t === e);
		t !== -1 && this.nodesRef.current.splice(t, 1);
	}
}, Le = /*#__PURE__*/ M.createContext(null);
process.env.NODE_ENV !== "production" && (Le.displayName = "FloatingNodeContext");
var Re = /*#__PURE__*/ M.createContext(null);
process.env.NODE_ENV !== "production" && (Re.displayName = "FloatingTreeContext");
var ze = () => M.useContext(Le)?.id || null, Be = (e) => {
	let t = M.useContext(Re);
	return e ?? t;
};
function Ve(e) {
	let n = p(), r = Be(e), i = ze();
	return t(() => {
		if (!n) return;
		let e = {
			id: n,
			parentId: i
		};
		return r?.addNode(e), () => {
			r?.removeNode(e);
		};
	}, [
		r,
		n,
		i
	]), n;
}
function He(e) {
	let { children: t, id: n } = e, r = ze();
	return /*#__PURE__*/ N(Le.Provider, {
		value: M.useMemo(() => ({
			id: n,
			parentId: r
		}), [n, r]),
		children: t
	});
}
function Ue(e) {
	let { children: t, externalTree: n } = e, i = r(() => n ?? new Ie()).current;
	return /*#__PURE__*/ N(Re.Provider, {
		value: i,
		children: t
	});
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js
var We = {
	intentional: "onClick",
	sloppy: "onPointerDown"
};
function Ge() {
	return !1;
}
function Ke(e) {
	return {
		escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
		outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
	};
}
function qe(e, t = {}) {
	let { enabled: n = !0, escapeKey: r = !0, outsidePress: i = !0, outsidePressEvent: a = "sloppy", referencePress: o = Ge, referencePressEvent: s = "sloppy", bubbles: p, externalTree: m } = t, h = "rootStore" in e ? e.rootStore : e, g = h.useState("open"), _ = h.useState("floatingElement"), { dataRef: S } = h.context, C = Be(m), re = c(typeof i == "function" ? i : () => !1), T = typeof i == "function" ? re : i, oe = T !== !1, E = c(() => a), { escapeKey: O, outsidePress: ce } = Ke(p), j = M.useRef(!1), N = M.useRef(!1), P = M.useRef(!1), F = M.useRef(!1), I = M.useRef(""), L = M.useRef(null), R = le(), z = le(), B = c(() => {
		z.clear(), S.current.insideReactTree = !1;
	}), V = c((e) => {
		let t = S.current.floatingContext?.nodeId;
		return (C ? de(C.nodesRef.current, t) : []).some((t) => t.context?.open && !t.context.dataRef.current[e]);
	}), H = c((e) => ae(e, h.select("floatingElement")) || ae(e, h.select("domReferenceElement"))), U = c((e) => {
		o() && h.setOpen(!1, f(l, e.nativeEvent));
	}), W = c((e) => {
		if (!g || !n || !r || e.key !== "Escape" || F.current || !O && V("__escapeKeyBubbles")) return;
		let t = f(d, D(e) ? e.nativeEvent : e);
		h.setOpen(!1, t), t.isCanceled || e.preventDefault(), !O && !t.isPropagationAllowed && e.stopPropagation();
	}), G = c(() => {
		S.current.insideReactTree = !0, z.start(0, B);
	}), K = c((e) => {
		if (!g || !n || e.button !== 0) return;
		let t = ie(e.nativeEvent);
		w(h.select("floatingElement"), t) && (j.current || (j.current = !0, N.current = !1));
	}), q = c((e) => {
		!g || !n || (e.defaultPrevented || e.nativeEvent.defaultPrevented) && j.current && (N.current = !0);
	});
	M.useEffect(() => {
		if (!g || !n) return;
		S.current.__escapeKeyBubbles = O, S.current.__outsidePressBubbles = ce;
		let e = new ue(), t = new ue();
		function i() {
			e.clear(), F.current = !0;
		}
		function a() {
			e.start(ne() ? 5 : 0, () => {
				F.current = !1;
			});
		}
		function o() {
			P.current = !0, t.start(0, () => {
				P.current = !1;
			});
		}
		function s() {
			j.current = !1, N.current = !1;
		}
		function c() {
			let e = I.current, t = e === "pen" || !e ? "mouse" : e, n = E(), r = typeof n == "function" ? n() : n;
			return typeof r == "string" ? r : r[t];
		}
		function l(e) {
			let t = c();
			return t === "intentional" && e.type !== "click" || t === "sloppy" && e.type === "click";
		}
		function d(e) {
			let t = S.current.floatingContext?.nodeId, n = C && de(C.nodesRef.current, t).some((t) => ae(e, t.context?.elements.floating));
			return H(e) || n;
		}
		function p(e) {
			if (l(e)) {
				e.type !== "click" && !H(e) && (t.clear(), P.current = !1), B();
				return;
			}
			if (S.current.insideReactTree) {
				B();
				return;
			}
			let n = ie(e), r = `[${we("inert")}]`, i = y(n) ? n.getRootNode() : null, a = Array.from((x(i) ? i : k(h.select("floatingElement"))).querySelectorAll(r)), o = h.context.triggerElements;
			if (n && (o.hasElement(n) || o.hasMatchingElement((e) => w(e, n)))) return;
			let s = y(n) ? n : null;
			for (; s && !ee(s);) {
				let e = v(s);
				if (ee(e) || !y(e)) break;
				s = e;
			}
			if (!(a.length && y(n) && !se(n) && !w(n, h.select("floatingElement")) && a.every((e) => !w(s, e)))) {
				if (b(n) && !("touches" in e)) {
					let t = ee(n), r = te(n), i = /auto|scroll/, a = t || i.test(r.overflowX), o = t || i.test(r.overflowY), s = a && n.clientWidth > 0 && n.scrollWidth > n.clientWidth, c = o && n.clientHeight > 0 && n.scrollHeight > n.clientHeight, l = r.direction === "rtl", u = c && (l ? e.offsetX <= n.offsetWidth - n.clientWidth : e.offsetX > n.clientWidth), d = s && e.offsetY > n.clientHeight;
					if (u || d) return;
				}
				if (!d(e)) {
					if (c() === "intentional" && P.current) {
						t.clear(), P.current = !1;
						return;
					}
					typeof T == "function" && !T(e) || V("__outsidePressBubbles") || (h.setOpen(!1, f(u, e)), B());
				}
			}
		}
		function m(e) {
			c() !== "sloppy" || e.pointerType === "touch" || !h.select("open") || !n || H(e) || p(e);
		}
		function re(e) {
			if (c() !== "sloppy" || !h.select("open") || !n || H(e)) return;
			let t = e.touches[0];
			t && (L.current = {
				startTime: Date.now(),
				startX: t.clientX,
				startY: t.clientY,
				dismissOnTouchEnd: !1,
				dismissOnMouseDown: !0
			}, R.start(1e3, () => {
				L.current && (L.current.dismissOnTouchEnd = !1, L.current.dismissOnMouseDown = !1);
			}));
		}
		function D(e, t) {
			let n = ie(e);
			if (!n) return;
			let r = A(n, e.type, () => {
				t(e), r();
			});
		}
		function le(e) {
			I.current = "touch", D(e, re);
		}
		function M(e) {
			R.clear(), e.type === "pointerdown" && (I.current = e.pointerType), !(e.type === "mousedown" && L.current && !L.current.dismissOnMouseDown) && D(e, (e) => {
				e.type === "pointerdown" ? m(e) : p(e);
			});
		}
		function z(e) {
			if (!j.current) return;
			let n = N.current;
			if (s(), c() === "intentional") {
				if (e.type === "pointercancel") {
					n && o();
					return;
				}
				if (!d(e)) {
					if (n) {
						o();
						return;
					}
					typeof T == "function" && !T(e) || (t.clear(), P.current = !0, B());
				}
			}
		}
		function U(e) {
			if (c() !== "sloppy" || !L.current || H(e)) return;
			let t = e.touches[0];
			if (!t) return;
			let n = Math.abs(t.clientX - L.current.startX), r = Math.abs(t.clientY - L.current.startY), i = Math.sqrt(n * n + r * r);
			i > 5 && (L.current.dismissOnTouchEnd = !0), i > 10 && (p(e), R.clear(), L.current = null);
		}
		function G(e) {
			D(e, U);
		}
		function K(e) {
			c() !== "sloppy" || !L.current || H(e) || (L.current.dismissOnTouchEnd && p(e), R.clear(), L.current = null);
		}
		function q(e) {
			D(e, K);
		}
		let J = k(_), Y = Q(r && Q(A(J, "keydown", W), A(J, "compositionstart", i), A(J, "compositionend", a)), oe && Q(A(J, "click", M, !0), A(J, "pointerdown", M, !0), A(J, "pointerup", z, !0), A(J, "pointercancel", z, !0), A(J, "mousedown", M, !0), A(J, "mouseup", z, !0), A(J, "touchstart", le, !0), A(J, "touchmove", G, !0), A(J, "touchend", q, !0)));
		return () => {
			Y(), e.clear(), t.clear(), s(), P.current = !1;
		};
	}, [
		S,
		_,
		r,
		oe,
		T,
		g,
		n,
		O,
		ce,
		W,
		B,
		E,
		V,
		H,
		C,
		h,
		R
	]), M.useEffect(B, [T, B]);
	let J = M.useMemo(() => ({
		onKeyDown: W,
		[We[s]]: U,
		...s !== "intentional" && { onClick: U }
	}), [
		W,
		U,
		s
	]), Y = M.useMemo(() => ({
		onKeyDown: W,
		onPointerDown: q,
		onMouseDown: q,
		onClickCapture: G,
		onMouseDownCapture(e) {
			G(), K(e);
		},
		onPointerDownCapture(e) {
			G(), K(e);
		},
		onMouseUpCapture: G,
		onTouchEndCapture: G,
		onTouchMoveCapture: G
	}), [
		W,
		G,
		K,
		q
	]);
	return M.useMemo(() => n ? {
		reference: J,
		floating: Y,
		trigger: J
	} : {}, [
		n,
		J,
		Y
	]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/store/createSelector.js
var $ = (e, t, n, r, i, a, ...o) => {
	if (o.length > 0) throw Error(process.env.NODE_ENV === "production" ? s(1) : "Unsupported number of selectors");
	let c;
	if (e && t && n && r && i && a) c = (o, s, c, l) => a(e(o, s, c, l), t(o, s, c, l), n(o, s, c, l), r(o, s, c, l), i(o, s, c, l), s, c, l);
	else if (e && t && n && r && i) c = (a, o, s, c) => i(e(a, o, s, c), t(a, o, s, c), n(a, o, s, c), r(a, o, s, c), o, s, c);
	else if (e && t && n && r) c = (i, a, o, s) => r(e(i, a, o, s), t(i, a, o, s), n(i, a, o, s), a, o, s);
	else if (e && t && n) c = (r, i, a, o) => n(e(r, i, a, o), t(r, i, a, o), i, a, o);
	else if (e && t) c = (n, r, i, a) => t(e(n, r, i, a), r, i, a);
	else if (e) c = e;
	else throw Error("Missing arguments");
	return c;
}, Je = /* @__PURE__ */ e(((e) => {
	var t = oe(), n = E();
	function r(e, t) {
		return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
	}
	var i = typeof Object.is == "function" ? Object.is : r, a = n.useSyncExternalStore, o = t.useRef, s = t.useEffect, c = t.useMemo, l = t.useDebugValue;
	e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
		var d = o(null);
		if (d.current === null) {
			var f = {
				hasValue: !1,
				value: null
			};
			d.current = f;
		} else f = d.current;
		d = c(function() {
			function e(e) {
				if (!a) {
					if (a = !0, o = e, e = r(e), u !== void 0 && f.hasValue) {
						var t = f.value;
						if (u(t, e)) return s = t;
					}
					return s = e;
				}
				if (t = s, i(o, e)) return t;
				var n = r(e);
				return u !== void 0 && u(t, n) ? (o = e, t) : (o = e, s = n);
			}
			var a = !1, o, s, c = n === void 0 ? null : n;
			return [function() {
				return e(t());
			}, c === null ? void 0 : function() {
				return e(c());
			}];
		}, [
			t,
			n,
			r,
			u
		]);
		var p = a(e, d[0], d[1]);
		return s(function() {
			f.hasValue = !0, f.value = p;
		}, [p]), l(p), p;
	};
})), Ye = /* @__PURE__ */ e(((e) => {
	process.env.NODE_ENV !== "production" && (function() {
		function t(e, t) {
			return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
		}
		typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
		var n = oe(), r = E(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
		e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
			var d = o(null);
			if (d.current === null) {
				var f = {
					hasValue: !1,
					value: null
				};
				d.current = f;
			} else f = d.current;
			d = c(function() {
				function e(e) {
					if (!a) {
						if (a = !0, o = e, e = r(e), u !== void 0 && f.hasValue) {
							var t = f.value;
							if (u(t, e)) return s = t;
						}
						return s = e;
					}
					if (t = s, i(o, e)) return t;
					var n = r(e);
					return u !== void 0 && u(t, n) ? (o = e, t) : (o = e, s = n);
				}
				var a = !1, o, s, c = n === void 0 ? null : n;
				return [function() {
					return e(t());
				}, c === null ? void 0 : function() {
					return e(c());
				}];
			}, [
				t,
				n,
				r,
				u
			]);
			var p = a(e, d[0], d[1]);
			return s(function() {
				f.hasValue = !0, f.value = p;
			}, [p]), l(p), p;
		}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
	})();
})), Xe = /* @__PURE__ */ e(((e, t) => {
	process.env.NODE_ENV === "production" ? t.exports = Je() : t.exports = Ye();
})), Ze = E(), Qe = Xe(), $e = [], et = void 0;
function tt() {
	return et;
}
function nt(e) {
	$e.push(e);
}
function rt(e) {
	let t = (t, n) => {
		let i = r(at).current, a;
		try {
			et = i;
			for (let e of $e) e.before(i);
			a = e(t, n);
			for (let e of $e) e.after(i);
			i.didInitialize = !0;
		} finally {
			et = void 0;
		}
		return a;
	};
	return t.displayName = e.displayName || e.name, t;
}
function it(e) {
	return /*#__PURE__*/ M.forwardRef(rt(e));
}
function at() {
	return { didInitialize: !1 };
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/store/useStore.js
var ot = n(19) ? lt : ut;
function st(e, t, n, r, i) {
	return ot(e, t, n, r, i);
}
function ct(e, t, n, r, i) {
	let a = M.useCallback(() => t(e.getSnapshot(), n, r, i), [
		e,
		t,
		n,
		r,
		i
	]);
	return (0, Ze.useSyncExternalStore)(e.subscribe, a, a);
}
nt({
	before(e) {
		e.syncIndex = 0, e.didInitialize || (e.syncTick = 1, e.syncHooks = [], e.didChangeStore = !0, e.getSnapshot = () => {
			let t = !1;
			for (let n = 0; n < e.syncHooks.length; n += 1) {
				let r = e.syncHooks[n], i = r.selector(r.store.state, r.a1, r.a2, r.a3);
				(r.didChange || !Object.is(r.value, i)) && (t = !0, r.value = i, r.didChange = !1);
			}
			return t && (e.syncTick += 1), e.syncTick;
		});
	},
	after(e) {
		e.syncHooks.length > 0 && (e.didChangeStore && (e.didChangeStore = !1, e.subscribe = (t) => {
			let n = /* @__PURE__ */ new Set();
			for (let t of e.syncHooks) n.add(t.store);
			let r = [];
			for (let e of n) r.push(e.subscribe(t));
			return () => {
				for (let e of r) e();
			};
		}), (0, Ze.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot));
	}
});
function lt(e, t, n, r, i) {
	let a = tt();
	if (!a) return ct(e, t, n, r, i);
	let o = a.syncIndex;
	a.syncIndex += 1;
	let s;
	return a.didInitialize ? (s = a.syncHooks[o], (s.store !== e || s.selector !== t || !Object.is(s.a1, n) || !Object.is(s.a2, r) || !Object.is(s.a3, i)) && (s.store !== e && (a.didChangeStore = !0), s.store = e, s.selector = t, s.a1 = n, s.a2 = r, s.a3 = i, s.didChange = !0)) : (s = {
		store: e,
		selector: t,
		a1: n,
		a2: r,
		a3: i,
		value: t(e.getSnapshot(), n, r, i),
		didChange: !1
	}, a.syncHooks.push(s)), s.value;
}
function ut(e, t, n, r, i) {
	return (0, Qe.useSyncExternalStoreWithSelector)(e.subscribe, e.getSnapshot, e.getSnapshot, (e) => t(e, n, r, i));
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+utils@0.2.9+f7941a290aa3d619/node_modules/@base-ui/utils/esm/store/Store.js
var dt = class {
	constructor(e) {
		this.state = e, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
	}
	subscribe = (e) => (this.listeners.add(e), () => {
		this.listeners.delete(e);
	});
	getSnapshot = () => this.state;
	setState(e) {
		if (this.state === e) return;
		this.state = e, this.updateTick += 1;
		let t = this.updateTick;
		for (let n of this.listeners) {
			if (t !== this.updateTick) return;
			n(e);
		}
	}
	update(e) {
		for (let t in e) if (!Object.is(this.state[t], e[t])) {
			this.setState({
				...this.state,
				...e
			});
			return;
		}
	}
	set(e, t) {
		Object.is(this.state[e], t) || this.setState({
			...this.state,
			[e]: t
		});
	}
	notifyAll() {
		let e = { ...this.state };
		this.setState(e);
	}
	use(e, t, n, r) {
		return st(this, e, t, n, r);
	}
}, ft = class extends dt {
	constructor(e, t = {}, n) {
		super(e), this.context = t, this.selectors = n;
	}
	useSyncedValue(e, n) {
		M.useDebugValue(e);
		let r = this;
		t(() => {
			r.state[e] !== n && r.set(e, n);
		}, [
			r,
			e,
			n
		]);
	}
	useSyncedValueWithCleanup(e, n) {
		let r = this;
		t(() => (r.state[e] !== n && r.set(e, n), () => {
			r.set(e, void 0);
		}), [
			r,
			e,
			n
		]);
	}
	useSyncedValues(e) {
		let n = this;
		if (process.env.NODE_ENV !== "production") {
			M.useDebugValue(e, (e) => Object.keys(e));
			let t = M.useRef(Object.keys(e)).current, n = Object.keys(e);
			(t.length !== n.length || t.some((e, t) => e !== n[t])) && console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
		}
		t(() => {
			n.update(e);
		}, [n, ...Object.values(e)]);
	}
	useControlledProp(e, n) {
		M.useDebugValue(e);
		let r = this, i = n !== void 0;
		if (t(() => {
			i && !Object.is(r.state[e], n) && r.setState({
				...r.state,
				[e]: n
			});
		}, [
			r,
			e,
			n,
			i
		]), process.env.NODE_ENV !== "production") {
			let t = this.controlledValues ??= /* @__PURE__ */ new Map();
			t.has(e) || t.set(e, i);
			let n = t.get(e);
			n !== void 0 && n !== i && console.error(`A component is changing the ${i ? "" : "un"}controlled state of ${e.toString()} to be ${i ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
		}
	}
	select(e, t, n, r) {
		let i = this.selectors[e];
		return i(this.state, t, n, r);
	}
	useState(e, t, n, r) {
		return M.useDebugValue(e), st(this, this.selectors[e], t, n, r);
	}
	useContextCallback(e, t) {
		M.useDebugValue(e);
		let n = c(t ?? a);
		this.context[e] = n;
	}
	useStateSetter(e) {
		let t = M.useRef(void 0);
		return t.current === void 0 && (t.current = (t) => {
			this.set(e, t);
		}), t.current;
	}
	observe(e, t) {
		let n;
		n = typeof e == "function" ? e : this.selectors[e];
		let r = n(this.state);
		return t(r, r, this), this.subscribe((e) => {
			let i = n(e);
			if (!Object.is(r, i)) {
				let e = r;
				r = i, t(i, e, this);
			}
		});
	}
}, pt = {
	open: $((e) => e.open),
	transitionStatus: $((e) => e.transitionStatus),
	domReferenceElement: $((e) => e.domReferenceElement),
	referenceElement: $((e) => e.positionReference ?? e.referenceElement),
	floatingElement: $((e) => e.floatingElement),
	floatingId: $((e) => e.floatingId)
}, mt = class extends ft {
	constructor(e) {
		let { syncOnly: t, nested: n, onOpenChange: r, triggerElements: i, ...a } = e;
		super({
			...a,
			positionReference: a.referenceElement,
			domReferenceElement: a.referenceElement
		}, {
			onOpenChange: r,
			dataRef: { current: {} },
			events: Fe(),
			nested: n,
			triggerElements: i
		}, pt), this.syncOnly = t;
	}
	syncOpenEvent = (e, t) => {
		(!e || !this.state.open || t != null && O(t)) && (this.context.dataRef.current.openEvent = e ? t : void 0);
	};
	dispatchOpenChange = (e, t) => {
		this.syncOpenEvent(e, t.event);
		let n = {
			open: e,
			reason: t.reason,
			nativeEvent: t.event,
			nested: this.context.nested,
			triggerElement: t.trigger
		};
		this.context.events.emit("openchange", n);
	};
	setOpen = (e, t) => {
		if (this.syncOnly) {
			this.context.onOpenChange?.(e, t);
			return;
		}
		this.dispatchOpenChange(e, t), this.context.onOpenChange?.(e, t);
	};
};
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js
function ht(e) {
	let { popupStore: n, treatPopupAsFloatingElement: r = !1, floatingRootContext: i, floatingId: a, nested: o, onOpenChange: s } = e, c = n.useState("open"), l = n.useState("activeTriggerElement"), u = n.useState(r ? "popupElement" : "positionerElement"), d = n.context.triggerElements, f = s, p = M.useRef(null);
	i === void 0 && p.current === null && (p.current = new mt({
		open: c,
		transitionStatus: void 0,
		referenceElement: l,
		floatingElement: u,
		triggerElements: d,
		onOpenChange: f,
		floatingId: a,
		syncOnly: !0,
		nested: o
	}));
	let m = i ?? p.current;
	return n.useSyncedValue("floatingId", a), t(() => {
		let e = {
			open: c,
			floatingId: a,
			referenceElement: l,
			floatingElement: u
		};
		y(l) && (e.domReferenceElement = l), m.state.positionReference === m.state.referenceElement && (e.positionReference = l), m.update(e);
	}, [
		c,
		a,
		l,
		u,
		m
	]), m.context.onOpenChange = f, m.context.nested = o, m;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js
var gt = {
	tabIndex: -1,
	[re]: ""
};
function _t(e, t, n = !1) {
	let r = p(), i = ze() != null, a = M.useRef(null);
	e === void 0 && a.current === null && (a.current = t(r, i));
	let o = e ?? a.current;
	return ht({
		popupStore: o,
		treatPopupAsFloatingElement: n,
		floatingRootContext: o.state.floatingRootContext,
		floatingId: r,
		nested: i,
		onOpenChange: o.setOpen
	}), {
		store: o,
		internalStore: a.current
	};
}
function vt(e, t) {
	let n = M.useRef(null), r = M.useRef(null);
	return M.useCallback((i) => {
		if (e === void 0) return;
		let a = !1;
		if (n.current !== null) {
			let e = n.current, i = r.current, o = t.context.triggerElements.getById(e);
			i && o === i && (t.context.triggerElements.delete(e), a = !0), n.current = null, r.current = null;
		}
		if (i !== null && (n.current = e, r.current = i, t.context.triggerElements.add(e, i), a = !0), a) {
			let e = t.context.triggerElements.size;
			t.select("open") && t.state.triggerCount !== e && t.set("triggerCount", e);
		}
	}, [t, e]);
}
function yt(e, t, n) {
	let r = n?.id ?? null;
	(r || t) && (e.activeTriggerId = r, e.activeTriggerElement = n ?? null);
}
function bt(e, n, r, i) {
	let a = r.useState("isMountedByTrigger", e), o = vt(e, r), s = c((t) => {
		if (o(t), !t) return;
		let n = r.select("open"), a = r.select("activeTriggerId");
		if (a === e) {
			r.update({
				activeTriggerElement: t,
				...n ? i : null
			});
			return;
		}
		a == null && n && r.update({
			activeTriggerId: e,
			activeTriggerElement: t,
			...i
		});
	});
	return t(() => {
		a && r.update({
			activeTriggerElement: n.current,
			...i
		});
	}, [
		a,
		r,
		n,
		...Object.values(i)
	]), {
		registerTrigger: s,
		isMountedByThisTrigger: a
	};
}
function xt(e) {
	let n = e.useState("open");
	t(() => {
		if (!n) {
			e.state.triggerCount !== 0 && e.set("triggerCount", 0);
			return;
		}
		let t = e.context.triggerElements.size, r = {};
		if (e.state.triggerCount !== t && (r.triggerCount = t), !e.select("activeTriggerId") && t === 1) {
			let t = e.context.triggerElements.entries().next();
			if (!t.done) {
				let [e, n] = t.value;
				r.activeTriggerId = e, r.activeTriggerElement = n;
			}
		}
		(r.triggerCount !== void 0 || r.activeTriggerId !== void 0) && e.update(r);
	}, [
		n,
		e,
		e.useState("triggerCount")
	]);
}
function St(e, t, n) {
	let { mounted: r, setMounted: i, transitionStatus: a } = h(e);
	t.useSyncedValues({
		mounted: r,
		transitionStatus: a
	});
	let o = c(() => {
		i(!1), t.update({
			activeTriggerId: null,
			activeTriggerElement: null,
			mounted: !1,
			preventUnmountingOnClose: !1
		}), n?.(), t.context.onOpenChangeComplete?.(!1);
	}), s = t.useState("preventUnmountingOnClose");
	return g({
		enabled: r && !e && !s,
		open: e,
		ref: t.context.popupRef,
		onComplete() {
			e || o();
		}
	}), {
		forceUnmount: o,
		transitionStatus: a
	};
}
function Ct(e, n) {
	e.useSyncedValues(n), t(() => () => {
		e.update({
			activeTriggerProps: i,
			inactiveTriggerProps: i,
			popupProps: i
		});
	}, [e]);
}
function wt(e, n) {
	t(() => {
		!n && e.state.openMethod !== null && e.set("openMethod", null);
	}, [n, e]), t(() => () => {
		e.state.openMethod !== null && e.set("openMethod", null);
	}, [e]);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/popups/popupTriggerMap.js
var Tt = class {
	constructor() {
		this.elementsSet = /* @__PURE__ */ new Set(), this.idMap = /* @__PURE__ */ new Map();
	}
	add(e, t) {
		let n = this.idMap.get(e);
		if (n !== t && (n !== void 0 && this.elementsSet.delete(n), this.elementsSet.add(t), this.idMap.set(e, t), process.env.NODE_ENV !== "production" && this.elementsSet.size !== this.idMap.size)) throw Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
	}
	delete(e) {
		let t = this.idMap.get(e);
		t && (this.elementsSet.delete(t), this.idMap.delete(e));
	}
	hasElement(e) {
		return this.elementsSet.has(e);
	}
	hasMatchingElement(e) {
		for (let t of this.elementsSet) if (e(t)) return !0;
		return !1;
	}
	getById(e) {
		return this.idMap.get(e);
	}
	entries() {
		return this.idMap.entries();
	}
	elements() {
		return this.elementsSet.values();
	}
	get size() {
		return this.idMap.size;
	}
}, Et = function(e) {
	return e.open = "data-open", e.closed = "data-closed", e[e.startingStyle = m.startingStyle] = "startingStyle", e[e.endingStyle = m.endingStyle] = "endingStyle", e.anchorHidden = "data-anchor-hidden", e.side = "data-side", e.align = "data-align", e;
}({}), Dt = /*#__PURE__*/ function(e) {
	return e.popupOpen = "data-popup-open", e.pressed = "data-pressed", e;
}({}), Ot = { [Dt.popupOpen]: "" }, kt = {
	[Dt.popupOpen]: "",
	[Dt.pressed]: ""
}, At = { [Et.open]: "" }, jt = { [Et.closed]: "" }, Mt = { [Et.anchorHidden]: "" }, Nt = { open(e) {
	return e ? Ot : null;
} }, Pt = { open(e) {
	return e ? kt : null;
} }, Ft = {
	open(e) {
		return e ? At : jt;
	},
	anchorHidden(e) {
		return e ? Mt : null;
	}
};
//#endregion
export { Ie as A, Q as B, $ as C, Ve as D, Ue as E, Te as F, ve as G, pe as H, De as I, fe as J, ye as K, Oe as L, Ne as M, je as N, ze as O, Ee as P, we as R, it as S, He as T, he as U, Se as V, ge as W, I as X, X as Y, de as Z, mt as _, Nt as a, st as b, yt as c, Ct as d, wt as f, ht as g, vt as h, Pt as i, Pe as j, Be as k, xt as l, bt as m, Dt as n, Tt as o, _t as p, Z as q, Ft as r, gt as s, Et as t, St as u, ft as v, qe as w, rt as x, dt as y, Ce as z };
