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