import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{$ as n}from"./utils.Vs712G4Z.js";var r=e(t(),1);function i({formId:e,maxChars:t,setDirty:i,setUiValue:a,setValueWithSource:o,additionalAction:s}){return(0,r.useCallback)(r=>{let{value:c}=r.target;t!==0&&c.length>t||(i(!0),a(c),n({formId:e})&&o({value:c,fromUi:!0}),s&&s())},[e,t,i,a,o,s])}function a(e,t,n,i){(0,r.useEffect)(()=>{i||e!==t&&n(e)},[e,t,i,n])}export{i as n,a as t};