"use client";
import { cn as e } from "./lib/utils.js";
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useImperativeHandle as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
import { jsx as f } from "react/jsx-runtime";
//#region ../../node_modules/.bun/react-resizable-panels@4.11.2+7492c01c6988791b/node_modules/react-resizable-panels/dist/react-resizable-panels.js
function p(e, t) {
	let n = getComputedStyle(e);
	return t * parseFloat(n.fontSize);
}
function m(e, t) {
	let n = getComputedStyle(e.ownerDocument.documentElement);
	return t * parseFloat(n.fontSize);
}
function h(e) {
	return e / 100 * window.innerHeight;
}
function g(e) {
	return e / 100 * window.innerWidth;
}
function _(e) {
	switch (typeof e) {
		case "number": return [e, "px"];
		case "string": {
			let t = parseFloat(e);
			return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
		}
	}
}
function v({ groupSize: e, panelElement: t, styleProp: n }) {
	let r, [i, a] = _(n);
	switch (a) {
		case "%":
			r = i / 100 * e;
			break;
		case "px":
			r = i;
			break;
		case "rem":
			r = m(t, i);
			break;
		case "em":
			r = p(t, i);
			break;
		case "vh":
			r = h(i);
			break;
		case "vw":
			r = g(i);
			break;
	}
	return r;
}
function y(e) {
	return parseFloat(e.toFixed(3));
}
function b({ group: e }) {
	let { orientation: t, panels: n } = e;
	return n.reduce((e, n) => (e += t === "horizontal" ? n.element.offsetWidth : n.element.offsetHeight, e), 0);
}
function x(e) {
	let { panels: t } = e, n = b({ group: e });
	return n === 0 ? t.map((e) => ({
		groupResizeBehavior: e.panelConstraints.groupResizeBehavior,
		collapsedSize: 0,
		collapsible: e.panelConstraints.collapsible === !0,
		defaultSize: void 0,
		disabled: e.panelConstraints.disabled,
		minSize: 0,
		maxSize: 100,
		panelId: e.id
	})) : t.map((e) => {
		let { element: t, panelConstraints: r } = e, i = 0;
		r.collapsedSize !== void 0 && (i = y(v({
			groupSize: n,
			panelElement: t,
			styleProp: r.collapsedSize
		}) / n * 100));
		let a;
		r.defaultSize !== void 0 && (a = y(v({
			groupSize: n,
			panelElement: t,
			styleProp: r.defaultSize
		}) / n * 100));
		let o = 0;
		r.minSize !== void 0 && (o = y(v({
			groupSize: n,
			panelElement: t,
			styleProp: r.minSize
		}) / n * 100));
		let s = 100;
		return r.maxSize !== void 0 && (s = y(v({
			groupSize: n,
			panelElement: t,
			styleProp: r.maxSize
		}) / n * 100)), {
			groupResizeBehavior: r.groupResizeBehavior,
			collapsedSize: i,
			collapsible: r.collapsible === !0,
			defaultSize: a,
			disabled: r.disabled,
			minSize: o,
			maxSize: s,
			panelId: e.id
		};
	});
}
function S(e, t = "Assertion error") {
	if (!e) throw Error(t);
}
function C(e, t) {
	return Array.from(t).sort(e === "horizontal" ? w : T);
}
function w(e, t) {
	let n = e.element.offsetLeft - t.element.offsetLeft;
	return n === 0 ? e.element.offsetWidth - t.element.offsetWidth : n;
}
function T(e, t) {
	let n = e.element.offsetTop - t.element.offsetTop;
	return n === 0 ? e.element.offsetHeight - t.element.offsetHeight : n;
}
function E(e) {
	return typeof e == "object" && !!e && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
}
function D(e, t) {
	return {
		x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(Math.abs(e.x - t.left), Math.abs(e.x - t.right)),
		y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(Math.abs(e.y - t.top), Math.abs(e.y - t.bottom))
	};
}
function O({ orientation: e, rects: t, targetRect: n }) {
	let r = {
		x: n.x + n.width / 2,
		y: n.y + n.height / 2
	}, i, a = Number.MAX_VALUE;
	for (let n of t) {
		let { x: t, y: o } = D(r, n), s = e === "horizontal" ? t : o;
		s < a && (a = s, i = n);
	}
	return S(i, "No rect found"), i;
}
var k;
function A() {
	return k === void 0 && (k = typeof matchMedia == "function" ? !!matchMedia("(pointer:coarse)").matches : !1), k;
}
function j(e) {
	let { element: t, orientation: n, panels: r, separators: i } = e, a = C(n, Array.from(t.children).filter(E).map((e) => ({ element: e }))).map(({ element: e }) => e), o = [], s = !1, c = !1, l = -1, u = -1, d = 0, f, p = [];
	{
		let e = -1;
		for (let t of a) t.hasAttribute("data-panel") && (e++, t.hasAttribute("data-disabled") || (d++, l === -1 && (l = e), u = e));
	}
	if (d > 1) {
		let t = -1;
		for (let d of a) if (d.hasAttribute("data-panel")) {
			t++;
			let i = r.find((e) => e.element === d);
			if (i) {
				if (f) {
					let r = f.element.getBoundingClientRect(), a = d.getBoundingClientRect(), m;
					if (c) {
						let e = n === "horizontal" ? new DOMRect(r.right, r.top, 0, r.height) : new DOMRect(r.left, r.bottom, r.width, 0), t = n === "horizontal" ? new DOMRect(a.left, a.top, 0, a.height) : new DOMRect(a.left, a.top, a.width, 0);
						switch (p.length) {
							case 0:
								m = [e, t];
								break;
							case 1: {
								let i = p[0];
								m = [i, O({
									orientation: n,
									rects: [r, a],
									targetRect: i.element.getBoundingClientRect()
								}) === r ? t : e];
								break;
							}
							default:
								m = p;
								break;
						}
					} else m = p.length ? p : [n === "horizontal" ? new DOMRect(r.right, a.top, a.left - r.right, a.height) : new DOMRect(a.left, r.bottom, a.width, a.top - r.bottom)];
					for (let n of m) {
						let r = "width" in n ? n : n.element.getBoundingClientRect(), a = A() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
						if (r.width < a) {
							let e = a - r.width;
							r = new DOMRect(r.x - e / 2, r.y, r.width + e, r.height);
						}
						if (r.height < a) {
							let e = a - r.height;
							r = new DOMRect(r.x, r.y - e / 2, r.width, r.height + e);
						}
						!s && !(t <= l || t > u) && o.push({
							group: e,
							groupSize: b({ group: e }),
							panels: [f, i],
							separator: "width" in n ? void 0 : n,
							rect: r
						}), s = !1;
					}
				}
				c = !1, f = i, p = [];
			}
		} else if (d.hasAttribute("data-separator")) {
			d.ariaDisabled !== null && (s = !0);
			let e = i.find((e) => e.element === d);
			e ? p.push(e) : (f = void 0, p = []);
		} else c = !0;
	}
	return o;
}
var M = class {
	#e = {};
	addListener(e, t) {
		let n = this.#e[e];
		return n === void 0 ? this.#e[e] = [t] : n.includes(t) || n.push(t), () => {
			this.removeListener(e, t);
		};
	}
	emit(e, t) {
		let n = this.#e[e];
		if (n !== void 0) if (n.length === 1) n[0].call(null, t);
		else {
			let e = !1, r = null, i = Array.from(n);
			for (let n = 0; n < i.length; n++) {
				let a = i[n];
				try {
					a.call(null, t);
				} catch (t) {
					r === null && (e = !0, r = t);
				}
			}
			if (e) throw r;
		}
	}
	removeAllListeners() {
		this.#e = {};
	}
	removeListener(e, t) {
		let n = this.#e[e];
		if (n !== void 0) {
			let e = n.indexOf(t);
			e >= 0 && n.splice(e, 1);
		}
	}
}, N = /* @__PURE__ */ new Map(), ee = new M();
function te(e) {
	N = new Map(N), N.delete(e);
}
function ne(e, t) {
	for (let [t] of N) if (t.id === e) return t;
}
function P(e, t) {
	for (let [t, n] of N) if (t.id === e) return n;
	if (t) throw Error(`Could not find data for Group with id ${e}`);
}
function F() {
	return N;
}
function re(e, t) {
	return ee.addListener("groupChange", (n) => {
		n.group.id === e && t(n);
	});
}
function I(e, t) {
	let n = N.get(e);
	N = new Map(N), N.set(e, t), ee.emit("groupChange", {
		group: e,
		prev: n,
		next: t
	});
}
function ie(e, t, n) {
	let r, i = {
		x: Infinity,
		y: Infinity
	};
	for (let a of t) {
		let t = D(n, a.rect);
		switch (e) {
			case "horizontal":
				t.x <= i.x && (r = a, i = t);
				break;
			case "vertical":
				t.y <= i.y && (r = a, i = t);
				break;
		}
	}
	return r ? {
		distance: i,
		hitRegion: r
	} : void 0;
}
function ae(e) {
	return typeof e == "object" && !!e && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
}
function oe(e, t) {
	if (e === t) throw Error("Cannot compare node with itself");
	let n = {
		a: fe(e),
		b: fe(t)
	}, r;
	for (; n.a.at(-1) === n.b.at(-1);) r = n.a.pop(), n.b.pop();
	S(r, "Stacking order can only be calculated for elements with a common ancestor");
	let i = {
		a: de(ue(n.a)),
		b: de(ue(n.b))
	};
	if (i.a === i.b) {
		let e = r.childNodes, t = {
			a: n.a.at(-1),
			b: n.b.at(-1)
		}, i = e.length;
		for (; i--;) {
			let n = e[i];
			if (n === t.a) return 1;
			if (n === t.b) return -1;
		}
	}
	return Math.sign(i.a - i.b);
}
var se = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
function ce(e) {
	let t = getComputedStyle(pe(e) ?? e).display;
	return t === "flex" || t === "inline-flex";
}
function le(e) {
	let t = getComputedStyle(e);
	return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ce(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || se.test(t.willChange) || t.webkitOverflowScrolling === "touch");
}
function ue(e) {
	let t = e.length;
	for (; t--;) {
		let n = e[t];
		if (S(n, "Missing node"), le(n)) return n;
	}
	return null;
}
function de(e) {
	return e && Number(getComputedStyle(e).zIndex) || 0;
}
function fe(e) {
	let t = [];
	for (; e;) t.push(e), e = pe(e);
	return t;
}
function pe(e) {
	let { parentNode: t } = e;
	return ae(t) ? t.host : t;
}
function me(e, t) {
	return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
}
function he({ groupElement: e, hitRegion: t, pointerEventTarget: n }) {
	if (!E(n) || n.contains(e) || e.contains(n)) return !0;
	if (oe(n, e) > 0) {
		let r = n;
		for (; r;) {
			if (r.contains(e)) return !0;
			if (me(r.getBoundingClientRect(), t)) return !1;
			r = r.parentElement;
		}
	}
	return !0;
}
function ge(e, t) {
	let n = [];
	return t.forEach((t, r) => {
		if (r.disabled) return;
		let i = j(r), a = ie(r.orientation, i, {
			x: e.clientX,
			y: e.clientY
		});
		a && a.distance.x <= 0 && a.distance.y <= 0 && he({
			groupElement: r.element,
			hitRegion: a.hitRegion.rect,
			pointerEventTarget: e.target
		}) && n.push(a.hitRegion);
	}), n;
}
function _e(e, t) {
	if (e.length !== t.length) return !1;
	for (let n = 0; n < e.length; n++) if (e[n] != t[n]) return !1;
	return !0;
}
function L(e, t, n = 0) {
	return Math.abs(y(e) - y(t)) <= n;
}
function R(e, t) {
	return L(e, t) ? 0 : e > t ? 1 : -1;
}
function z({ overrideDisabledPanels: e, panelConstraints: t, prevSize: n, size: r }) {
	let { collapsedSize: i = 0, collapsible: a, disabled: o, maxSize: s = 100, minSize: c = 0 } = t;
	if (o && !e) return n;
	if (R(r, c) < 0) if (a) {
		let e = (i + c) / 2;
		r = R(r, e) < 0 ? i : c;
	} else r = c;
	return r = Math.min(s, r), r = y(r), r;
}
function B({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: r, prevLayout: i, trigger: a }) {
	if (L(e, 0)) return t;
	let o = a === "imperative-api", s = Object.values(t), c = Object.values(i), l = [...s], [u, d] = r;
	S(u != null, "Invalid first pivot index"), S(d != null, "Invalid second pivot index");
	let f = 0;
	switch (a) {
		case "keyboard":
			{
				let t = e < 0 ? d : u, r = n[t];
				S(r, `Panel constraints not found for index ${t}`);
				let { collapsedSize: i = 0, collapsible: a, minSize: o = 0 } = r;
				if (a) {
					let n = s[t];
					if (S(n != null, `Previous layout not found for panel index ${t}`), L(n, i)) {
						let t = o - n;
						R(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
					}
				}
			}
			{
				let t = e < 0 ? u : d, r = n[t];
				S(r, `No panel constraints found for index ${t}`);
				let { collapsedSize: i = 0, collapsible: a, minSize: o = 0 } = r;
				if (a) {
					let n = s[t];
					if (S(n != null, `Previous layout not found for panel index ${t}`), L(n, o)) {
						let t = n - i;
						R(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
					}
				}
			}
			break;
		default: {
			let t = e < 0 ? d : u, r = n[t];
			S(r, `Panel constraints not found for index ${t}`);
			let i = s[t], { collapsible: a, collapsedSize: o, minSize: c } = r;
			if (a && R(i, c) < 0) if (e > 0) {
				let t = c - o, n = t / 2;
				R(i + e, c) < 0 && (e = R(e, n) <= 0 ? 0 : t);
			} else {
				let t = c - o, n = 100 - t / 2;
				R(i - e, c) < 0 && (e = R(100 + e, n) > 0 ? 0 : -t);
			}
			break;
		}
	}
	{
		let t = e < 0 ? 1 : -1, r = e < 0 ? d : u, i = 0;
		for (;;) {
			let e = s[r];
			S(e != null, `Previous layout not found for panel index ${r}`);
			let a = z({
				overrideDisabledPanels: o,
				panelConstraints: n[r],
				prevSize: e,
				size: 100
			}) - e;
			if (i += a, r += t, r < 0 || r >= n.length) break;
		}
		let a = Math.min(Math.abs(e), Math.abs(i));
		e = e < 0 ? 0 - a : a;
	}
	{
		let t = e < 0 ? u : d;
		for (; t >= 0 && t < n.length;) {
			let r = Math.abs(e) - Math.abs(f), i = s[t];
			S(i != null, `Previous layout not found for panel index ${t}`);
			let a = i - r, c = z({
				overrideDisabledPanels: o,
				panelConstraints: n[t],
				prevSize: i,
				size: a
			});
			if (!L(i, c) && (f += i - c, l[t] = c, f.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, { numeric: !0 }) >= 0)) break;
			e < 0 ? t-- : t++;
		}
	}
	if (_e(c, l)) return i;
	{
		let t = e < 0 ? d : u, r = s[t];
		S(r != null, `Previous layout not found for panel index ${t}`);
		let i = r + f, a = z({
			overrideDisabledPanels: o,
			panelConstraints: n[t],
			prevSize: r,
			size: i
		});
		if (l[t] = a, !L(a, i)) {
			let t = i - a, r = e < 0 ? d : u;
			for (; r >= 0 && r < n.length;) {
				let i = l[r];
				S(i != null, `Previous layout not found for panel index ${r}`);
				let a = i + t, s = z({
					overrideDisabledPanels: o,
					panelConstraints: n[r],
					prevSize: i,
					size: a
				});
				if (L(i, s) || (t -= s - i, l[r] = s), L(t, 0)) break;
				e > 0 ? r-- : r++;
			}
		}
	}
	if (!L(Object.values(l).reduce((e, t) => t + e, 0), 100, .1)) return i;
	let p = Object.keys(i);
	return l.reduce((e, t, n) => (e[p[n]] = t, e), {});
}
function V(e, t) {
	if (Object.keys(e).length !== Object.keys(t).length) return !1;
	for (let n in e) if (t[n] === void 0 || R(e[n], t[n]) !== 0) return !1;
	return !0;
}
function H({ layout: e, panelConstraints: t }) {
	let n = Object.values(e), r = [...n], i = r.reduce((e, t) => e + t, 0);
	if (r.length !== t.length) throw Error(`Invalid ${t.length} panel layout: ${r.map((e) => `${e}%`).join(", ")}`);
	if (!L(i, 100) && r.length > 0) for (let e = 0; e < t.length; e++) {
		let t = r[e];
		S(t != null, `No layout data found for index ${e}`), r[e] = 100 / i * t;
	}
	let a = 0;
	for (let e = 0; e < t.length; e++) {
		let i = n[e];
		S(i != null, `No layout data found for index ${e}`);
		let o = r[e];
		S(o != null, `No layout data found for index ${e}`);
		let s = z({
			overrideDisabledPanels: !0,
			panelConstraints: t[e],
			prevSize: i,
			size: o
		});
		o != s && (a += o - s, r[e] = s);
	}
	if (!L(a, 0)) for (let e = 0; e < t.length; e++) {
		let n = r[e];
		S(n != null, `No layout data found for index ${e}`);
		let i = n + a, o = z({
			overrideDisabledPanels: !0,
			panelConstraints: t[e],
			prevSize: n,
			size: i
		});
		if (n !== o && (a -= o - n, r[e] = o, L(a, 0))) break;
	}
	let o = Object.keys(e);
	return r.reduce((e, t, n) => (e[o[n]] = t, e), {});
}
function ve({ groupId: e, panelId: t }) {
	let n = () => {
		let t = F();
		for (let [n, { defaultLayoutDeferred: r, derivedPanelConstraints: i, layout: a, groupSize: o, separatorToPanels: s }] of t) if (n.id === e) return {
			defaultLayoutDeferred: r,
			derivedPanelConstraints: i,
			group: n,
			groupSize: o,
			layout: a,
			separatorToPanels: s
		};
		throw Error(`Group ${e} not found`);
	}, r = () => {
		let e = n().derivedPanelConstraints.find((e) => e.panelId === t);
		if (e !== void 0) return e;
		throw Error(`Panel constraints not found for Panel ${t}`);
	}, i = () => {
		let e = n().group.panels.find((e) => e.id === t);
		if (e !== void 0) return e;
		throw Error(`Layout not found for Panel ${t}`);
	}, a = () => {
		let e = n().layout[t];
		if (e !== void 0) return e;
		throw Error(`Layout not found for Panel ${t}`);
	}, o = ({ nextSize: e, panels: n, prevLayout: r, derivedPanelConstraints: i }) => {
		let o = a(), s = n.findIndex((e) => e.id === t), c = s === 0, l = s === n.length - 1;
		if (l && e < o && (c || n.slice(0, s).every((e, t) => {
			let n = i[t];
			return n?.collapsible && L(n.collapsedSize, r[n.panelId]);
		}))) {
			let e = n.slice(0, s).reduce((e, t) => e + r[t.id], 0);
			return {
				...r,
				[t]: y(100 - e)
			};
		}
		return B({
			delta: l ? o - e : e - o,
			initialLayout: r,
			panelConstraints: i,
			pivotIndices: l ? [s - 1, s] : [s, s + 1],
			prevLayout: r,
			trigger: "imperative-api"
		});
	}, s = (e) => {
		if (e === a()) return;
		let { defaultLayoutDeferred: t, derivedPanelConstraints: r, group: i, groupSize: s, layout: c, separatorToPanels: l } = n(), u = H({
			layout: o({
				nextSize: e,
				panels: i.panels,
				prevLayout: c,
				derivedPanelConstraints: r
			}),
			panelConstraints: r
		});
		V(c, u) || I(i, {
			defaultLayoutDeferred: t,
			derivedPanelConstraints: r,
			groupSize: s,
			layout: u,
			separatorToPanels: l
		});
	};
	return {
		collapse: () => {
			let { collapsible: e, collapsedSize: t } = r(), { mutableValues: n } = i(), o = a();
			e && o !== t && (n.expandToSize = o, s(t));
		},
		expand: () => {
			let { collapsible: e, collapsedSize: t, minSize: n } = r(), { mutableValues: o } = i(), c = a();
			if (e && c === t) {
				let e = o.expandToSize ?? n;
				e === 0 && (e = 1), s(e);
			}
		},
		getSize: () => {
			let { group: e } = n(), t = a(), { element: r } = i();
			return {
				asPercentage: t,
				inPixels: e.orientation === "horizontal" ? r.offsetWidth : r.offsetHeight
			};
		},
		isCollapsed: () => {
			let { collapsible: e, collapsedSize: t } = r(), n = a();
			return e && L(t, n);
		},
		resize: (e) => {
			let { group: t } = n(), { element: r } = i(), a = b({ group: t });
			s(y(v({
				groupSize: a,
				panelElement: r,
				styleProp: e
			}) / a * 100));
		}
	};
}
function ye(e) {
	e.defaultPrevented || ge(e, F()).forEach((t) => {
		if (t.separator && !t.separator.disableDoubleClick) {
			let n = t.panels.find((e) => e.panelConstraints.defaultSize !== void 0);
			if (n) {
				let r = n.panelConstraints.defaultSize, i = ve({
					groupId: t.group.id,
					panelId: n.id
				});
				i && r !== void 0 && (i.resize(r), e.preventDefault());
			}
		}
	});
}
function U(e) {
	let t = F();
	for (let [n] of t) if (n.separators.some((t) => t.element === e)) return n;
	throw Error("Could not find parent Group for separator element");
}
function be({ groupId: e }) {
	let t = () => {
		let t = F();
		for (let [n, r] of t) if (n.id === e) return {
			group: n,
			...r
		};
		throw Error(`Could not find Group with id "${e}"`);
	};
	return {
		getLayout() {
			let { defaultLayoutDeferred: e, layout: n } = t();
			return e ? {} : n;
		},
		setLayout(e) {
			let { defaultLayoutDeferred: n, derivedPanelConstraints: r, group: i, groupSize: a, layout: o, separatorToPanels: s } = t(), c = H({
				layout: e,
				panelConstraints: r
			});
			return n ? o : (V(o, c) || I(i, {
				defaultLayoutDeferred: n,
				derivedPanelConstraints: r,
				groupSize: a,
				layout: c,
				separatorToPanels: s
			}), c);
		}
	};
}
function W(e, t) {
	let n = U(e), r = P(n.id, !0), i = n.separators.find((t) => t.element === e);
	S(i, "Matching separator not found");
	let a = r.separatorToPanels.get(i);
	S(a, "Matching panels not found");
	let o = a.map((e) => n.panels.indexOf(e)), s = be({ groupId: n.id }).getLayout(), c = H({
		layout: B({
			delta: t,
			initialLayout: s,
			panelConstraints: r.derivedPanelConstraints,
			pivotIndices: o,
			prevLayout: s,
			trigger: "keyboard"
		}),
		panelConstraints: r.derivedPanelConstraints
	});
	V(s, c) || I(n, {
		defaultLayoutDeferred: r.defaultLayoutDeferred,
		derivedPanelConstraints: r.derivedPanelConstraints,
		groupSize: r.groupSize,
		layout: c,
		separatorToPanels: r.separatorToPanels
	});
}
function xe(e) {
	if (e.defaultPrevented) return;
	let t = e.currentTarget, n = U(t);
	if (!n.disabled) switch (e.key) {
		case "ArrowDown":
			e.preventDefault(), n.orientation === "vertical" && W(t, 5);
			break;
		case "ArrowLeft":
			e.preventDefault(), n.orientation === "horizontal" && W(t, -5);
			break;
		case "ArrowRight":
			e.preventDefault(), n.orientation === "horizontal" && W(t, 5);
			break;
		case "ArrowUp":
			e.preventDefault(), n.orientation === "vertical" && W(t, -5);
			break;
		case "End":
			e.preventDefault(), W(t, 100);
			break;
		case "Enter": {
			e.preventDefault();
			let n = U(t), { derivedPanelConstraints: r, layout: i, separatorToPanels: a } = P(n.id, !0), o = n.separators.find((e) => e.element === t);
			S(o, "Matching separator not found");
			let s = a.get(o);
			S(s, "Matching panels not found");
			let c = s[0], l = r.find((e) => e.panelId === c.id);
			if (S(l, "Panel metadata not found"), l.collapsible) {
				let e = i[c.id];
				W(t, (l.collapsedSize === e ? n.mutableState.expandedPanelSizes[c.id] ?? l.minSize : l.collapsedSize) - e);
			}
			break;
		}
		case "F6": {
			e.preventDefault();
			let n = U(t).separators.map((e) => e.element), r = Array.from(n).findIndex((t) => t === e.currentTarget);
			S(r !== null, "Index not found"), n[e.shiftKey ? r > 0 ? r - 1 : n.length - 1 : r + 1 < n.length ? r + 1 : 0].focus({ preventScroll: !0 });
			break;
		}
		case "Home":
			e.preventDefault(), W(t, -100);
			break;
	}
}
var G = {
	cursorFlags: 0,
	state: "inactive"
}, Se = new M();
function K() {
	return G;
}
function Ce(e) {
	return Se.addListener("change", e);
}
function we(e) {
	let t = G, n = { ...G };
	n.cursorFlags = e, G = n, Se.emit("change", {
		prev: t,
		next: n
	});
}
function q(e) {
	let t = G;
	G = e, Se.emit("change", {
		prev: t,
		next: e
	});
}
function Te(e) {
	if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0) return;
	let t = F(), n = ge(e, t), r = /* @__PURE__ */ new Map(), i = !1;
	n.forEach((e) => {
		e.separator && (i || (i = !0, e.separator.element.focus({
			focusVisible: !1,
			preventScroll: !0
		})));
		let n = t.get(e.group);
		n && r.set(e.group, n.layout);
	}), q({
		cursorFlags: 0,
		hitRegions: n,
		initialLayoutMap: r,
		pointerDownAtPoint: {
			x: e.clientX,
			y: e.clientY
		},
		state: "active"
	}), n.length && e.preventDefault();
}
var Ee = (e) => e, De = () => {}, Oe = 1, ke = 2, Ae = 4, je = 8, Me = 3, Ne = 12, J;
function Pe() {
	return J === void 0 && (J = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (J = !0)), J;
}
function Fe({ cursorFlags: e, groups: t, state: n }) {
	let r = 0, i = 0;
	switch (n) {
		case "active":
		case "hover": t.forEach((e) => {
			if (!e.mutableState.disableCursor) switch (e.orientation) {
				case "horizontal":
					r++;
					break;
				case "vertical":
					i++;
					break;
			}
		});
	}
	if (!(r === 0 && i === 0)) {
		switch (n) {
			case "active":
				if (e && Pe()) {
					let t = (e & Oe) !== 0, n = (e & ke) !== 0, r = (e & Ae) !== 0, i = (e & je) !== 0;
					if (t) return r ? "se-resize" : i ? "ne-resize" : "e-resize";
					if (n) return r ? "sw-resize" : i ? "nw-resize" : "w-resize";
					if (r) return "s-resize";
					if (i) return "n-resize";
				}
				break;
		}
		return Pe() ? r > 0 && i > 0 ? "move" : r > 0 ? "ew-resize" : "ns-resize" : r > 0 && i > 0 ? "grab" : r > 0 ? "col-resize" : "row-resize";
	}
}
var Ie = /* @__PURE__ */ new WeakMap();
function Le(e) {
	if (e.defaultView === null || e.defaultView === void 0) return;
	let { prevStyle: t, styleSheet: n } = Ie.get(e) ?? {};
	n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [...e.adoptedStyleSheets, n]));
	let r = K();
	switch (r.state) {
		case "active":
		case "hover": {
			let e = Fe({
				cursorFlags: r.cursorFlags,
				groups: r.hitRegions.map((e) => e.group),
				state: r.state
			}), i = `*, *:hover {cursor: ${e} !important; }`;
			if (t === i) return;
			t = i, e ? n.cssRules.length === 0 ? n.insertRule(i) : n.replaceSync(i) : n.cssRules.length === 1 && n.deleteRule(0);
			break;
		}
		case "inactive":
			t = void 0, n.cssRules.length === 1 && n.deleteRule(0);
			break;
	}
	Ie.set(e, {
		prevStyle: t,
		styleSheet: n
	});
}
function Re({ document: e, event: t, hitRegions: n, initialLayoutMap: r, mountedGroups: i, pointerDownAtPoint: a, prevCursorFlags: o }) {
	let s = 0;
	n.forEach((e) => {
		let { group: n, groupSize: o } = e, { orientation: c, panels: l } = n, { disableCursor: u } = n.mutableState, d = 0;
		d = a ? c === "horizontal" ? (t.clientX - a.x) / o * 100 : (t.clientY - a.y) / o * 100 : c === "horizontal" ? t.clientX < 0 ? -100 : 100 : t.clientY < 0 ? -100 : 100;
		let f = r.get(n), p = i.get(n);
		if (!f || !p) return;
		let { defaultLayoutDeferred: m, derivedPanelConstraints: h, groupSize: g, layout: _, separatorToPanels: v } = p;
		if (h && _ && v) {
			let t = B({
				delta: d,
				initialLayout: f,
				panelConstraints: h,
				pivotIndices: e.panels.map((e) => l.indexOf(e)),
				prevLayout: _,
				trigger: "mouse-or-touch"
			});
			if (V(t, _)) {
				if (d !== 0 && !u) switch (c) {
					case "horizontal":
						s |= d < 0 ? Oe : ke;
						break;
					case "vertical":
						s |= d < 0 ? Ae : je;
						break;
				}
			} else I(e.group, {
				defaultLayoutDeferred: m,
				derivedPanelConstraints: h,
				groupSize: g,
				layout: t,
				separatorToPanels: v
			});
		}
	});
	let c = 0;
	t.movementX === 0 ? c |= o & Me : c |= s & Me, t.movementY === 0 ? c |= o & Ne : c |= s & Ne, we(c), Le(e);
}
function ze(e) {
	let t = F(), n = K();
	switch (n.state) {
		case "active": Re({
			document: e.currentTarget,
			event: e,
			hitRegions: n.hitRegions,
			initialLayoutMap: n.initialLayoutMap,
			mountedGroups: t,
			prevCursorFlags: n.cursorFlags
		});
	}
}
function Be(e) {
	if (e.defaultPrevented) return;
	let t = K(), n = F();
	switch (t.state) {
		case "active":
			if (e.buttons === 0) {
				q({
					cursorFlags: 0,
					state: "inactive"
				}), t.hitRegions.forEach((e) => {
					let t = P(e.group.id, !0);
					I(e.group, t);
				});
				return;
			}
			for (let n of t.hitRegions) if (n.separator) {
				let { element: t } = n.separator;
				t.hasPointerCapture?.(e.pointerId) || t.setPointerCapture?.(e.pointerId);
			}
			Re({
				document: e.currentTarget,
				event: e,
				hitRegions: t.hitRegions,
				initialLayoutMap: t.initialLayoutMap,
				mountedGroups: n,
				pointerDownAtPoint: t.pointerDownAtPoint,
				prevCursorFlags: t.cursorFlags
			});
			break;
		default: {
			let r = ge(e, n);
			r.length === 0 ? t.state !== "inactive" && q({
				cursorFlags: 0,
				state: "inactive"
			}) : q({
				cursorFlags: 0,
				hitRegions: r,
				state: "hover"
			}), Le(e.currentTarget);
			break;
		}
	}
}
function Ve(e) {
	if (e.relatedTarget instanceof HTMLIFrameElement) switch (K().state) {
		case "hover": q({
			cursorFlags: 0,
			state: "inactive"
		});
	}
}
function He(e) {
	if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0) return;
	let t = K();
	switch (t.state) {
		case "active": q({
			cursorFlags: 0,
			state: "inactive"
		}), t.hitRegions.length > 0 && (Le(e.currentTarget), t.hitRegions.forEach((e) => {
			let t = P(e.group.id, !0);
			I(e.group, t);
		}), e.preventDefault());
	}
}
function Ue(e) {
	let t = 0, n = 0, r = {};
	for (let i of e) if (i.defaultSize !== void 0) {
		t++;
		let e = y(i.defaultSize);
		n += e, r[i.panelId] = e;
	} else r[i.panelId] = void 0;
	let i = e.length - t;
	if (i !== 0) {
		let t = y((100 - n) / i);
		for (let n of e) n.defaultSize === void 0 && (r[n.panelId] = t);
	}
	return r;
}
function We(e, t, n) {
	if (!n[0]) return;
	let r = e.panels.find((e) => e.element === t);
	if (!r || !r.onResize) return;
	let i = b({ group: e }), a = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o = r.mutableValues.prevSize, s = {
		asPercentage: y(a / i * 100),
		inPixels: a
	};
	r.mutableValues.prevSize = s, r.onResize(s, r.id, o);
}
function Ge(e, t) {
	if (Object.keys(e).length !== Object.keys(t).length) return !1;
	for (let n in e) if (e[n] !== t[n]) return !1;
	return !0;
}
function Ke({ group: e, nextGroupSize: t, prevGroupSize: n, prevLayout: r }) {
	if (n <= 0 || t <= 0 || n === t) return r;
	let i = 0, a = 0, o = !1, s = /* @__PURE__ */ new Map(), c = [];
	for (let l of e.panels) {
		let e = r[l.id] ?? 0;
		switch (l.panelConstraints.groupResizeBehavior) {
			case "preserve-pixel-size": {
				o = !0;
				let r = y(e / 100 * n / t * 100);
				s.set(l.id, r), i += r;
				break;
			}
			default:
				c.push(l.id), a += e;
				break;
		}
	}
	if (!o || c.length === 0) return r;
	let l = 100 - i, u = { ...r };
	if (s.forEach((e, t) => {
		u[t] = e;
	}), a > 0) for (let e of c) u[e] = y((r[e] ?? 0) / a * l);
	else {
		let e = y(l / c.length);
		for (let t of c) u[t] = e;
	}
	return u;
}
function qe(e, t) {
	let n = e.map((e) => e.id), r = Object.keys(t);
	if (n.length !== r.length) return !1;
	for (let e of n) if (!r.includes(e)) return !1;
	return !0;
}
var Y = /* @__PURE__ */ new Map();
function Je(e) {
	let t = !0;
	S(e.element.ownerDocument.defaultView, "Cannot register an unmounted Group");
	let n = e.element.ownerDocument.defaultView.ResizeObserver, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((n) => {
		for (let r of n) {
			let { borderBoxSize: n, target: i } = r;
			if (i === e.element) {
				if (t) {
					let t = b({ group: e });
					if (t === 0) return;
					let n = P(e.id);
					if (!n) return;
					let r = x(e), i = n.defaultLayoutDeferred ? Ue(r) : n.layout, a = H({
						layout: Ke({
							group: e,
							nextGroupSize: t,
							prevGroupSize: n.groupSize,
							prevLayout: i
						}),
						panelConstraints: r
					});
					if (!n.defaultLayoutDeferred && V(n.layout, a) && Ge(n.derivedPanelConstraints, r) && n.groupSize === t) return;
					I(e, {
						defaultLayoutDeferred: !1,
						derivedPanelConstraints: r,
						groupSize: t,
						layout: a,
						separatorToPanels: n.separatorToPanels
					});
				}
			} else We(e, i, n);
		}
	});
	a.observe(e.element), e.panels.forEach((e) => {
		S(!r.has(e.id), `Panel ids must be unique; id "${e.id}" was used more than once`), r.add(e.id), e.onResize && a.observe(e.element);
	});
	let o = b({ group: e }), s = x(e), c = e.panels.map(({ id: e }) => e).join(","), l = e.mutableState.defaultLayout;
	l && (qe(e.panels, l) || (l = void 0));
	let u = H({
		layout: e.mutableState.layouts[c] ?? l ?? Ue(s),
		panelConstraints: s
	}), d = e.element.ownerDocument;
	Y.set(d, (Y.get(d) ?? 0) + 1);
	let f = /* @__PURE__ */ new Map();
	return j(e).forEach((e) => {
		e.separator && f.set(e.separator, e.panels);
	}), I(e, {
		defaultLayoutDeferred: o === 0,
		derivedPanelConstraints: s,
		groupSize: o,
		layout: u,
		separatorToPanels: f
	}), e.separators.forEach((e) => {
		S(!i.has(e.id), `Separator ids must be unique; id "${e.id}" was used more than once`), i.add(e.id), e.element.addEventListener("keydown", xe);
	}), Y.get(d) === 1 && (d.addEventListener("dblclick", ye, !0), d.addEventListener("pointerdown", Te, !0), d.addEventListener("pointerleave", ze), d.addEventListener("pointermove", Be), d.addEventListener("pointerout", Ve), d.addEventListener("pointerup", He, !0)), function() {
		t = !1, Y.set(d, Math.max(0, (Y.get(d) ?? 0) - 1)), te(e), e.separators.forEach((e) => {
			e.element.removeEventListener("keydown", xe);
		}), Y.get(d) || (d.removeEventListener("dblclick", ye, !0), d.removeEventListener("pointerdown", Te, !0), d.removeEventListener("pointerleave", ze), d.removeEventListener("pointermove", Be), d.removeEventListener("pointerout", Ve), d.removeEventListener("pointerup", He, !0)), a.disconnect();
	};
}
function Ye() {
	let [e, t] = u({});
	return [e, n(() => t({}), [])];
}
function X(e) {
	let t = a();
	return `${e ?? t}`;
}
var Z = typeof window < "u" ? s : i;
function Q(e) {
	let t = l(e);
	return Z(() => {
		t.current = e;
	}, [e]), n((...e) => t.current?.(...e), [t]);
}
function Xe(...e) {
	return Q((t) => {
		e.forEach((e) => {
			if (e) switch (typeof e) {
				case "function":
					e(t);
					break;
				case "object":
					e.current = t;
					break;
			}
		});
	});
}
function Ze(e) {
	let t = l({ ...e });
	return Z(() => {
		for (let n in e) t.current[n] = e[n];
	}, [e]), t.current;
}
var Qe = t(null);
function $e(e, t) {
	let n = l({
		getLayout: () => ({}),
		setLayout: Ee
	});
	o(t, () => n.current, []), Z(() => {
		Object.assign(n.current, be({ groupId: e }));
	});
}
function et({ children: e, className: t, defaultLayout: n, disableCursor: r, disabled: a, elementRef: o, groupRef: s, id: u, onLayoutChange: d, onLayoutChanged: p, orientation: m = "horizontal", resizeTargetMinimumSize: h = {
	coarse: 20,
	fine: 10
}, style: g, ..._ }) {
	let v = l({
		onLayoutChange: {},
		onLayoutChanged: {}
	}), y = Q((e) => {
		V(v.current.onLayoutChange, e) || (v.current.onLayoutChange = e, d?.(e));
	}), b = Q((e) => {
		V(v.current.onLayoutChanged, e) || (v.current.onLayoutChanged = e, p?.(e));
	}), S = X(u), w = l(null), [T, E] = Ye(), D = l({
		lastExpandedPanelSizes: {},
		layouts: {},
		panels: [],
		resizeTargetMinimumSize: h,
		separators: []
	}), O = Xe(w, o);
	$e(S, s);
	let k = Q((e, t) => {
		let r = K(), i = ne(e), a = P(e);
		if (a) {
			let e = !1;
			switch (r.state) {
				case "active":
					e = r.hitRegions.some((e) => e.group === i);
					break;
			}
			return {
				flexGrow: a.layout[t] ?? 1,
				pointerEvents: e ? "none" : void 0
			};
		}
		if (n?.[t]) return { flexGrow: n?.[t] };
	}), A = Ze({
		defaultLayout: n,
		disableCursor: r
	}), j = c(() => ({
		get disableCursor() {
			return !!A.disableCursor;
		},
		getPanelStyles: k,
		id: S,
		orientation: m,
		registerPanel: (e) => {
			let t = D.current;
			return t.panels = C(m, [...t.panels, e]), E(), () => {
				t.panels = t.panels.filter((t) => t !== e), E();
			};
		},
		registerSeparator: (e) => {
			let t = D.current;
			return t.separators = C(m, [...t.separators, e]), E(), () => {
				t.separators = t.separators.filter((t) => t !== e), E();
			};
		},
		updatePanelProps: (e, { disabled: t }) => {
			let n = D.current.panels.find((t) => t.id === e);
			n && (n.panelConstraints.disabled = t);
			let r = ne(S), i = P(S);
			r && i && I(r, {
				...i,
				derivedPanelConstraints: x(r)
			});
		},
		updateSeparatorProps: (e, { disabled: t, disableDoubleClick: n }) => {
			let r = D.current.separators.find((t) => t.id === e);
			r && (r.disabled = t, r.disableDoubleClick = n);
		}
	}), [
		k,
		S,
		E,
		m,
		A
	]), M = l(null);
	return Z(() => {
		let e = w.current;
		if (e === null) return;
		let t = D.current, n;
		if (A.defaultLayout !== void 0 && Object.keys(A.defaultLayout).length === t.panels.length) {
			n = {};
			for (let e of t.panels) {
				let t = A.defaultLayout[e.id];
				t !== void 0 && (n[e.id] = t);
			}
		}
		let r = {
			disabled: !!a,
			element: e,
			id: S,
			mutableState: {
				defaultLayout: n,
				disableCursor: !!A.disableCursor,
				expandedPanelSizes: D.current.lastExpandedPanelSizes,
				layouts: D.current.layouts
			},
			orientation: m,
			panels: t.panels,
			resizeTargetMinimumSize: t.resizeTargetMinimumSize,
			separators: t.separators
		};
		M.current = r;
		let i = Je(r), { defaultLayoutDeferred: o, derivedPanelConstraints: s, layout: c } = P(r.id, !0);
		!o && s.length > 0 && (y(c), b(c));
		let l = re(S, (e) => {
			let { defaultLayoutDeferred: t, derivedPanelConstraints: n, layout: i } = e.next;
			if (t || n.length === 0) return;
			let a = r.panels.map(({ id: e }) => e).join(",");
			r.mutableState.layouts[a] = i, n.forEach((t) => {
				if (t.collapsible) {
					let { layout: n } = e.prev ?? {};
					if (n) {
						let e = L(t.collapsedSize, i[t.panelId]), a = L(t.collapsedSize, n[t.panelId]);
						e && !a && (r.mutableState.expandedPanelSizes[t.panelId] = n[t.panelId]);
					}
				}
			});
			let o = K().state !== "active";
			y(i), o && b(i);
		});
		return () => {
			M.current = null, i(), l();
		};
	}, [
		a,
		S,
		b,
		y,
		m,
		T,
		A
	]), i(() => {
		let e = M.current;
		e && (e.mutableState.defaultLayout = n, e.mutableState.disableCursor = !!r);
	}), /* @__PURE__ */ f(Qe.Provider, {
		value: j,
		children: /* @__PURE__ */ f("div", {
			..._,
			className: t,
			"data-group": !0,
			"data-testid": S,
			id: S,
			ref: O,
			style: {
				height: "100%",
				width: "100%",
				overflow: "hidden",
				...g,
				display: "flex",
				flexDirection: m === "horizontal" ? "row" : "column",
				flexWrap: "nowrap",
				touchAction: m === "horizontal" ? "pan-y" : "pan-x"
			},
			children: e
		})
	});
}
et.displayName = "Group";
function $() {
	let e = r(Qe);
	return S(e, "Group Context not found; did you render a Panel or Separator outside of a Group?"), e;
}
function tt(e, t) {
	let { id: n } = $(), r = l({
		collapse: De,
		expand: De,
		getSize: () => ({
			asPercentage: 0,
			inPixels: 0
		}),
		isCollapsed: () => !1,
		resize: De
	});
	o(t, () => r.current, []), Z(() => {
		Object.assign(r.current, ve({
			groupId: n,
			panelId: e
		}));
	});
}
function nt({ children: e, className: t, collapsedSize: n = "0%", collapsible: r = !1, defaultSize: a, disabled: o, elementRef: s, groupResizeBehavior: c = "preserve-relative-size", id: u, maxSize: p = "100%", minSize: m = "0%", onResize: h, panelRef: g, style: _, ...v }) {
	let y = !!u, b = X(u), x = Ze({ disabled: o }), S = l(null), C = Xe(S, s), { getPanelStyles: w, id: T, orientation: E, registerPanel: D, updatePanelProps: O } = $(), k = h !== null, A = Q((e, t, n) => {
		h?.(e, u, n);
	});
	Z(() => {
		let e = S.current;
		if (e !== null) return D({
			element: e,
			id: b,
			idIsStable: y,
			mutableValues: {
				expandToSize: void 0,
				prevSize: void 0
			},
			onResize: k ? A : void 0,
			panelConstraints: {
				groupResizeBehavior: c,
				collapsedSize: n,
				collapsible: r,
				defaultSize: a,
				disabled: x.disabled,
				maxSize: p,
				minSize: m
			}
		});
	}, [
		c,
		n,
		r,
		a,
		k,
		b,
		y,
		p,
		m,
		A,
		D,
		x
	]), i(() => {
		O(b, { disabled: o });
	}, [
		o,
		b,
		O
	]), tt(b, g);
	let j = () => {
		let e = w(T, b);
		if (e) return JSON.stringify(e);
	}, M = d((e) => re(T, e), j, j), N;
	return N = M ? JSON.parse(M) : a === void 0 ? { flexGrow: 1 } : {
		flexGrow: void 0,
		flexShrink: void 0,
		flexBasis: a
	}, /* @__PURE__ */ f("div", {
		...v,
		"data-disabled": o || void 0,
		"data-panel": !0,
		"data-testid": b,
		id: b,
		ref: C,
		style: {
			...rt,
			display: "flex",
			flexBasis: 0,
			flexShrink: 1,
			overflow: "visible",
			...N
		},
		children: /* @__PURE__ */ f("div", {
			className: t,
			style: {
				maxHeight: "100%",
				maxWidth: "100%",
				flexGrow: 1,
				overflow: "auto",
				..._,
				touchAction: E === "horizontal" ? "pan-y" : "pan-x"
			},
			children: e
		})
	});
}
nt.displayName = "Panel";
var rt = {
	minHeight: 0,
	maxHeight: "100%",
	height: "auto",
	minWidth: 0,
	maxWidth: "100%",
	width: "auto",
	border: "none",
	borderWidth: 0,
	padding: 0,
	margin: 0
};
function it({ layout: e, panelConstraints: t, panelId: n, panelIndex: r }) {
	let i, a, o = e[n], s = t.find((e) => e.panelId === n);
	if (s) {
		let c = s.maxSize, l = s.collapsible ? s.collapsedSize : s.minSize, u = [r, r + 1];
		a = H({
			layout: B({
				delta: l - o,
				initialLayout: e,
				panelConstraints: t,
				pivotIndices: u,
				prevLayout: e
			}),
			panelConstraints: t
		})[n], i = H({
			layout: B({
				delta: c - o,
				initialLayout: e,
				panelConstraints: t,
				pivotIndices: u,
				prevLayout: e
			}),
			panelConstraints: t
		})[n];
	}
	return {
		valueControls: n,
		valueMax: i,
		valueMin: a,
		valueNow: o
	};
}
function at({ children: e, className: t, disabled: n, disableDoubleClick: r, elementRef: a, id: o, style: s, ...c }) {
	let d = X(o), p = Ze({
		disabled: n,
		disableDoubleClick: r
	}), [m, h] = u({}), [g, _] = u("inactive"), [v, y] = u(!1), b = l(null), x = Xe(b, a), { disableCursor: S, id: C, orientation: w, registerSeparator: T, updateSeparatorProps: E } = $(), D = w === "horizontal" ? "vertical" : "horizontal";
	Z(() => {
		let e = b.current;
		if (e !== null) {
			let t = {
				disabled: p.disabled,
				disableDoubleClick: p.disableDoubleClick,
				element: e,
				id: d
			}, n = T(t), r = Ce((e) => {
				_(e.next.state !== "inactive" && e.next.hitRegions.some((e) => e.separator === t) ? e.next.state : "inactive");
			}), i = re(C, (e) => {
				let { derivedPanelConstraints: n, layout: r, separatorToPanels: i } = e.next, a = i.get(t);
				if (a) {
					let e = a[0], t = a.indexOf(e);
					h(it({
						layout: r,
						panelConstraints: n,
						panelId: e.id,
						panelIndex: t
					}));
				}
			});
			return () => {
				r(), i(), n();
			};
		}
	}, [
		C,
		d,
		T,
		p
	]), i(() => {
		E(d, {
			disabled: n,
			disableDoubleClick: r
		});
	}, [
		n,
		r,
		d,
		E
	]);
	let O;
	n && !S && (O = "not-allowed");
	let k;
	if (n) k = "disabled";
	else switch (g) {
		case "active":
			k = "active";
			break;
		default: k = v ? "focus" : g;
	}
	return /* @__PURE__ */ f("div", {
		...c,
		"aria-controls": m.valueControls,
		"aria-disabled": n || void 0,
		"aria-orientation": D,
		"aria-valuemax": m.valueMax,
		"aria-valuemin": m.valueMin,
		"aria-valuenow": m.valueNow,
		children: e,
		className: t,
		"data-separator": k,
		"data-testid": d,
		id: d,
		onBlur: () => y(!1),
		onFocus: () => y(!0),
		ref: x,
		role: "separator",
		style: {
			flexBasis: "auto",
			cursor: O,
			...s,
			flexGrow: 0,
			flexShrink: 0,
			touchAction: "none"
		},
		tabIndex: n ? void 0 : 0
	});
}
at.displayName = "Separator";
//#endregion
//#region lib/components/ui/atoms/resizable.tsx
function ot({ className: t, ...n }) {
	return /* @__PURE__ */ f(et, {
		className: e("flex h-full w-full aria-[orientation=vertical]:flex-col", t),
		"data-slot": "resizable-panel-group",
		...n
	});
}
function st({ ...e }) {
	return /* @__PURE__ */ f(nt, {
		"data-slot": "resizable-panel",
		...e
	});
}
function ct({ withHandle: t, className: n, ...r }) {
	return /* @__PURE__ */ f(at, {
		className: e("relative flex w-2 items-center justify-center bg-transparent ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring aria-[orientation=horizontal]:h-2 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:inset-y-auto aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-px aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90", n),
		"data-slot": "resizable-handle",
		...r,
		children: t && /* @__PURE__ */ f("div", { className: "z-10 flex h-6 w-1.5 shrink-0 rounded-lg bg-border" })
	});
}
//#endregion
export { st as n, ot as r, ct as t };
