"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useTagsInputContext } from "./use-tags-input-context.js";
import { TagsInputItemProvider } from "./use-tags-input-item-context.js";
import { TagsInputItemPropsProvider } from "./use-tags-input-item-props-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/tags-input/tags-input-item.tsx
var splitItemProps = createSplitProps();
var TagsInputItem = forwardRef((props, ref) => {
	const [itemProps, localProps] = splitItemProps(props, [
		"index",
		"disabled",
		"value"
	]);
	const tagsInput = useTagsInputContext();
	const mergedProps = mergeProps(tagsInput.getItemProps(itemProps), localProps);
	return /* @__PURE__ */ jsx(TagsInputItemPropsProvider, {
		value: itemProps,
		children: /* @__PURE__ */ jsx(TagsInputItemProvider, {
			value: tagsInput.getItemState(itemProps),
			children: /* @__PURE__ */ jsx(ark.div, {
				...mergedProps,
				ref
			})
		})
	});
});
TagsInputItem.displayName = "TagsInputItem";
//#endregion
export { TagsInputItem };
