import{r as e}from"./chunk-QTnfLwEv.js";import{n as t,t as n}from"./jsx-runtime-BWRPWl8p.js";import{i as r,t as i}from"./axios-Yyz76XvX.js";import{Br as a,F as o,It as s,oo as c}from"./endpoints-BWeG8ngA.js";import{Da as l,Li as u,Qt as d,W as f}from"./index-DccLTdzK.js";import{t as p}from"./query-string-D4ReIoyH.js";var m=e(t(),1);async function h(){return await i.get(r+a,{headers:{Accept:`application/json`,"Content-Type":`application/json`}})}async function g(e){return await i.post(r+c,e,{headers:{Accept:`application/json`,"Content-Type":`application/json`}})}async function _(e,t){return await i.put(r+o+`/${e}`,t,{headers:{Accept:`application/json`,"Content-Type":`application/json`}})}async function v(e,t){return await i.delete(r+s+`/${e}`,t,{headers:{Accept:`application/json`,"Content-Type":`application/json`}})}var y=n();function b({history:e,setShow:t}){let[n,r]=(0,m.useState)(x()),[i,a]=(0,m.useState)(!0);return(0,m.useEffect)(()=>{setTimeout(()=>{a(!1)},500)},[]),(0,y.jsxs)(y.Fragment,{children:[i&&(0,y.jsx)(f,{}),(0,y.jsx)(`div`,{className:`generalSerDentales`,children:(0,y.jsxs)(u,{onSubmit:i=>{if(i.preventDefault(),!n.clasificacion||!n.tipo||!n.servicio||!n.precio||!n.colorimetria)l.warning(`Completa el formulario`);else try{a(!0);let i={clasificacion:n.clasificacion,tipo:n.tipo,servicio:n.servicio,precio:n.precio,colorimetria:n.colorimetria,tonos:n.tono1+`,`+n.tono2+`,`+n.tono3+`,`+n.tono4,estado:`true`};g(i).then(n=>{let{data:o}=n;console.log(o),d(`Se ha registrado el servicio dental `+i.servicio,i),l.success(o.mensaje),e({search:p.stringify(``)}),r(x()),a(!1),t(!1)})}catch(e){console.log(e)}},onChange:e=>{r({...n,[e.target.name]:e.target.value})},children:[(0,y.jsx)(u.Label,{className:`lblClaSer`,children:`Clasificación de Servicio: `}),(0,y.jsx)(u.Control,{type:`text`,className:`inpClasifSer`,defaultValue:n.clasificacion,name:`clasificacion`,placeholder:`Escribe la clasificacion del material. Ejemplo: Zirconia`}),(0,y.jsx)(u.Label,{className:`lblTipoSer`,children:`Tipo de Servicio: `}),(0,y.jsx)(u.Control,{defaultValue:n.tipo,name:`tipo`,type:`text`,className:`inpTipoSer`,placeholder:`Tipo de servicio que se dará de alta. Ejemplo: Prostodoncia`}),(0,y.jsx)(u.Label,{className:`lblSerSer`,children:`Servicio: `}),(0,y.jsx)(u.Control,{defaultValue:n.servicio,name:`servicio`,type:`text`,className:`inpServiciosSer`,placeholder:`Nombre del servicio. Ejemplo: Endoposte`}),(0,y.jsx)(u.Label,{className:`lblPrecioSer`,children:`Precio: `}),(0,y.jsx)(u.Control,{defaultValue:n.precio,name:`precio`,type:`text`,className:`inpPrecioSer`,placeholder:`Precio`}),(0,y.jsxs)(`div`,{className:`checksDiv`,children:[(0,y.jsx)(u.Label,{className:`lblColSer`,children:`Selección del sistema de colorimetria: `}),[`radio`].map(e=>(0,y.jsxs)(`div`,{className:`selColorimetria`,children:[(0,y.jsx)(u.Check,{type:e,id:`VC`,label:`VITA CLASSICAL`,value:`VITA CLASSICAL`,name:`colorimetria`,defaultValue:n.colorimetria}),(0,y.jsx)(u.Check,{type:e,id:`V3M`,name:`colorimetria`,label:`VITAPAN 3D MASTER`,value:`VITAPAN 3D MASTER`,defaultValue:n.colorimetria})]})),(0,y.jsx)(u.Label,{className:`lblTonosSer`,children:`Tonos: `}),[`checkbox`].map(e=>(0,y.jsxs)(`div`,{className:`selTonos`,children:[(0,y.jsx)(u.Check,{type:e,id:`A1`,label:`A1`,value:`A1`,defaultValue:n.tono1,name:`tono1`}),(0,y.jsx)(u.Check,{type:e,id:`A2`,label:`A2`,value:`A2`,defaultValue:n.tono2,name:`tono2`}),(0,y.jsx)(u.Check,{type:e,id:`A3`,label:`A3`,value:`A3`,defaultValue:n.tono3,name:`tono3`}),(0,y.jsx)(u.Check,{type:e,id:`A4`,label:`A4`,value:`A4`,defaultValue:n.tono4,name:`tono4`})]}))]}),(0,y.jsx)(`br`,{}),(0,y.jsx)(`label`,{}),(0,y.jsx)(`div`,{className:`divSubmit`,children:(0,y.jsx)(`input`,{className:`submit`,value:`Enviar`,type:`submit`})})]})})]})}function x(){return{clasificacion:``,tipo:``,servicio:``,precio:``,colorimetria:``,tono1:``,tono2:``,tono3:``,tono4:``}}export{b as default,v as n,h as r,_ as t};