import { t as e } from "./utils-B7XIe3qq.js";
import { t } from "./check-CybgTpDT.js";
import { t as n } from "./chevron-down-C_008JAH.js";
import { t as r } from "./chevron-up-BY5jyuW2.js";
import { n as i, t as a } from "./dist-CTlQcJNK.js";
import { a as o, o as s, r as c, t as l } from "./dist-koa_pEtu.js";
import { t as u } from "./dist-CpMqmV-i.js";
import { t as d } from "./dist-C0wG5dwG.js";
import { t as f } from "./dist-RmXz0NYF.js";
import { t as p } from "./dist-BBVMDH9A.js";
import { i as m, n as h, r as g, t as _ } from "./es2015-Bv2aaatg.js";
import { t as v } from "./dist-DGayZ3ok2.js";
import { t as y } from "./dist-cMlzVrN6.js";
import { t as b } from "./dist-CVCn7F_m.js";
import { a as x, i as S, n as C, r as w, t as T } from "./dist-CbqFryer.js";
import { t as E } from "./dist-Cao8o5bZ.js";
import { t as D } from "./dist-Dm7Xaded.js";
import { n as O } from "./dist-CcNjOWyQ.js";
import * as k from "react";
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
import * as N from "react-dom";
//#region node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.mjs
/* @__NO_SIDE_EFFECTS__ */
function P(e) {
	let t = /* @__PURE__ */ ee(e), n = k.forwardRef((e, n) => {
		let { children: r, ...i } = e, a = k.Children.toArray(r), o = a.find(I);
		if (o) {
			let e = o.props.children, r = a.map((t) => t === o ? k.Children.count(e) > 1 ? k.Children.only(null) : k.isValidElement(e) ? e.props.children : null : t);
			return /* @__PURE__ */ j(t, {
				...i,
				ref: n,
				children: k.isValidElement(e) ? k.cloneElement(e, void 0, r) : null
			});
		}
		return /* @__PURE__ */ j(t, {
			...i,
			ref: n,
			children: r
		});
	});
	return n.displayName = `${e}.Slot`, n;
}
/* @__NO_SIDE_EFFECTS__ */
function ee(e) {
	let t = k.forwardRef((e, t) => {
		let { children: n, ...r } = e;
		if (k.isValidElement(n)) {
			let e = te(n), i = L(r, n.props);
			return n.type !== k.Fragment && (i.ref = t ? a(t, e) : e), k.cloneElement(n, i);
		}
		return k.Children.count(n) > 1 ? k.Children.only(null) : null;
	});
	return t.displayName = `${e}.SlotClone`, t;
}
var F = Symbol("radix.slottable");
function I(e) {
	return k.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === F;
}
function L(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 te(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-select/dist/index.mjs
var R = [
	" ",
	"Enter",
	"ArrowUp",
	"ArrowDown"
], z = [" ", "Enter"], B = "Select", [V, H, U] = y(B), [W, ne] = o(B, [U, x]), G = x(), [re, K] = W(B), [ie, q] = W(B), J = (e) => {
	let { __scopeSelect: t, children: n, open: r, defaultOpen: i, onOpenChange: a, value: o, defaultValue: s, onValueChange: c, dir: l, name: f, autoComplete: p, disabled: m, required: h, form: g } = e, _ = G(t), [v, y] = k.useState(null), [x, C] = k.useState(null), [w, T] = k.useState(!1), E = b(l), [D, O] = d({
		prop: r,
		defaultProp: i ?? !1,
		onChange: a,
		caller: B
	}), [A, N] = d({
		prop: o,
		defaultProp: s,
		onChange: c,
		caller: B
	}), P = k.useRef(null), ee = v ? g || !!v.closest("form") : !0, [F, I] = k.useState(/* @__PURE__ */ new Set()), L = Array.from(F).map((e) => e.props.value).join(";");
	return /* @__PURE__ */ j(S, {
		..._,
		children: /* @__PURE__ */ M(re, {
			required: h,
			scope: t,
			trigger: v,
			onTriggerChange: y,
			valueNode: x,
			onValueNodeChange: C,
			valueNodeHasChildren: w,
			onValueNodeHasChildrenChange: T,
			contentId: u(),
			value: A,
			onValueChange: N,
			open: D,
			onOpenChange: O,
			dir: E,
			triggerPointerDownPosRef: P,
			disabled: m,
			children: [/* @__PURE__ */ j(V.Provider, {
				scope: t,
				children: /* @__PURE__ */ j(ie, {
					scope: e.__scopeSelect,
					onNativeOptionAdd: k.useCallback((e) => {
						I((t) => new Set(t).add(e));
					}, []),
					onNativeOptionRemove: k.useCallback((e) => {
						I((t) => {
							let n = new Set(t);
							return n.delete(e), n;
						});
					}, []),
					children: n
				})
			}), ee ? /* @__PURE__ */ M(Je, {
				"aria-hidden": !0,
				required: h,
				tabIndex: -1,
				name: f,
				autoComplete: p,
				value: A,
				onChange: (e) => N(e.target.value),
				disabled: m,
				form: g,
				children: [A === void 0 ? /* @__PURE__ */ j("option", { value: "" }) : null, Array.from(F)]
			}, L) : null]
		})
	});
};
J.displayName = B;
var ae = "SelectTrigger", oe = k.forwardRef((e, t) => {
	let { __scopeSelect: n, disabled: r = !1, ...a } = e, o = G(n), c = K(ae, n), u = c.disabled || r, d = i(t, c.onTriggerChange), f = H(n), p = k.useRef("touch"), [m, h, g] = Xe((e) => {
		let t = f().filter((e) => !e.disabled), n = Ze(t, e, t.find((e) => e.value === c.value));
		n !== void 0 && c.onValueChange(n.value);
	}), _ = (e) => {
		u || (c.onOpenChange(!0), g()), e && (c.triggerPointerDownPosRef.current = {
			x: Math.round(e.pageX),
			y: Math.round(e.pageY)
		});
	};
	return /* @__PURE__ */ j(T, {
		asChild: !0,
		...o,
		children: /* @__PURE__ */ j(l.button, {
			type: "button",
			role: "combobox",
			"aria-controls": c.contentId,
			"aria-expanded": c.open,
			"aria-required": c.required,
			"aria-autocomplete": "none",
			dir: c.dir,
			"data-state": c.open ? "open" : "closed",
			disabled: u,
			"data-disabled": u ? "" : void 0,
			"data-placeholder": Ye(c.value) ? "" : void 0,
			...a,
			ref: d,
			onClick: s(a.onClick, (e) => {
				e.currentTarget.focus(), p.current !== "mouse" && _(e);
			}),
			onPointerDown: s(a.onPointerDown, (e) => {
				p.current = e.pointerType;
				let t = e.target;
				t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), e.button === 0 && e.ctrlKey === !1 && e.pointerType === "mouse" && (_(e), e.preventDefault());
			}),
			onKeyDown: s(a.onKeyDown, (e) => {
				let t = m.current !== "";
				!(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && h(e.key), !(t && e.key === " ") && R.includes(e.key) && (_(), e.preventDefault());
			})
		})
	});
});
oe.displayName = ae;
var se = "SelectValue", ce = k.forwardRef((e, t) => {
	let { __scopeSelect: n, className: r, style: a, children: o, placeholder: s = "", ...u } = e, d = K(se, n), { onValueNodeHasChildrenChange: f } = d, p = o !== void 0, m = i(t, d.onValueNodeChange);
	return c(() => {
		f(p);
	}, [f, p]), /* @__PURE__ */ j(l.span, {
		...u,
		ref: m,
		style: { pointerEvents: "none" },
		children: Ye(d.value) ? /* @__PURE__ */ j(A, { children: s }) : o
	});
});
ce.displayName = se;
var le = "SelectIcon", ue = k.forwardRef((e, t) => {
	let { __scopeSelect: n, children: r, ...i } = e;
	return /* @__PURE__ */ j(l.span, {
		"aria-hidden": !0,
		...i,
		ref: t,
		children: r || "▼"
	});
});
ue.displayName = le;
var de = "SelectPortal", fe = (e) => /* @__PURE__ */ j(v, {
	asChild: !0,
	...e
});
fe.displayName = de;
var Y = "SelectContent", pe = k.forwardRef((e, t) => {
	let n = K(Y, e.__scopeSelect), [r, i] = k.useState();
	if (c(() => {
		i(new DocumentFragment());
	}, []), !n.open) {
		let t = r;
		return t ? N.createPortal(/* @__PURE__ */ j(me, {
			scope: e.__scopeSelect,
			children: /* @__PURE__ */ j(V.Slot, {
				scope: e.__scopeSelect,
				children: /* @__PURE__ */ j("div", { children: e.children })
			})
		}), t) : null;
	}
	return /* @__PURE__ */ j(_e, {
		...e,
		ref: t
	});
});
pe.displayName = Y;
var X = 10, [me, Z] = W(Y), he = "SelectContentImpl", ge = /* @__PURE__ */ P("SelectContent.RemoveScroll"), _e = k.forwardRef((e, t) => {
	let { __scopeSelect: n, position: r = "item-aligned", onCloseAutoFocus: a, onEscapeKeyDown: o, onPointerDownOutside: c, side: l, sideOffset: u, align: d, alignOffset: f, arrowPadding: v, collisionBoundary: y, collisionPadding: b, sticky: x, hideWhenDetached: S, avoidCollisions: C, ...w } = e, T = K(Y, n), [E, D] = k.useState(null), [O, A] = k.useState(null), M = i(t, (e) => D(e)), [N, P] = k.useState(null), [ee, F] = k.useState(null), I = H(n), [L, te] = k.useState(!1), R = k.useRef(!1);
	k.useEffect(() => {
		if (E) return _(E);
	}, [E]), g();
	let z = k.useCallback((e) => {
		let [t, ...n] = I().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
		for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && O && (O.scrollTop = 0), n === r && O && (O.scrollTop = O.scrollHeight), n?.focus(), document.activeElement !== i)) return;
	}, [I, O]), B = k.useCallback(() => z([N, E]), [
		z,
		N,
		E
	]);
	k.useEffect(() => {
		L && B();
	}, [L, B]);
	let { onOpenChange: V, triggerPointerDownPosRef: U } = T;
	k.useEffect(() => {
		if (E) {
			let e = {
				x: 0,
				y: 0
			}, t = (t) => {
				e = {
					x: Math.abs(Math.round(t.pageX) - (U.current?.x ?? 0)),
					y: Math.abs(Math.round(t.pageY) - (U.current?.y ?? 0))
				};
			}, n = (n) => {
				e.x <= 10 && e.y <= 10 ? n.preventDefault() : E.contains(n.target) || V(!1), document.removeEventListener("pointermove", t), U.current = null;
			};
			return U.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
				capture: !0,
				once: !0
			})), () => {
				document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n, { capture: !0 });
			};
		}
	}, [
		E,
		V,
		U
	]), k.useEffect(() => {
		let e = () => V(!1);
		return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
			window.removeEventListener("blur", e), window.removeEventListener("resize", e);
		};
	}, [V]);
	let [W, ne] = Xe((e) => {
		let t = I().filter((e) => !e.disabled), n = Ze(t, e, t.find((e) => e.ref.current === document.activeElement));
		n && setTimeout(() => n.ref.current.focus());
	}), G = k.useCallback((e, t, n) => {
		let r = !R.current && !n;
		(T.value !== void 0 && T.value === t || r) && (P(e), r && (R.current = !0));
	}, [T.value]), re = k.useCallback(() => E?.focus(), [E]), ie = k.useCallback((e, t, n) => {
		let r = !R.current && !n;
		(T.value !== void 0 && T.value === t || r) && F(e);
	}, [T.value]), q = r === "popper" ? xe : ye, J = q === xe ? {
		side: l,
		sideOffset: u,
		align: d,
		alignOffset: f,
		arrowPadding: v,
		collisionBoundary: y,
		collisionPadding: b,
		sticky: x,
		hideWhenDetached: S,
		avoidCollisions: C
	} : {};
	return /* @__PURE__ */ j(me, {
		scope: n,
		content: E,
		viewport: O,
		onViewportChange: A,
		itemRefCallback: G,
		selectedItem: N,
		onItemLeave: re,
		itemTextRefCallback: ie,
		focusSelectedItem: B,
		selectedItemText: ee,
		position: r,
		isPositioned: L,
		searchRef: W,
		children: /* @__PURE__ */ j(h, {
			as: ge,
			allowPinchZoom: !0,
			children: /* @__PURE__ */ j(m, {
				asChild: !0,
				trapped: T.open,
				onMountAutoFocus: (e) => {
					e.preventDefault();
				},
				onUnmountAutoFocus: s(a, (e) => {
					T.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
				}),
				children: /* @__PURE__ */ j(p, {
					asChild: !0,
					disableOutsidePointerEvents: !0,
					onEscapeKeyDown: o,
					onPointerDownOutside: c,
					onFocusOutside: (e) => e.preventDefault(),
					onDismiss: () => T.onOpenChange(!1),
					children: /* @__PURE__ */ j(q, {
						role: "listbox",
						id: T.contentId,
						"data-state": T.open ? "open" : "closed",
						dir: T.dir,
						onContextMenu: (e) => e.preventDefault(),
						...w,
						...J,
						onPlaced: () => te(!0),
						ref: M,
						style: {
							display: "flex",
							flexDirection: "column",
							outline: "none",
							...w.style
						},
						onKeyDown: s(w.onKeyDown, (e) => {
							let t = e.ctrlKey || e.altKey || e.metaKey;
							if (e.key === "Tab" && e.preventDefault(), !t && e.key.length === 1 && ne(e.key), [
								"ArrowUp",
								"ArrowDown",
								"Home",
								"End"
							].includes(e.key)) {
								let t = I().filter((e) => !e.disabled).map((e) => e.ref.current);
								if (["ArrowUp", "End"].includes(e.key) && (t = t.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e.key)) {
									let n = e.target, r = t.indexOf(n);
									t = t.slice(r + 1);
								}
								setTimeout(() => z(t)), e.preventDefault();
							}
						})
					})
				})
			})
		})
	});
});
_e.displayName = he;
var ve = "SelectItemAlignedPosition", ye = k.forwardRef((e, t) => {
	let { __scopeSelect: n, onPlaced: r, ...a } = e, o = K(Y, n), s = Z(Y, n), [u, d] = k.useState(null), [f, p] = k.useState(null), m = i(t, (e) => p(e)), h = H(n), g = k.useRef(!1), _ = k.useRef(!0), { viewport: v, selectedItem: y, selectedItemText: b, focusSelectedItem: x } = s, S = k.useCallback(() => {
		if (o.trigger && o.valueNode && u && f && v && y && b) {
			let e = o.trigger.getBoundingClientRect(), t = f.getBoundingClientRect(), n = o.valueNode.getBoundingClientRect(), i = b.getBoundingClientRect();
			if (o.dir !== "rtl") {
				let r = i.left - t.left, a = n.left - r, o = e.left - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = D(a, [X, Math.max(X, l - c)]);
				u.style.minWidth = s + "px", u.style.left = d + "px";
			} else {
				let r = t.right - i.right, a = window.innerWidth - n.right - r, o = window.innerWidth - e.right - a, s = e.width + o, c = Math.max(s, t.width), l = window.innerWidth - X, d = D(a, [X, Math.max(X, l - c)]);
				u.style.minWidth = s + "px", u.style.right = d + "px";
			}
			let a = h(), s = window.innerHeight - X * 2, c = v.scrollHeight, l = window.getComputedStyle(f), d = parseInt(l.borderTopWidth, 10), p = parseInt(l.paddingTop, 10), m = parseInt(l.borderBottomWidth, 10), _ = parseInt(l.paddingBottom, 10), x = d + p + c + _ + m, S = Math.min(y.offsetHeight * 5, x), C = window.getComputedStyle(v), w = parseInt(C.paddingTop, 10), T = parseInt(C.paddingBottom, 10), E = e.top + e.height / 2 - X, O = s - E, k = y.offsetHeight / 2, A = y.offsetTop + k, j = d + p + A, M = x - j;
			if (j <= E) {
				let e = a.length > 0 && y === a[a.length - 1].ref.current;
				u.style.bottom = "0px";
				let t = f.clientHeight - v.offsetTop - v.offsetHeight, n = j + Math.max(O, k + (e ? T : 0) + t + m);
				u.style.height = n + "px";
			} else {
				let e = a.length > 0 && y === a[0].ref.current;
				u.style.top = "0px";
				let t = Math.max(E, d + v.offsetTop + (e ? w : 0) + k) + M;
				u.style.height = t + "px", v.scrollTop = j - E + v.offsetTop;
			}
			u.style.margin = `${X}px 0`, u.style.minHeight = S + "px", u.style.maxHeight = s + "px", r?.(), requestAnimationFrame(() => g.current = !0);
		}
	}, [
		h,
		o.trigger,
		o.valueNode,
		u,
		f,
		v,
		y,
		b,
		o.dir,
		r
	]);
	c(() => S(), [S]);
	let [C, w] = k.useState();
	return c(() => {
		f && w(window.getComputedStyle(f).zIndex);
	}, [f]), /* @__PURE__ */ j(Se, {
		scope: n,
		contentWrapper: u,
		shouldExpandOnScrollRef: g,
		onScrollButtonChange: k.useCallback((e) => {
			e && _.current === !0 && (S(), x?.(), _.current = !1);
		}, [S, x]),
		children: /* @__PURE__ */ j("div", {
			ref: d,
			style: {
				display: "flex",
				flexDirection: "column",
				position: "fixed",
				zIndex: C
			},
			children: /* @__PURE__ */ j(l.div, {
				...a,
				ref: m,
				style: {
					boxSizing: "border-box",
					maxHeight: "100%",
					...a.style
				}
			})
		})
	});
});
ye.displayName = ve;
var be = "SelectPopperPosition", xe = k.forwardRef((e, t) => {
	let { __scopeSelect: n, align: r = "start", collisionPadding: i = X, ...a } = e;
	return /* @__PURE__ */ j(w, {
		...G(n),
		...a,
		ref: t,
		align: r,
		collisionPadding: i,
		style: {
			boxSizing: "border-box",
			...a.style,
			"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
			"--radix-select-content-available-width": "var(--radix-popper-available-width)",
			"--radix-select-content-available-height": "var(--radix-popper-available-height)",
			"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
			"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
		}
	});
});
xe.displayName = be;
var [Se, Ce] = W(Y, {}), we = "SelectViewport", Te = k.forwardRef((e, t) => {
	let { __scopeSelect: n, nonce: r, ...a } = e, o = Z(we, n), c = Ce(we, n), u = i(t, o.onViewportChange), d = k.useRef(0);
	return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("style", {
		dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
		nonce: r
	}), /* @__PURE__ */ j(V.Slot, {
		scope: n,
		children: /* @__PURE__ */ j(l.div, {
			"data-radix-select-viewport": "",
			role: "presentation",
			...a,
			ref: u,
			style: {
				position: "relative",
				flex: 1,
				overflow: "hidden auto",
				...a.style
			},
			onScroll: s(a.onScroll, (e) => {
				let t = e.currentTarget, { contentWrapper: n, shouldExpandOnScrollRef: r } = c;
				if (r?.current && n) {
					let e = Math.abs(d.current - t.scrollTop);
					if (e > 0) {
						let r = window.innerHeight - X * 2, i = parseFloat(n.style.minHeight), a = parseFloat(n.style.height), o = Math.max(i, a);
						if (o < r) {
							let i = o + e, a = Math.min(r, i), s = i - a;
							n.style.height = a + "px", n.style.bottom === "0px" && (t.scrollTop = s > 0 ? s : 0, n.style.justifyContent = "flex-end");
						}
					}
				}
				d.current = t.scrollTop;
			})
		})
	})] });
});
Te.displayName = we;
var Ee = "SelectGroup", [De, Oe] = W(Ee), ke = k.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = u();
	return /* @__PURE__ */ j(De, {
		scope: n,
		id: i,
		children: /* @__PURE__ */ j(l.div, {
			role: "group",
			"aria-labelledby": i,
			...r,
			ref: t
		})
	});
});
ke.displayName = Ee;
var Ae = "SelectLabel", je = k.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = Oe(Ae, n);
	return /* @__PURE__ */ j(l.div, {
		id: i.id,
		...r,
		ref: t
	});
});
je.displayName = Ae;
var Q = "SelectItem", [Me, Ne] = W(Q), Pe = k.forwardRef((e, t) => {
	let { __scopeSelect: n, value: r, disabled: a = !1, textValue: o, ...c } = e, d = K(Q, n), f = Z(Q, n), p = d.value === r, [m, h] = k.useState(o ?? ""), [g, _] = k.useState(!1), v = i(t, (e) => f.itemRefCallback?.(e, r, a)), y = u(), b = k.useRef("touch"), x = () => {
		a || (d.onValueChange(r), d.onOpenChange(!1));
	};
	if (r === "") throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
	return /* @__PURE__ */ j(Me, {
		scope: n,
		value: r,
		disabled: a,
		textId: y,
		isSelected: p,
		onItemTextChange: k.useCallback((e) => {
			h((t) => t || (e?.textContent ?? "").trim());
		}, []),
		children: /* @__PURE__ */ j(V.ItemSlot, {
			scope: n,
			value: r,
			disabled: a,
			textValue: m,
			children: /* @__PURE__ */ j(l.div, {
				role: "option",
				"aria-labelledby": y,
				"data-highlighted": g ? "" : void 0,
				"aria-selected": p && g,
				"data-state": p ? "checked" : "unchecked",
				"aria-disabled": a || void 0,
				"data-disabled": a ? "" : void 0,
				tabIndex: a ? void 0 : -1,
				...c,
				ref: v,
				onFocus: s(c.onFocus, () => _(!0)),
				onBlur: s(c.onBlur, () => _(!1)),
				onClick: s(c.onClick, () => {
					b.current !== "mouse" && x();
				}),
				onPointerUp: s(c.onPointerUp, () => {
					b.current === "mouse" && x();
				}),
				onPointerDown: s(c.onPointerDown, (e) => {
					b.current = e.pointerType;
				}),
				onPointerMove: s(c.onPointerMove, (e) => {
					b.current = e.pointerType, a ? f.onItemLeave?.() : b.current === "mouse" && e.currentTarget.focus({ preventScroll: !0 });
				}),
				onPointerLeave: s(c.onPointerLeave, (e) => {
					e.currentTarget === document.activeElement && f.onItemLeave?.();
				}),
				onKeyDown: s(c.onKeyDown, (e) => {
					f.searchRef?.current !== "" && e.key === " " || (z.includes(e.key) && x(), e.key === " " && e.preventDefault());
				})
			})
		})
	});
});
Pe.displayName = Q;
var $ = "SelectItemText", Fe = k.forwardRef((e, t) => {
	let { __scopeSelect: n, className: r, style: a, ...o } = e, s = K($, n), u = Z($, n), d = Ne($, n), f = q($, n), [p, m] = k.useState(null), h = i(t, (e) => m(e), d.onItemTextChange, (e) => u.itemTextRefCallback?.(e, d.value, d.disabled)), g = p?.textContent, _ = k.useMemo(() => /* @__PURE__ */ j("option", {
		value: d.value,
		disabled: d.disabled,
		children: g
	}, d.value), [
		d.disabled,
		d.value,
		g
	]), { onNativeOptionAdd: v, onNativeOptionRemove: y } = f;
	return c(() => (v(_), () => y(_)), [
		v,
		y,
		_
	]), /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(l.span, {
		id: d.textId,
		...o,
		ref: h
	}), d.isSelected && s.valueNode && !s.valueNodeHasChildren ? N.createPortal(o.children, s.valueNode) : null] });
});
Fe.displayName = $;
var Ie = "SelectItemIndicator", Le = k.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e;
	return Ne(Ie, n).isSelected ? /* @__PURE__ */ j(l.span, {
		"aria-hidden": !0,
		...r,
		ref: t
	}) : null;
});
Le.displayName = Ie;
var Re = "SelectScrollUpButton", ze = k.forwardRef((e, t) => {
	let n = Z(Re, e.__scopeSelect), r = Ce(Re, e.__scopeSelect), [a, o] = k.useState(!1), s = i(t, r.onScrollButtonChange);
	return c(() => {
		if (n.viewport && n.isPositioned) {
			let e = function() {
				o(t.scrollTop > 0);
			}, t = n.viewport;
			return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
		}
	}, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ j(He, {
		...e,
		ref: s,
		onAutoScroll: () => {
			let { viewport: e, selectedItem: t } = n;
			e && t && (e.scrollTop -= t.offsetHeight);
		}
	}) : null;
});
ze.displayName = Re;
var Be = "SelectScrollDownButton", Ve = k.forwardRef((e, t) => {
	let n = Z(Be, e.__scopeSelect), r = Ce(Be, e.__scopeSelect), [a, o] = k.useState(!1), s = i(t, r.onScrollButtonChange);
	return c(() => {
		if (n.viewport && n.isPositioned) {
			let e = function() {
				let e = t.scrollHeight - t.clientHeight;
				o(Math.ceil(t.scrollTop) < e);
			}, t = n.viewport;
			return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
		}
	}, [n.viewport, n.isPositioned]), a ? /* @__PURE__ */ j(He, {
		...e,
		ref: s,
		onAutoScroll: () => {
			let { viewport: e, selectedItem: t } = n;
			e && t && (e.scrollTop += t.offsetHeight);
		}
	}) : null;
});
Ve.displayName = Be;
var He = k.forwardRef((e, t) => {
	let { __scopeSelect: n, onAutoScroll: r, ...i } = e, a = Z("SelectScrollButton", n), o = k.useRef(null), u = H(n), d = k.useCallback(() => {
		o.current !== null && (window.clearInterval(o.current), o.current = null);
	}, []);
	return k.useEffect(() => () => d(), [d]), c(() => {
		u().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
	}, [u]), /* @__PURE__ */ j(l.div, {
		"aria-hidden": !0,
		...i,
		ref: t,
		style: {
			flexShrink: 0,
			...i.style
		},
		onPointerDown: s(i.onPointerDown, () => {
			o.current === null && (o.current = window.setInterval(r, 50));
		}),
		onPointerMove: s(i.onPointerMove, () => {
			a.onItemLeave?.(), o.current === null && (o.current = window.setInterval(r, 50));
		}),
		onPointerLeave: s(i.onPointerLeave, () => {
			d();
		})
	});
}), Ue = "SelectSeparator", We = k.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e;
	return /* @__PURE__ */ j(l.div, {
		"aria-hidden": !0,
		...r,
		ref: t
	});
});
We.displayName = Ue;
var Ge = "SelectArrow", Ke = k.forwardRef((e, t) => {
	let { __scopeSelect: n, ...r } = e, i = G(n), a = K(Ge, n), o = Z(Ge, n);
	return a.open && o.position === "popper" ? /* @__PURE__ */ j(C, {
		...i,
		...r,
		ref: t
	}) : null;
});
Ke.displayName = Ge;
var qe = "SelectBubbleInput", Je = k.forwardRef(({ __scopeSelect: e, value: t, ...n }, r) => {
	let a = k.useRef(null), o = i(r, a), s = E(t);
	return k.useEffect(() => {
		let e = a.current;
		if (!e) return;
		let n = window.HTMLSelectElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
		if (s !== t && r) {
			let n = new Event("change", { bubbles: !0 });
			r.call(e, t), e.dispatchEvent(n);
		}
	}, [s, t]), /* @__PURE__ */ j(l.select, {
		...n,
		style: {
			...O,
			...n.style
		},
		ref: o,
		defaultValue: t
	});
});
Je.displayName = qe;
function Ye(e) {
	return e === "" || e === void 0;
}
function Xe(e) {
	let t = f(e), n = k.useRef(""), r = k.useRef(0), i = k.useCallback((e) => {
		let i = n.current + e;
		t(i), (function e(t) {
			n.current = t, window.clearTimeout(r.current), t !== "" && (r.current = window.setTimeout(() => e(""), 1e3));
		})(i);
	}, [t]), a = k.useCallback(() => {
		n.current = "", window.clearTimeout(r.current);
	}, []);
	return k.useEffect(() => () => window.clearTimeout(r.current), []), [
		n,
		i,
		a
	];
}
function Ze(e, t, n) {
	let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = Qe(e, Math.max(i, 0));
	r.length === 1 && (a = a.filter((e) => e !== n));
	let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
	return o === n ? void 0 : o;
}
function Qe(e, t) {
	return e.map((n, r) => e[(t + r) % e.length]);
}
var $e = J, et = oe, tt = ce, nt = ue, rt = fe, it = pe, at = Te, ot = ke, st = je, ct = Pe, lt = Fe, ut = Le, dt = ze, ft = Ve, pt = We;
//#endregion
//#region src/react/primitives/select.tsx
function mt({ ...e }) {
	return /* @__PURE__ */ j($e, {
		"data-slot": "select",
		...e
	});
}
function ht({ ...e }) {
	return /* @__PURE__ */ j(ot, {
		"data-slot": "select-group",
		...e
	});
}
function gt({ ...e }) {
	return /* @__PURE__ */ j(tt, {
		"data-slot": "select-value",
		...e
	});
}
function _t({ className: t, size: r = "default", children: i, ...a }) {
	return /* @__PURE__ */ M(et, {
		"data-slot": "select-trigger",
		"data-size": r,
		className: e("flex w-fit items-center justify-between gap-2 rounded-xl text-[13px] whitespace-nowrap transition-all outline-none", "bg-glass border-border-glass border backdrop-blur-[20px]", "text-foreground data-[placeholder]:text-foreground-muted", "[&_svg:not([class*='text-'])]:text-foreground-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "focus:border-primary focus:shadow-glow", "disabled:cursor-not-allowed disabled:opacity-50", "data-[size=default]:h-10 data-[size=default]:pr-3 data-[size=default]:pl-4", "data-[size=sm]:h-8 data-[size=sm]:pr-2 data-[size=sm]:pl-3 data-[size=sm]:text-xs", "*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2", t),
		...a,
		children: [i, /* @__PURE__ */ j(nt, {
			asChild: !0,
			children: /* @__PURE__ */ j(n, { className: "size-4 opacity-50" })
		})]
	});
}
function vt({ className: t, children: n, position: r = "popper", align: i = "start", ...a }) {
	return /* @__PURE__ */ j(rt, { children: /* @__PURE__ */ M(it, {
		"data-slot": "select-content",
		className: e("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-xl border shadow-lg", "bg-glass-solid border-border-glass text-foreground backdrop-blur-[40px]", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", t),
		position: r,
		align: i,
		...a,
		children: [
			/* @__PURE__ */ j(St, {}),
			/* @__PURE__ */ j(at, {
				className: e("p-1", r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
				children: n
			}),
			/* @__PURE__ */ j(Ct, {})
		]
	}) });
}
function yt({ className: t, ...n }) {
	return /* @__PURE__ */ j(st, {
		"data-slot": "select-label",
		className: e("text-foreground-muted px-2 py-1.5 text-xs font-semibold tracking-wider uppercase", t),
		...n
	});
}
function bt({ className: n, children: r, ...i }) {
	return /* @__PURE__ */ M(ct, {
		"data-slot": "select-item",
		className: e("relative flex w-full cursor-default items-center gap-2 rounded-lg py-2 pr-8 pl-3 text-[13px] outline-hidden select-none", "focus:bg-glass-hover focus:text-foreground", "text-foreground-secondary", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "[&_svg:not([class*='text-'])]:text-foreground-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", n),
		...i,
		children: [/* @__PURE__ */ j("span", {
			"data-slot": "select-item-indicator",
			className: "absolute right-2 flex size-3.5 items-center justify-center",
			children: /* @__PURE__ */ j(ut, { children: /* @__PURE__ */ j(t, { className: "text-primary size-4" }) })
		}), /* @__PURE__ */ j(lt, { children: r })]
	});
}
function xt({ className: t, ...n }) {
	return /* @__PURE__ */ j(pt, {
		"data-slot": "select-separator",
		className: e("bg-border-glass pointer-events-none -mx-1 my-1 h-px", t),
		...n
	});
}
function St({ className: t, ...n }) {
	return /* @__PURE__ */ j(dt, {
		"data-slot": "select-scroll-up-button",
		className: e("text-foreground-muted flex cursor-default items-center justify-center py-1", t),
		...n,
		children: /* @__PURE__ */ j(r, { className: "size-4" })
	});
}
function Ct({ className: t, ...r }) {
	return /* @__PURE__ */ j(ft, {
		"data-slot": "select-scroll-down-button",
		className: e("text-foreground-muted flex cursor-default items-center justify-center py-1", t),
		...r,
		children: /* @__PURE__ */ j(n, { className: "size-4" })
	});
}
//#endregion
export { yt as a, xt as c, bt as i, _t as l, vt as n, Ct as o, ht as r, St as s, mt as t, gt as u };

//# sourceMappingURL=select-BX7KT3VP.js.map