"use client";
import { t as e } from "./useControlled-ZBScq72P.js";
import { t } from "./useIsoLayoutEffect-CKOv1bV_.js";
import { d as n, l as r, r as i, s as a, t as o, u as s } from "./useRenderElement-CmuWsiNa.js";
import { t as c } from "./useStableCallback-CqEVb76s.js";
import { n as l } from "./useCompositeListItem-xM6vOR9-.js";
import { t as u } from "./CompositeList-DJUJLDbx.js";
import { t as d } from "./DirectionContext-B4CbbM--.js";
import { d as f, n as p, o as m, p as h, t as g, y as _ } from "./createBaseUIEventDetails-ChcQXp54.js";
import { t as v } from "./useBaseUiId-DOm5ACje.js";
import { n as ee } from "./useAnimationFrame-xwbX87TY.js";
import { d as y, l as b } from "./floating-ui.utils.dom-5U5b4xPf.js";
import { n as te, r as x, t as S } from "./shadowDom-C-4Ejp9R.js";
import { t as C, u as ne } from "./shim-ieZ_MRlN.js";
import { t as re } from "./owner-BrzQrszh.js";
import { a as ie, d as ae, f as w, i as T, o as E, r as oe, s as se, t as ce } from "./composite-BlDfbDkL.js";
import { t as le } from "./addEventListener-B4Gs94GY.js";
import { t as ue } from "./useValueAsRef-CCU3eUYq.js";
import { cn as de } from "./lib/utils.js";
import { t as fe } from "./visuallyHidden-CEAV1xeA.js";
import { t as pe } from "./useValueChanged-j5e75XB6.js";
import { i as me, n as he, r as ge, t as D } from "./LabelableContext-Q1Z-xUI9.js";
import { t as O } from "./FormContext-4NSsO4w6.js";
import { t as _e } from "./useLabelableId-Dgoo7-Ly.js";
import { n as ve, t as k } from "./valueToPercent-9aZaNeTG.js";
import { n as A, t as j } from "./clamp-DQAQAGkj.js";
import { n as ye, t as be } from "./resolveAriaLabelledBy-DR9UHvi-.js";
import * as M from "react";
import { jsx as N, jsxs as xe } from "react/jsx-runtime";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/internals/areArraysEqual.js
function P(e, t, n = (e, t) => e === t) {
	return e.length === t.length && e.every((e, r) => n(e, t[r]));
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/asc.js
function F(e, t) {
	return e - t;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/replaceArrayItemAtIndex.js
function I(e, t, n) {
	let r = e.slice();
	return r[t] = n, r.sort(F);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/getSliderValue.js
function Se(e, t, n, r, i, a) {
	let o = e;
	return o = j(o, n, r), i && (o = I(a, t, j(o, a[t - 1] || -Infinity, a[t + 1] || Infinity))), o;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/validateMinimumDistance.js
function Ce(e, t, n) {
	if (!Array.isArray(e)) return !0;
	let r = e.reduce((e, t, n, r) => (n === r.length - 1 || e.push(Math.abs(t - r[n + 1])), e), []);
	return Math.min(...r) >= t * n;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/root/stateAttributesMapping.js
var we = {
	activeThumbIndex: () => null,
	max: () => null,
	min: () => null,
	minStepsBetweenValues: () => null,
	step: () => null,
	values: () => null,
	...me
}, L = /*#__PURE__*/ M.createContext(void 0);
process.env.NODE_ENV !== "production" && (L.displayName = "SliderRootContext");
function Te() {
	let e = M.useContext(L);
	if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? s(62) : "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
	return e;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/root/SliderRoot.js
function R(e) {
	return "key" in e ? h : f;
}
function Ee(e, t) {
	return typeof e == "number" && typeof t == "number" ? e === t : Array.isArray(e) && Array.isArray(t) ? P(e, t) : !1;
}
var z = /*#__PURE__*/ M.forwardRef(function(r, i) {
	let { "aria-labelledby": a, className: s, defaultValue: l, disabled: d = !1, id: f, format: m, largeStep: h = 10, locale: _, render: ee, max: y = 100, min: b = 0, minStepsBetweenValues: x = 0, form: C, name: ne, onValueChange: ie, onValueCommitted: ae, orientation: w = "horizontal", step: T = 1, thumbCollisionBehavior: E = "push", thumbAlignment: oe = "center", value: se, style: ce, ...le } = r, de = v(f), fe = be(de), me = c(ie), _e = c(ae), { clearErrors: ve } = O(), { state: k, disabled: A, name: xe, setTouched: I, setDirty: Te, validityData: z, shouldValidateOnChange: De, validation: B } = ge(), { labelId: Oe } = D(), [V, ke] = M.useState(), Ae = a ?? ye(Oe, V), H = A || d, U = xe ?? ne, [W, je] = e({
		controlled: se,
		default: l ?? b,
		name: "Slider"
	}), Me = M.useRef(null), G = M.useRef(null), K = M.useRef([]), Ne = M.useRef(null), Pe = M.useRef(null), Fe = M.useRef(-1), Ie = M.useRef(null), Le = M.useRef(null), q = M.useRef("none"), Re = ue(m), [J, Y] = M.useState(-1), [X, ze] = M.useState(-1), [Be, Ve] = M.useState(!1), [Z, He] = M.useState(() => /* @__PURE__ */ new Map()), [Ue, We] = M.useState([void 0, void 0]), Ge = c((e) => {
		Y(e), e !== -1 && ze(e);
	});
	he(G, de, W), pe(W, () => {
		ve(U), De() ? B.commit(W) : B.commit(W, !0);
		let e = z.initialValue, t;
		t = Array.isArray(W) && Array.isArray(e) ? !P(W, e) : W !== e, Te(t);
	});
	let Ke = c((e) => {
		e && (G.current = e);
	}), qe = Array.isArray(W), Je = M.useMemo(() => qe ? W.slice().sort(F) : [j(W, b, y)], [
		y,
		b,
		qe,
		W
	]), Q = c((e, t) => {
		if (Number.isNaN(e) || Ee(e, W)) return;
		let n = t ?? g("none", void 0, void 0, { activeThumbIndex: -1 });
		q.current = n.reason;
		let r = n.event, i = new (r.constructor ?? Event)(r.type, r);
		Object.defineProperty(i, "target", {
			writable: !0,
			value: {
				value: e,
				name: U
			}
		}), n.event = i, Le.current = e, me(e, n), !n.isCanceled && je(e);
	}), Ye = c((e, t, n) => {
		let r = Se(e, t, b, y, qe, Je);
		if (Ce(r, T, x)) {
			let e = R(n);
			Q(r, g(e, n.nativeEvent, void 0, { activeThumbIndex: t })), I(!0), _e(Le.current ?? r, p(e, n.nativeEvent));
		}
	});
	process.env.NODE_ENV !== "production" && b >= y && n("Slider `max` must be greater than `min`."), t(() => {
		let e = S(re(Me.current));
		H && te(Me.current, e) && e.blur();
	}, [H]), H && J !== -1 && Ge(-1);
	let $ = M.useMemo(() => ({
		...k,
		activeThumbIndex: J,
		disabled: H,
		dragging: Be,
		orientation: w,
		max: y,
		min: b,
		minStepsBetweenValues: x,
		step: T,
		values: Je
	}), [
		k,
		J,
		H,
		Be,
		y,
		b,
		x,
		w,
		T,
		Je
	]), Xe = M.useMemo(() => ({
		active: J,
		controlRef: G,
		disabled: H,
		dragging: Be,
		validation: B,
		formatOptionsRef: Re,
		handleInputChange: Ye,
		indicatorPosition: Ue,
		inset: oe !== "center",
		labelId: Ae,
		rootLabelId: fe,
		largeStep: h,
		lastUsedThumbIndex: X,
		lastChangedValueRef: Le,
		lastChangeReasonRef: q,
		form: C,
		locale: _,
		max: y,
		min: b,
		minStepsBetweenValues: x,
		name: U,
		onValueCommitted: _e,
		orientation: w,
		pressedInputRef: Ne,
		pressedThumbCenterOffsetRef: Pe,
		pressedThumbIndexRef: Fe,
		pressedValuesRef: Ie,
		registerFieldControlRef: Ke,
		renderBeforeHydration: oe === "edge",
		setActive: Ge,
		setDragging: Ve,
		setIndicatorPosition: We,
		setLabelId: ke,
		setValue: Q,
		state: $,
		step: T,
		thumbCollisionBehavior: E,
		thumbMap: Z,
		thumbRefs: K,
		values: Je
	}), [
		J,
		G,
		Ae,
		fe,
		H,
		Be,
		B,
		Re,
		Ye,
		Ue,
		h,
		X,
		Le,
		q,
		C,
		_,
		y,
		b,
		x,
		U,
		_e,
		w,
		Ne,
		Pe,
		Fe,
		Ie,
		Ke,
		Ge,
		Ve,
		We,
		ke,
		Q,
		$,
		T,
		E,
		oe,
		Z,
		K,
		Je
	]), Ze = o("div", r, {
		state: $,
		ref: [i, Me],
		props: [
			{
				"aria-labelledby": Ae,
				id: de,
				role: "group"
			},
			B.getValidationProps,
			le
		],
		stateAttributesMapping: we
	});
	return /*#__PURE__*/ N(L.Provider, {
		value: Xe,
		children: /*#__PURE__*/ N(u, {
			elementsRef: K,
			onMapChange: He,
			children: Ze
		})
	});
});
process.env.NODE_ENV !== "production" && (z.displayName = "SliderRoot");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/getMidpoint.js
function De(e) {
	let t = e.getBoundingClientRect();
	return {
		x: (t.left + t.right) / 2,
		y: (t.top + t.bottom) / 2
	};
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/roundValueToStep.js
function B(e) {
	if (e === 0) return 0;
	if (Math.abs(e) < 1) {
		let t = e.toExponential().split("e-"), n = t[0].split(".")[1];
		return (n ? n.length : 0) + parseInt(t[1], 10);
	}
	let t = e.toString().split(".")[1];
	return t ? t.length : 0;
}
function Oe(e, t, n) {
	let r = Math.round((e - n) / t) * t + n;
	return Number(r.toFixed(Math.max(B(t), B(n))));
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/getPushedThumbValues.js
function V({ values: e, index: t, nextValue: n, min: r, max: i, step: a, minStepsBetweenValues: o, initialValues: s }) {
	if (e.length === 0) return [];
	let c = e.slice(), l = a * o, u = c.length - 1, d = s ?? e;
	c[t] = j(n, r + t * l, i - (u - t) * l);
	for (let e = t + 1; e <= u; e += 1) {
		let t = c[e - 1] + l, n = i - (u - e) * l, r = d[e] ?? c[e], a = Math.max(c[e], t);
		r < a && (a = Math.max(r, t)), c[e] = j(a, t, n);
	}
	for (let e = t - 1; e >= 0; --e) {
		let t = c[e + 1] - l, n = r + e * l, i = d[e] ?? c[e], a = Math.min(c[e], t);
		i > a && (a = Math.min(i, t)), c[e] = j(a, n, t);
	}
	for (let e = 0; e <= u; e += 1) c[e] = Number(c[e].toFixed(12));
	return c;
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/utils/resolveThumbCollision.js
function ke({ behavior: e, values: t, currentValues: n, initialValues: r, pressedIndex: i, nextValue: a, min: o, max: s, step: c, minStepsBetweenValues: l }) {
	let u = n ?? t, d = r ?? t;
	if (!(u.length > 1)) return {
		value: a,
		thumbIndex: 0,
		didSwap: !1
	};
	let f = c * l;
	switch (e) {
		case "swap": {
			let e = u[i], t = 1e-7, n = u.slice(), r = n[i - 1], p = n[i + 1], m = j(a, r == null ? o : r + f, p == null ? s : p - f), h = Number(m.toFixed(12));
			n[i] = h;
			let g = a > e, _ = a < e, v = g && p != null && a >= p - t, ee = _ && r != null && a <= r + t;
			if (!v && !ee) return {
				value: n,
				thumbIndex: i,
				didSwap: !1
			};
			let y = v ? i + 1 : i - 1, b = n.map((e, t) => t === i ? h : d[t] ?? u[t]), te = a;
			te = v ? Math.max(a, n[y]) : Math.min(a, n[y]);
			let x = V({
				values: n,
				index: y,
				nextValue: te,
				min: o,
				max: s,
				step: c,
				minStepsBetweenValues: l,
				initialValues: b
			}), S = v ? y - 1 : y + 1;
			if (S >= 0 && S < x.length) {
				let e = x[S - 1], t = x[S + 1], n = e == null ? o : e + f;
				n = Math.max(n, o + S * f);
				let r = t == null ? s : t - f;
				r = Math.min(r, s - (x.length - 1 - S) * f);
				let i = j(h, n, r);
				x[S] = Number(i.toFixed(12));
			}
			return {
				value: x,
				thumbIndex: y,
				didSwap: !0
			};
		}
		case "push": return {
			value: V({
				values: u,
				index: i,
				nextValue: a,
				min: o,
				max: s,
				step: c,
				minStepsBetweenValues: l
			}),
			thumbIndex: i,
			didSwap: !1
		};
		default: {
			let e = u.slice(), t = e[i - 1], n = e[i + 1], r = j(a, t == null ? o : t + f, n == null ? s : n - f);
			return e[i] = Number(r.toFixed(12)), {
				value: e,
				thumbIndex: i,
				didSwap: !1
			};
		}
	}
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/control/SliderControl.js
var Ae = 2;
function H(e, t) {
	if (!e) return {
		start: 0,
		end: 0
	};
	function n(e) {
		let t = e == null ? 0 : parseFloat(e);
		return Number.isNaN(t) ? 0 : t;
	}
	let r = t ? "Top" : "InlineStart", i = t ? "Bottom" : "InlineEnd";
	return {
		start: n(e[`border${r}Width`]) + n(e[`padding${r}`]),
		end: n(e[`border${i}Width`]) + n(e[`padding${i}`])
	};
}
function U(e, t) {
	if (t.current != null && e.changedTouches) {
		let n = e;
		for (let e = 0; e < n.changedTouches.length; e += 1) {
			let r = n.changedTouches[e];
			if (r.identifier === t.current) return {
				x: r.clientX,
				y: r.clientY
			};
		}
		return null;
	}
	return {
		x: e.clientX,
		y: e.clientY
	};
}
var W = /*#__PURE__*/ M.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, ...a } = e, { disabled: s, dragging: l, inset: u, lastChangedValueRef: f, lastChangeReasonRef: h, max: v, min: C, minStepsBetweenValues: ne, onValueCommitted: ie, orientation: ae, pressedInputRef: w, pressedThumbCenterOffsetRef: T, pressedThumbIndexRef: E, pressedValuesRef: oe, registerFieldControlRef: se, renderBeforeHydration: ce, setActive: de, setDragging: fe, setValue: pe, state: me, step: he, thumbCollisionBehavior: ge, thumbRefs: D, values: O } = Te(), _e = d(), ve = O.length > 1, k = ae === "vertical", A = M.useRef(null), ye = M.useRef(null), be = c((e) => {
		e && ye.current == null && (ye.current = b(e).getComputedStyle(e));
	}), N = M.useRef(null), xe = M.useRef(0), P = M.useRef(0), F = ue(O);
	function I(e) {
		E.current !== e && (E.current = e);
		let t = D.current[e];
		if (!t) {
			T.current = null, w.current = null;
			return;
		}
		w.current = t.querySelector("input[type=\"range\"]");
	}
	function Se(e) {
		let t = A.current;
		if (!t) return null;
		let { width: n, height: r, bottom: i, left: a, right: o } = t.getBoundingClientRect(), s = H(ye.current, k), c = P.current, l = (k ? r : n) - s.start - s.end - c * 2, u = T.current ?? 0, d = e.x - u, f = e.y - u, p = j(((k ? i - f - s.end : (_e === "rtl" ? o - d : d - a) - s.start) - c) / l, 0, 1), m = (v - C) * p + C;
		if (m = Oe(m, he, C), m = j(m, C, v), !ve) return {
			value: m,
			thumbIndex: 0,
			didSwap: !1
		};
		let h = E.current;
		if (h < 0) return null;
		let g = ke({
			behavior: ge,
			values: O,
			currentValues: F.current ?? O,
			initialValues: oe.current,
			pressedIndex: h,
			nextValue: m,
			min: C,
			max: v,
			step: he,
			minStepsBetweenValues: ne
		});
		return ge === "swap" && g.didSwap ? I(g.thumbIndex) : E.current = g.thumbIndex, g;
	}
	function L(e) {
		oe.current = ve ? O.slice() : null, F.current = O;
		let t = E.current, n = t;
		if (t > -1 && t < O.length) {
			if (O[t] === v) {
				let e = t;
				for (; e > 0 && O[e - 1] === v;) --e;
				n = e;
			}
		} else {
			let t = k ? "y" : "x", r;
			n = -1;
			for (let i = 0; i < D.current.length; i += 1) {
				let a = D.current[i];
				if (y(a)) {
					let o = De(a), s = Math.abs(e[t] - o[t]);
					(r === void 0 || s <= r) && (n = i, r = s);
				}
			}
		}
		if (n > -1 && n !== t && I(n), u) {
			let e = D.current[n];
			y(e) && (P.current = e.getBoundingClientRect()[k ? "height" : "width"] / 2);
		}
	}
	function R(e) {
		let t = D.current?.[e]?.querySelector("input[type=\"range\"]");
		t && t.focus({
			preventScroll: !0,
			focusVisible: !1
		});
	}
	let Ee = c((e) => {
		let t = U(e, N);
		if (t == null) return;
		if (xe.current += 1, e.type === "pointermove" && e.buttons === 0) {
			z(e);
			return;
		}
		let n = Se(t);
		n != null && Ce(n.value, he, ne) && (!l && xe.current > Ae && fe(!0), pe(n.value, g(m, e, void 0, { activeThumbIndex: n.thumbIndex })), F.current = Array.isArray(n.value) ? n.value : [n.value], n.didSwap && R(n.thumbIndex));
	});
	function z(e) {
		de(-1), fe(!1), w.current = null, T.current = null;
		let t = U(e, N), n = t == null ? null : Se(t);
		if (n != null) {
			let t = h.current;
			ie(f.current ?? n.value, p(t, e));
		}
		"pointerType" in e && A.current?.hasPointerCapture(e.pointerId) && A.current?.releasePointerCapture(e.pointerId), E.current = -1, N.current = null, oe.current = null, V();
	}
	let B = c((e) => {
		if (s) return;
		let t = e.changedTouches[0];
		t != null && (N.current = t.identifier);
		let n = U(e, N);
		if (n != null) {
			L(n);
			let t = Se(n);
			if (t == null) return;
			R(t.thumbIndex), pe(t.value, g(_, e, void 0, { activeThumbIndex: t.thumbIndex })), F.current = Array.isArray(t.value) ? t.value : [t.value], t.didSwap && R(t.thumbIndex);
		}
		xe.current = 0;
		let r = re(A.current);
		r.addEventListener("touchmove", Ee, { passive: !0 }), r.addEventListener("touchend", z, { passive: !0 });
	}), V = c(() => {
		let e = re(A.current);
		e.removeEventListener("pointermove", Ee), e.removeEventListener("pointerup", z), e.removeEventListener("touchmove", Ee), e.removeEventListener("touchend", z), oe.current = null;
	}), W = ee();
	return M.useEffect(() => {
		let e = A.current;
		if (!e) return () => V();
		let t = le(e, "touchstart", B, { passive: !0 });
		return () => {
			t(), W.cancel(), V();
		};
	}, [
		V,
		B,
		A,
		W
	]), M.useEffect(() => {
		s && V();
	}, [s, V]), o("div", e, {
		state: me,
		ref: [
			t,
			se,
			A,
			be
		],
		props: [{
			"data-base-ui-slider-control": ce ? "" : void 0,
			onPointerDown(e) {
				let t = A.current, n = x(e.nativeEvent);
				if (!t || s || e.defaultPrevented || !y(n) || e.button !== 0) return;
				let r = U(e, N);
				if (r != null) {
					L(r);
					let n = Se(r);
					if (n == null) return;
					te(D.current[n.thumbIndex], S(re(t))) ? e.preventDefault() : W.request(() => {
						R(n.thumbIndex);
					}), fe(!0), T.current ?? (pe(n.value, g(_, e.nativeEvent, void 0, { activeThumbIndex: n.thumbIndex })), F.current = Array.isArray(n.value) ? n.value : [n.value], n.didSwap && R(n.thumbIndex));
				}
				e.nativeEvent.pointerId && t.setPointerCapture(e.nativeEvent.pointerId), xe.current = 0;
				let i = re(A.current);
				i.addEventListener("pointermove", Ee, { passive: !0 }), i.addEventListener("pointerup", z, { once: !0 });
			}
		}, a],
		stateAttributesMapping: we
	});
});
process.env.NODE_ENV !== "production" && (W.displayName = "SliderControl");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/track/SliderTrack.js
var je = /*#__PURE__*/ M.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, ...a } = e, { state: s } = Te();
	return o("div", e, {
		state: s,
		ref: t,
		props: [{ style: { position: "relative" } }, a],
		stateAttributesMapping: we
	});
});
process.env.NODE_ENV !== "production" && (je.displayName = "SliderTrack");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/utils/useIsHydrating.js
var Me = C();
function G() {
	return a;
}
function K() {
	return !1;
}
function Ne() {
	return !0;
}
function Pe() {
	return (0, Me.useSyncExternalStore)(G, K, Ne);
}
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/thumb/SliderThumbDataAttributes.js
var Fe = /*#__PURE__*/ function(e) {
	return e.index = "data-index", e.dragging = "data-dragging", e.orientation = "data-orientation", e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.focused = "data-focused", e;
}({}), Ie = new Set([
	...E,
	w,
	ae
]);
function Le(e, t, n, r) {
	if (!(t < 0)) return e.length === 2 ? t === 0 ? `${ve(e[t], r, n)} start range` : `${ve(e[t], r, n)} end range` : n ? ve(e[t], r, n) : void 0;
}
function q(e, t, n, r, i) {
	let a = n === 1 ? e + t : e - t;
	return j(Number(a.toFixed(Math.max(B(e), B(t), B(r)))), r, i);
}
var Re = /*#__PURE__*/ M.forwardRef(function(e, n) {
	let { render: a, children: s, className: u, "aria-describedby": f, "aria-label": p, "aria-labelledby": m, disabled: h = !1, getAriaLabel: g, getAriaValueText: _, id: ee, index: y, inputRef: te, onBlur: x, onFocus: S, onKeyDown: C, tabIndex: re, style: le, ...ue } = e, { nonce: de } = A(), pe = v(ee), { active: me, lastUsedThumbIndex: he, controlRef: D, disabled: O, validation: j, formatOptionsRef: ye, handleInputChange: be, inset: P, labelId: F, largeStep: I, locale: Ce, max: L, min: R, minStepsBetweenValues: Ee, form: z, name: B, orientation: V, pressedInputRef: ke, pressedThumbCenterOffsetRef: Ae, pressedThumbIndexRef: H, renderBeforeHydration: U, setActive: W, setIndicatorPosition: je, state: Me, step: G, values: K } = Te(), Ne = d(), Re = h || O, J = K.length > 1, Y = V === "vertical", X = Ne === "rtl", { setTouched: ze, setFocused: Be, validationMode: Ve } = ge(), Z = M.useRef(null), He = M.useRef(null), Ue = M.useRef(!1), We = v(), Ge = _e(), Ke = J ? We : Ge, { ref: qe, index: Je } = l({ metadata: M.useMemo(() => ({ inputId: Ke }), [Ke]) }), Q = J ? y ?? Je : 0, Ye = Q === K.length - 1, $ = K[Q], Xe = k($, R, L), [Ze, Qe] = M.useState(), $e = Pe(), et = he >= 0 && he < K.length ? he : -1, tt = c(() => {
		let e = D.current, t = Z.current;
		if (!e || !t) return;
		let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = Y ? "height" : "width", a = r[i] - n[i], o = (n[i] / 2 + a * Xe / 100) / r[i] * 100, s = Number.isFinite(o) ? o : void 0;
		Qe(s), Q === 0 ? je((e) => [s, e[1]]) : Ye && je((e) => [e[0], s]);
	});
	t(() => {
		P && queueMicrotask(tt);
	}, [tt, P]), t(() => {
		P && tt();
	}, [
		tt,
		P,
		Xe
	]), t(() => {
		if (!P) return;
		let e = D.current, t = Z.current;
		if (!e || !t) return;
		let n = b(e).ResizeObserver;
		if (typeof n != "function") return;
		let r = new n(tt);
		return r.observe(e), r.observe(t), () => {
			r.disconnect();
		};
	}, [
		D,
		tt,
		P
	]);
	let nt = Y ? "bottom" : "insetInlineStart", rt = Y ? "left" : "top", it;
	J ? me === Q ? it = 2 : et === Q && (it = 1) : me === Q && (it = 1);
	let at;
	at = P ? {
		"--position": `${Ze ?? 0}%`,
		visibility: U && $e || Ze === void 0 ? "hidden" : void 0,
		position: "absolute",
		[nt]: "var(--position)",
		[rt]: "50%",
		translate: `${(Y || !X ? -1 : 1) * 50}% ${(Y ? 1 : -1) * 50}%`,
		zIndex: it
	} : Number.isFinite(Xe) ? {
		position: "absolute",
		[nt]: `${Xe}%`,
		[rt]: "50%",
		translate: `${(Y || !X ? -1 : 1) * 50}% ${(Y ? 1 : -1) * 50}%`,
		zIndex: it
	} : fe;
	let ot;
	V === "vertical" && (ot = X ? "vertical-rl" : "vertical-lr");
	let st = typeof g == "function" ? g(Q) : p, ct = i({
		"aria-label": st,
		"aria-labelledby": m ?? (st == null ? F : void 0),
		"aria-describedby": f,
		"aria-orientation": V,
		"aria-valuenow": $,
		"aria-valuetext": typeof _ == "function" ? _(ve($, Ce, ye.current ?? void 0), $, Q) : Le(K, Q, ye.current ?? void 0, Ce),
		disabled: Re,
		form: z,
		id: Ke,
		max: L,
		min: R,
		name: B,
		onChange(e) {
			be(e.currentTarget.valueAsNumber, Q, e);
		},
		onFocus(e) {
			let t = Ue.current;
			Ue.current = !1, W(Q), Be(!0), t && e.stopPropagation();
		},
		onBlur(e) {
			if (Ue.current) {
				e.stopPropagation();
				return;
			}
			Z.current && (W(-1), ze(!0), Be(!1), Ve === "onBlur" && j.commit(Se($, Q, R, L, J, K)));
		},
		onKeyDown(e) {
			if (!Ie.has(e.key)) return;
			E.has(e.key) && e.stopPropagation();
			let t = null, n = Oe($, G, R);
			switch (e.key) {
				case ie:
					t = q(n, e.shiftKey ? I : G, 1, R, L);
					break;
				case T:
					t = q(n, e.shiftKey ? I : G, X ? -1 : 1, R, L);
					break;
				case ce:
					t = q(n, e.shiftKey ? I : G, -1, R, L);
					break;
				case oe:
					t = q(n, e.shiftKey ? I : G, X ? 1 : -1, R, L);
					break;
				case w:
					t = q(n, I, 1, R, L);
					break;
				case ae:
					t = q(n, I, -1, R, L);
					break;
				case "End":
					t = L, J && (t = Number.isFinite(K[Q + 1]) ? K[Q + 1] - G * Ee : L);
					break;
				case se:
					t = R, J && (t = Number.isFinite(K[Q - 1]) ? K[Q - 1] + G * Ee : R);
					break;
				default: break;
			}
			if (t !== null) {
				let n = e.currentTarget;
				ne(n) || (Ue.current = !0, n.blur(), n.focus({
					preventScroll: !0,
					focusVisible: !0
				})), be(t, Q, e), e.preventDefault();
			}
		},
		step: G,
		style: {
			...fe,
			width: "100%",
			height: "100%",
			writingMode: ot
		},
		tabIndex: re ?? void 0,
		type: "range",
		value: $ ?? ""
	}, j.getInputValidationProps), lt = r(He, j.inputRef, te);
	return o("div", e, {
		state: Me,
		ref: [
			n,
			qe,
			Z
		],
		props: [{
			[Fe.index]: Q,
			children: /*#__PURE__*/ xe(M.Fragment, { children: [
				s,
				/*#__PURE__*/ N("input", {
					ref: lt,
					...ct,
					suppressHydrationWarning: !0
				}),
				P && $e && U && Ye && /*#__PURE__*/ N("script", {
					nonce: de,
					dangerouslySetInnerHTML: { __html: "!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest(\"[data-base-ui-slider-control]\");if(!e)return;const r=e.querySelector(\"[data-base-ui-slider-indicator]\"),i=e.getBoundingClientRect(),n=\"vertical\"===e.getAttribute(\"data-orientation\")?\"height\":\"width\",o=e.querySelectorAll('input[type=\"range\"]'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute(\"value\")??\"\");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute(\"max\")??\"100\"),g=parseFloat(e.getAttribute(\"min\")??\"0\"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty(\"--position\",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty(\"visibility\"),r&&(0===t?(a=v,r.style.setProperty(\"--start-position\",`${v}%`),l||r.style.removeProperty(\"visibility\")):t===s&&(u=v-(a??0),r.style.setProperty(\"--end-position\",`${v}%`),r.style.setProperty(\"--relative-size\",`${u}%`),r.style.removeProperty(\"visibility\"))))}}();" },
					suppressHydrationWarning: !0
				})
			] }),
			id: pe,
			onBlur: x,
			onFocus: S,
			onPointerDown(e) {
				if (H.current = Q, Z.current != null) {
					let t = V === "horizontal" ? "x" : "y", n = De(Z.current);
					Ae.current = (V === "horizontal" ? e.clientX : e.clientY) - n[t];
				}
				He.current != null && ke.current !== He.current && (ke.current = He.current);
			},
			style: at,
			suppressHydrationWarning: U || void 0
		}, ue],
		stateAttributesMapping: we
	});
});
process.env.NODE_ENV !== "production" && (Re.displayName = "SliderThumb");
//#endregion
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/slider/indicator/SliderIndicator.js
function J(e, t, n, r, i, a) {
	let o = n === void 0 || t && r === void 0 ? "hidden" : void 0, s = e ? "bottom" : "insetInlineStart", c = e ? "height" : "width", l = {
		visibility: i && a ? "hidden" : o,
		position: e ? "absolute" : "relative",
		[e ? "width" : "height"]: "inherit"
	};
	return l["--start-position"] = `${n ?? 0}%`, t ? (l["--relative-size"] = `${(r ?? 0) - (n ?? 0)}%`, l[s] = "var(--start-position)", l[c] = "var(--relative-size)", l) : (l[s] = 0, l[c] = "var(--start-position)", l);
}
function Y(e, t, n, r) {
	let i = e ? "bottom" : "insetInlineStart", a = e ? "height" : "width", o = {
		position: e ? "absolute" : "relative",
		[e ? "width" : "height"]: "inherit"
	};
	if (!t) return o[i] = 0, o[a] = `${n}%`, o;
	let s = r - n;
	return o[i] = `${n}%`, o[a] = `${s}%`, o;
}
var X = /*#__PURE__*/ M.forwardRef(function(e, t) {
	let { render: n, className: r, style: i, ...a } = e, { indicatorPosition: s, inset: c, max: l, min: u, orientation: d, renderBeforeHydration: f, state: p, values: m } = Te(), h = Pe(), g = d === "vertical", _ = m.length > 1, v = c ? J(g, _, s[0], s[1], f, h) : Y(g, _, k(m[0], u, l), k(m[m.length - 1], u, l));
	return o("div", e, {
		state: p,
		ref: t,
		props: [{
			"data-base-ui-slider-indicator": f ? "" : void 0,
			style: v,
			suppressHydrationWarning: f || void 0
		}, a],
		stateAttributesMapping: we
	});
});
process.env.NODE_ENV !== "production" && (X.displayName = "SliderIndicator");
//#endregion
//#region lib/components/ui/atoms/slider.tsx
function ze({ className: e, defaultValue: t, value: n, min: r = 0, max: i = 100, ...a }) {
	let o;
	return o = Array.isArray(n) ? n : Array.isArray(t) ? t : [r, i], /* @__PURE__ */ N(z, {
		className: de("w-full data-[orientation=vertical]:h-full", e),
		"data-slot": "slider",
		defaultValue: t,
		max: i,
		min: r,
		thumbAlignment: "edge",
		value: n,
		...a,
		children: /* @__PURE__ */ xe(W, {
			className: "relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-disabled:opacity-50",
			children: [/* @__PURE__ */ N(je, {
				className: "relative h-1.5 w-full grow select-none overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
				"data-slot": "slider-track",
				children: /* @__PURE__ */ N(X, {
					className: "h-full select-none bg-primary data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-full",
					"data-slot": "slider-range"
				})
			}), Array.from({ length: o.length }, (e, t) => /* @__PURE__ */ N(Re, {
				className: "relative block size-3 shrink-0 select-none rounded-full border border-primary bg-primary ring-ring/50 transition-[color,box-shadow] after:absolute after:-inset-2 hover:ring-3 focus-visible:outline-hidden focus-visible:ring-3 active:ring-3 disabled:pointer-events-none disabled:opacity-50",
				"data-slot": "slider-thumb"
			}, t))]
		})
	});
}
//#endregion
export { ze as t };
