import * as e from "react";
import { Fragment as t, jsx as n } from "react/jsx-runtime";
import * as r from "react-dom";
//#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
function i(e, t) {
	if (typeof e == "function") return e(t);
	e != null && (e.current = t);
}
function a(...e) {
	return (t) => {
		let n = !1, r = e.map((e) => {
			let r = i(e, t);
			return !n && typeof r == "function" && (n = !0), r;
		});
		if (n) return () => {
			for (let t = 0; t < r.length; t++) {
				let n = r[t];
				typeof n == "function" ? n() : i(e[t], null);
			}
		};
	};
}
function o(...t) {
	return e.useCallback(a(...t), t);
}
//#endregion
//#region node_modules/@radix-ui/react-slot/dist/index.mjs
/* @__NO_SIDE_EFFECTS__ */
function s(t) {
	let r = /* @__PURE__ */ c(t), i = e.forwardRef((t, i) => {
		let { children: a, ...o } = t, s = e.Children.toArray(a), c = s.find(d);
		if (c) {
			let t = c.props.children, a = s.map((n) => n === c ? e.Children.count(t) > 1 ? e.Children.only(null) : e.isValidElement(t) ? t.props.children : null : n);
			return /* @__PURE__ */ n(r, {
				...o,
				ref: i,
				children: e.isValidElement(t) ? e.cloneElement(t, void 0, a) : null
			});
		}
		return /* @__PURE__ */ n(r, {
			...o,
			ref: i,
			children: a
		});
	});
	return i.displayName = `${t}.Slot`, i;
}
/* @__NO_SIDE_EFFECTS__ */
function c(t) {
	let n = e.forwardRef((t, n) => {
		let { children: r, ...i } = t;
		if (e.isValidElement(r)) {
			let t = p(r), o = f(i, r.props);
			return r.type !== e.Fragment && (o.ref = n ? a(n, t) : t), e.cloneElement(r, o);
		}
		return e.Children.count(r) > 1 ? e.Children.only(null) : null;
	});
	return n.displayName = `${t}.SlotClone`, n;
}
var l = Symbol("radix.slottable");
/* @__NO_SIDE_EFFECTS__ */
function u(e) {
	let r = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
	return r.displayName = `${e}.Slottable`, r.__radixId = l, r;
}
function d(t) {
	return e.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === l;
}
function f(e, t) {
	let n = { ...t };
	for (let r in t) {
		let i = e[r], a = t[r];
		/^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
			let t = a(...e);
			return i(...e), t;
		} : i && (n[r] = i) : r === "style" ? n[r] = {
			...i,
			...a
		} : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
	}
	return {
		...e,
		...n
	};
}
function p(e) {
	let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
	return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
}
//#endregion
//#region node_modules/@radix-ui/react-primitive/dist/index.mjs
var m = [
	"a",
	"button",
	"div",
	"form",
	"h2",
	"h3",
	"img",
	"input",
	"label",
	"li",
	"nav",
	"ol",
	"p",
	"select",
	"span",
	"svg",
	"ul"
].reduce((t, r) => {
	let i = /* @__PURE__ */ s(`Primitive.${r}`), a = e.forwardRef((e, t) => {
		let { asChild: a, ...o } = e, s = a ? i : r;
		return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(s, {
			...o,
			ref: t
		});
	});
	return a.displayName = `Primitive.${r}`, {
		...t,
		[r]: a
	};
}, {});
function h(e, t) {
	e && r.flushSync(() => e.dispatchEvent(t));
}
//#endregion
export { a, u as i, h as n, o, s as r, m as t };

//# sourceMappingURL=dist-D-6_qntS.js.map