var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var h=(a,t,e)=>t in a?S(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,u=(a,t)=>{for(var e in t||(t={}))b.call(t,e)&&h(a,e,t[e]);if(f)for(var e of f(t))w.call(t,e)&&h(a,e,t[e]);return a};import{w as N,v as y,r as m,j as o,S as k,_ as d}from"./main-40.js";import{b as _}from"./bf-132-75.js";import{I as E}from"./bf-94-335.js";import{h as g,c as L}from"./bf-645-343.js";import{Z}from"./bf-666-344.js";import"./bf-620-81.js";import"./bf-135-338.js";import"./bf-200-122.js";import"./bf-689-131.js";function G({formFields:a,setIntegration:t,integrations:e,allIntegURL:x}){const{id:p,formID:c}=N(),I=y(),[s,n]=m.useState(u({},e[p])),[j,l]=m.useState(!1),[C,r]=m.useState({show:!1}),v=()=>{if(!L(s)){r({show:!0,msg:d("Please map mandatory fields")});return}_(e,t,x,s,I,p,1)};return o.jsxs("div",{style:{width:900},children:[o.jsx(k,{snack:C,setSnackbar:r}),o.jsxs("div",{className:"flx mt-3",children:[o.jsx("b",{className:"wdt-100 d-in-b",children:d("Integration Name:")}),o.jsx("input",{className:"btcd-paper-inp w-7",onChange:i=>g(i,s,n),name:"name",value:s.name,type:"text",placeholder:d("Integration Name...")})]}),o.jsx(Z,{formID:c,formFields:a,handleInput:i=>g(i,s,n,c,l,r),creatorConf:s,setCreatorConf:n,isLoading:j,setisLoading:l,setSnackbar:r}),o.jsx(E,{edit:!0,saveConfig:v,disabled:!s.applicationId||!s.formId||s.field_map.length<1})]})}export{G as default};
