import{a as e}from"./chunk-BNv3lrIs.js";import{n as t,t as n}from"./jsx-runtime-pmtNMKr4.js";import{r}from"./openPay-4KSuxreV.js";var i=e(t(),1),a=n();function o(){let[e,t]=(0,i.useState)({name:`Johnis`,email:`johndoesd@example.com`,last_name:`Doesd`,address:{city:`Queretaro`,state:`Queretaro`,line1:`Calle Morelos no 10`,line2:`col. san pablo`,postal_code:`76000`,country_code:`MX`},phone_number:`44209087658`,requires_account:!0}),n=n=>{let{name:r,value:i}=n.target;t({...e,[r]:i})};return(0,a.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();try{let t=await r(e);console.log(`Cliente creado exitosamente:`,t)}catch(e){console.error(`Hubo un error al crear el cliente:`,e)}},children:[(0,a.jsx)(`input`,{type:`text`,name:`name`,placeholder:`Nombre`,value:e.name,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`last_name`,placeholder:`Apellido`,value:e.last_name,onChange:n}),(0,a.jsx)(`input`,{type:`email`,name:`email`,placeholder:`Correo electrónico`,value:e.email,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`phone_number`,placeholder:`Número de teléfono`,value:e.phone_number,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`address_city`,placeholder:`Ciudad`,value:e.address.city,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`address_state`,placeholder:`Estado`,value:e.address.state,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`address_line1`,placeholder:`Dirección línea 1`,value:e.address.line1,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`address_line2`,placeholder:`Dirección línea 2`,value:e.address.line2,onChange:n}),(0,a.jsx)(`input`,{type:`text`,name:`address_postal_code`,placeholder:`Código Postal`,value:e.address.postal_code,onChange:n}),(0,a.jsx)(`button`,{type:`submit`,children:`Crear Usuario`})]})}export{o as default};