import { t as e } from "./utils-CHlhTiFC.js";
import { t } from "./createLucideIcon-CC8mnBIB.js";
import { Button as n } from "./Button.js";
import r from "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
var o = t("chevrons-left", [["path", {
	d: "m11 17-5-5 5-5",
	key: "13zhaf"
}], ["path", {
	d: "m18 17-5-5 5-5",
	key: "h8a8et"
}]]), s = t("chevrons-right", [["path", {
	d: "m6 17 5-5-5-5",
	key: "xnjwq"
}], ["path", {
	d: "m13 17 5-5-5-5",
	key: "17xmmf"
}]]), c = r.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ i("div", {
	className: e("@container w-full border border-primary-gray-300 dark:border-primary-gray-600", t),
	ref: a,
	...r,
	children: n
}));
c.displayName = "VisualizationWidget";
var l = r.createContext({
	selectedValue: void 0,
	hoverItemClass: void 0,
	activeItemClass: void 0,
	onValueChange: () => {}
}), u = r.forwardRef(({ className: t, children: n, defaultValue: a, activeItemClass: o, hoverItemClass: s, onChange: c, ...u }, d) => {
	let [f, p] = r.useState(a || ""), m = r.useCallback((e) => {
		p(e), c?.(e);
	}, [c]), h = r.useMemo(() => ({
		activeItemClass: o,
		selectedValue: f,
		hoverItemClass: s,
		onValueChange: m
	}), [
		f,
		o,
		s,
		m
	]);
	return /* @__PURE__ */ i(l.Provider, {
		value: h,
		children: /* @__PURE__ */ i("div", {
			className: e("flex gap-0 w-full bg-primary-gray-300 dark:bg-primary-gray-600", t),
			ref: d,
			...u,
			children: n
		})
	});
});
u.displayName = "VisualizationWidgetHeader";
var d = r.forwardRef(({ className: t, children: n, value: a, ...o }, s) => {
	let { selectedValue: c, activeItemClass: u, hoverItemClass: d, onValueChange: f } = r.useContext(l);
	return /* @__PURE__ */ i("button", {
		ref: s,
		type: "button",
		...o,
		onClick: () => f(a),
		className: e("flex border-0 flex-col grow cursor-pointer gap-1 items-center justify-center p-3 font-medium bg-primary-gray-100 dark:bg-primary-gray-650 text-primary-gray-500 dark:text-primary-white text-sm font-medium border-r border-r-primary-gray-400 dark:border-r-primary-gray-550 last:border-r-0", c === a ? u || "bg-primary-white text-primary-blue-600 dark:bg-primary-gray-700" : "", d ? `hover:${d} dark:hover:${d}` : "hover:bg-primary-white dark:hover:bg-primary-gray-700", t),
		children: n
	});
});
d.displayName = "VisualizationWidgetHeaderItem";
var f = r.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ i("div", {
	className: e("flex gap-0 flex-wrap items-stretch max-h-none flex-col @3xl:max-h-[80vh] @3xl:flex-row", t),
	ref: a,
	...r,
	children: n
}));
f.displayName = "VisualizationWidgetBody";
var p = r.forwardRef(({ className: t, children: c, collapsible: l, ...u }, d) => {
	let [f, p] = r.useState(l?.defaultCollapsed || !1);
	return /* @__PURE__ */ a("div", {
		className: e("undp-scrollbar max-h-none @3xl:max-h-[80vh] bg-primary-gray-100 dark:bg-primary-gray-650 border-r-0 @3xl:border-r @3xl:border-r-primary-gray-400 dark:@3xl:border-r-primary-gray-600", f ? "w-full @3xl:w-[40px] py-4 px-2" : "w-full @3xl:w-1/3 @7xl:w-1/4 @8xl:w-1/5 p-4", t),
		ref: d,
		...u,
		children: [/* @__PURE__ */ i("div", {
			className: "w-full hidden @3xl:block relative",
			children: l?.enabled === !1 ? null : /* @__PURE__ */ i(n, {
				type: "button",
				variant: "tertiary",
				size: "sm",
				onClick: () => p(!f),
				className: e("flex rounded-full normal-case text-primary-gray-700 dark:text-primary-gray-700 w-6 h-6 absolute top-0 right-0 p-0", l?.triggerButtonClassName),
				style: l?.triggerButtonStyles,
				children: l?.triggerButtonChildren || i(f ? s : o, {})
			})
		}), l?.enabled !== !1 && f ? null : c]
	});
});
p.displayName = "VisualizationWidgetBodySidebar";
var m = r.forwardRef(({ className: t, children: n, ...r }, a) => /* @__PURE__ */ i("div", {
	className: e("flex flex-wrap undp-scrollbar flex-1 bg-primary-white dark:bg-primary-gray-700 max-h-none @3xl:max-h-[80vh]", t),
	ref: a,
	...r,
	children: n
}));
m.displayName = "VisualizationWidgetBodyContent";
//#endregion
export { u as a, p as i, f as n, d as o, m as r, c as t };

//# sourceMappingURL=visualization-widget-C9sK3NjB.js.map