1import{c as y,bx as d,C as T,q as v,r as E,by as g,j as i,E as q,bz as b,t as h}from"./index-CaB-1DxL.js";import{u as Q,E as j}from"./externalTechnician-CFfBQ6Ue.js";import{u as D}from"./useSuspenseQuery-DnK3Q64E.js";import"./button-Bj7ZlM7T.js";import"./dialog-Dd-wgPsE.js";import"./index-CMkR5q5E.js";import"./InputField-F2uiwEdU.js";import"./input-C3fLVWIe.js";import"./Selector-D7m033Bh.js";import"./index-Cjj9pcYp.js";const S=v({queryKey:["externalTechnicians","new"],queryFn:()=>g(void 0),staleTime:3e5});function $(){const e=y.c(10),c=d.useNavigate(),t=T(),{data:s}=D(S),[f,p]=E.useState(!1),[l,m]=Q(s);if(f){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(q,{}),e[0]=a):a=e[0],a}let n;e[1]!==c||e[2]!==t?(n=async a=>{p(!0);const x=await b(a);x.ok?(t.removeQueries({queryKey:["externalTechnicians"]}),t.removeQueries({queryKey:["optas"]}),t.removeQueries({queryKey:["studies"]}),t.removeQueries({queryKey:["budgets"]}),h.success("Técnico creado satisfactoriamente"),c({to:"/externalTechnicians/$externalTechnicianId",params:{externalTechnicianId:x.data}})):h.error(x.msg||"Ha ocurrido un error desconocido al crear el técnico"),p(!1)},e[1]=c,e[2]=t,e[3]=n):n=e[3];const u=n;let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("h1",{className:"text-xl font-bold",children:"Nuevo técnico externo"}),e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==u||e[7]!==m||e[8]!==l?(o=i.jsxs("div",{className:"flex flex-col gap-4 ps-4",children:[r,i.jsx(j,{isEdit:!1,externalTechnicianDto:l,setExternalTechnicianDto:m,formData:s,saveExternalTechnician:u})]}),e[5]=s,e[6]=u,e[7]=m,e[8]=l,e[9]=o):o=e[9],o}export{$ as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.