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