require("../../../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let react = require("react");
let antd = require("antd");
//#region src/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.tsx
const MaxLengthSelect = (props, ref) => {
	(0, react.useImperativeHandle)(ref, () => {
		return { onChange: handleChange };
	});
	const handleChange = (e, _option) => {
		if (props.onChange) {
			if ((props.mode === "multiple" || props.mode === "tags") && props.maxLength) {
				if (props.value && props.value.length >= props.maxLength && e.length > props.value.length) return;
			}
			props.onChange(e, _option);
		}
	};
	return /* @__PURE__ */ React.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props), {}, {
		onChange: handleChange,
		popupMatchSelectWidth: false
	}), props.children);
};
var MaxLengthSelect_default = (0, react.forwardRef)(MaxLengthSelect);
//#endregion
exports.default = MaxLengthSelect_default;
