"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { TagsInputProvider } from "./use-tags-input-context.js";
import { useTagsInput } from "./use-tags-input.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/tags-input/tags-input-root.tsx
var splitTagsInputProps = createSplitProps();
var TagsInputRoot = forwardRef((props, ref) => {
	const [useTagsInputProps, localProps] = splitTagsInputProps(props, [
		"addOnPaste",
		"allowDuplicates",
		"allowOverflow",
		"autoFocus",
		"blurBehavior",
		"defaultInputValue",
		"defaultValue",
		"delimiter",
		"disabled",
		"editable",
		"form",
		"id",
		"ids",
		"inputValue",
		"invalid",
		"max",
		"maxLength",
		"name",
		"onFocusOutside",
		"onHighlightChange",
		"onInputValueChange",
		"onInteractOutside",
		"onPointerDownOutside",
		"onValueChange",
		"onValueInvalid",
		"placeholder",
		"readOnly",
		"required",
		"sanitizeValue",
		"translations",
		"validate",
		"value"
	]);
	const tagsInput = useTagsInput(useTagsInputProps);
	const mergedProps = mergeProps(tagsInput.getRootProps(), localProps);
	return /* @__PURE__ */ jsx(TagsInputProvider, {
		value: tagsInput,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
TagsInputRoot.displayName = "TagsInputRoot";
//#endregion
export { TagsInputRoot };
