import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{n as r,t as i}from"./useStableCallback-BRGKkp0I.js";function a({value:e,defaultValue:t,onValueChange:n}){let i=e!==void 0,[a,s]=(0,o.useState)(i?e:t);(0,o.useEffect)(()=>{i&&e!==a&&s(e)},[i,e,a]);let c=r(n),l=(0,o.useCallback)(e=>{i||s(e),c(e)},[i,c]);return[i?e:a,l]}var o,s=t((()=>{o=e(n(),1),i()}));export{a as n,s as t};