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