import{b as l,$ as h,h as j,k as b,i as _,j as t,_ as o}from"./main.2.8.1.js";import{u as I,h as w,d as p}from"./react-router-dom.9mCuUg3q.js";import{S as C}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S,I as v,s as y}from"./Integrations.D2bgBas2.js";import{h as c,c as F}from"./RapidmailCommonFunc.DW-NWjuq.js";import{R}from"./RapidmailIntegLayout.Btx_9-4t.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function H({allIntegURL:f}){const g=I(),{id:N}=w(),[i,k]=l(h),[e,s]=l(j),[r,m]=p.useState(!1),[x,a]=p.useState({show:!1}),d=b(_),u=()=>{if(!F(e)){a({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}y({flow:i,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:m,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:x,setSnackbar:a}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>c(n,e,s),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(S,{entity:i.triggered_entity,setSnackbar:a}),t.jsx(R,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>c(n,e,s),rapidmailConf:e,setRapidmailConf:s,isLoading:r,setIsLoading:m,setSnackbar:a}),t.jsx(v,{edit:!0,saveConfig:u,disabled:e.field_map.length<1,isLoading:r,dataConf:e,setDataConf:s,formFields:d}),t.jsx("br",{})]})}export{H as default};
