var w=Object.defineProperty;var u=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var f=(a,s,e)=>s in a?w(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e,h=(a,s)=>{for(var e in s||(s={}))S.call(s,e)&&f(a,e,s[e]);if(u)for(var e of u(s))v.call(s,e)&&f(a,e,s[e]);return a};import{g as N,G as y,r as c,j as n,S as C,_ as i}from"./main-343.js";import{a7 as _}from"./bf-659-81.js";import{I as D}from"./bf-58-184.js";import{h as g,c as E}from"./bf-566-97.js";import{Z as L}from"./bf-160-191.js";import"./bf-974-82.js";import"./bf-649-79.js";import"./bf-594-113.js";function A({formFields:a,setIntegration:s,integrations:e,allIntegURL:x}){const{id:d,formID:l}=N(),j=y(),[t,m]=c.useState(h({},e[d])),[k,p]=c.useState(!1),[I,r]=c.useState({show:!1}),b=()=>{var o;if(!E(t)){r({show:!0,msg:i("Please map mandatory fields")});return}if(!((o=t.actions)!=null&&o.ticket_owner)){r({show:!0,msg:i("Please select a ticket owner")});return}_(e,s,x,t,j,d,1)};return n.jsxs("div",{style:{width:900},children:[n.jsx(C,{snack:I,setSnackbar:r}),n.jsxs("div",{className:"flx mt-3",children:[n.jsx("b",{className:"wdt-100 d-in-b",children:i("Integration Name:")}),n.jsx("input",{className:"btcd-paper-inp w-7",onChange:o=>g(o,t,m),name:"name",value:t.name,type:"text",placeholder:i("Integration Name...")})]}),n.jsx("br",{}),n.jsx("br",{}),n.jsx(L,{formID:l,formFields:a,handleInput:o=>g(o,t,m,l,p,r),deskConf:t,setDeskConf:m,isLoading:k,setisLoading:p,setSnackbar:r}),n.jsx(D,{edit:!0,saveConfig:b,disabled:t.department===""||t.table===""||t.field_map.length<1})]})}export{A as default};
