"use client";
const require_swap_anatomy = require("./swap.anatomy.cjs");
const require_use_presence = require("../presence/use-presence.cjs");
//#region src/components/swap/use-swap.ts
var useSwap = (props = {}) => {
	const { swap = false, lazyMount, unmountOnExit } = props;
	const presenceProps = {
		lazyMount,
		unmountOnExit
	};
	const onPresence = require_use_presence.usePresence({
		present: swap,
		...presenceProps,
		skipAnimationOnMount: true
	});
	const offPresence = require_use_presence.usePresence({
		present: !swap,
		...presenceProps,
		skipAnimationOnMount: true
	});
	return {
		swap,
		onPresence,
		offPresence,
		getRootProps() {
			return {
				...require_swap_anatomy.parts.root.attrs,
				"data-swap": swap ? "on" : "off",
				style: { display: "inline-grid" }
			};
		},
		getIndicatorProps({ type }) {
			const presence = type === "on" ? onPresence : offPresence;
			return {
				...require_swap_anatomy.parts.indicator.attrs,
				...presence.getPresenceProps(),
				"data-type": type,
				style: {
					gridArea: "1 / 1",
					display: "inline-flex"
				}
			};
		}
	};
};
//#endregion
exports.useSwap = useSwap;
