import{h as l,$ as j,g as b,k as I,i as _,j as e,_ as o}from"./main.2.8.10.js";import{u as w,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as y,I as C,s as F}from"./Integrations.BFhED4ck.js";import{h as m,c as v}from"./MailjetCommonFunc.BV-1x4TT.js";import{M}from"./MailjetIntegLayout.fA9Egq9Q.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function H({allIntegURL:f}){const c=w(),[i,N]=l(j),[t,a]=l(b),[p,k]=r.useState(!1),[g,u]=r.useState({list:!1,field:!1,auth:!1,tags:!1}),[x,s]=r.useState({show:!1}),d=I(_),h=()=>{if(!v(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}F({flow:i,allIntegURL:f,conf:t,navigate:c,edit:1,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>m(n,t,a),name:"name",defaultValue:t.name||"",type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(y,{entity:i.triggered_entity,setSnackbar:s}),e.jsx(M,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>m(n,t,a),mailjetConf:t,setMailjetConf:a,loading:g,setLoading:u,setSnackbar:s}),e.jsx(C,{edit:!0,saveConfig:h,disabled:!(t!=null&&t.selectedLists),isLoading:p,dataConf:t,setDataConf:a,formFields:d}),e.jsx("br",{})]})}export{H as default};
