var v=Object.defineProperty;var f=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var h=(a,t,e)=>t in a?v(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,u=(a,t)=>{for(var e in t||(t={}))N.call(t,e)&&h(a,e,t[e]);if(f)for(var e of f(t))b.call(t,e)&&h(a,e,t[e]);return a};import{g as w,G as y,r as m,j as o,S as k,_ as p}from"./main-343.js";import{a7 as _}from"./bf-659-81.js";import{I as E}from"./bf-58-184.js";import{h as g,c as L}from"./bf-944-95.js";import{Z}from"./bf-805-189.js";import"./bf-974-82.js";import"./bf-529-105.js";import"./bf-541-186.js";import"./bf-649-79.js";import"./bf-594-113.js";function H({formFields:a,setIntegration:t,integrations:e,allIntegURL:x}){const{id:d,formID:c}=w(),I=y(),[s,n]=m.useState(u({},e[d])),[j,l]=m.useState(!1),[C,r]=m.useState({show:!1}),S=()=>{if(!L(s)){r({show:!0,msg:p("Please map mandatory fields")});return}_(e,t,x,s,I,d,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:p("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:p("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:S,disabled:!s.applicationId||!s.formId||s.field_map.length<1})]})}export{H as default};
