let e=require("vue");function t(t,n){let{defaultValue:r,value:i=(0,e.ref)()}=n||{},a=typeof t==`function`?t():t;i.value!==void 0&&(a=(0,e.unref)(i)),r!==void 0&&(a=typeof r==`function`?r():r);let o=(0,e.ref)(a),s=(0,e.ref)(a);(0,e.watchEffect)(()=>{let e=i.value===void 0?o.value:i.value;n.postState&&(e=n.postState(e)),s.value=e});function c(t){let r=s.value;o.value=t,(0,e.toRaw)(s.value)!==t&&n.onChange&&n.onChange(t,r)}return(0,e.watch)(i,()=>{o.value=i.value}),[s,c]}exports.default=t;