import{a as p}from"./vendor-react-BBazpZul.js";const n=(s,u)=>{const E=(e,t)=>{switch(t.type){case"SET_FIELD":return{...e,[t.field]:t.value};case"SET_MULTIPLE":return{...e,...t.payload};case"RESET":return u?u(e):s;default:return e}},[c,r]=p.useReducer(E,s);return{state:c,setField:(e,t)=>r({type:"SET_FIELD",field:e,value:t}),setMultiple:e=>r({type:"SET_MULTIPLE",payload:e}),resetState:()=>r({type:"RESET"})}};export{n as u};
