import{i}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-6809063d.js";import{a as e,j as r}from"./Tooltip-ae8d7992.js";import{B as h,h as f,O as j,i as x,D as b,E as s}from"./index-dfa17bed.js";const{useState:y}=await i("react"),{Box:g,Button:B}=await i("@mui/material"),w=t=>{const{iPrId:n,source:o}=t;h(),y({});const d={dominio:"",label:"Documento",name:"",tabla:"adjtip",id:"AdjTipId",type:"supercombobox",text:"AdjTipNom",where:"",whereAdicion:"",otrosCampos:"AdjTipVinc , AdjTipId",groupBy:"",ordenBy:""},{control:c,handleSubmit:l,formState:{errors:m}}=f({defaultValues:{documento:"",iPrId:n,archivo:o},mode:"onBlur"});return e("div",{children:r("form",{onSubmit:l(u=>{x.post(`${b}`,u).then(p=>{const a=p.data;a.success?(s.success("El archivo fue adjuntado correctamente"),t.handleClose(!1)):s.error(a.msg??"Error al adjuntar archivo")}).finally(()=>{})}),children:[r(g,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e("img",{src:o,alt:"Mensaje de imagen",style:{width:"40%"}}),e("div",{style:{flexBasis:"100%"},children:e(j,{control:c,name:"documento",required:!0,iField:d,type:"supercombobox"})})]}),e(B,{sx:{marginY:"10px"},fullWidth:!0,type:"submit",disabled:Object.keys(m).length>0,children:"Adjuntar"})]})})};export{w as default};
