import{h as c,$ as h,g as j,k as b,i as _,j as t,_ as o}from"./main.2.8.10.js";import{u as I,e as w,b as l}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S,I as v,s as y}from"./Integrations.BFhED4ck.js";import{h as p,c as F}from"./MauticCommonFunc.BxousfUl.js";import{M}from"./MauticIntegLayout.C2JraGpu.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:f}){const g=I(),{id:N}=w(),[i,k]=c(h),[e,a]=c(j),[r,m]=l.useState(!1),[u,s]=l.useState({show:!1}),d=b(_),x=()=>{if(!F(e)){s({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:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:u,setSnackbar:s}),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=>p(n,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(S,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(M,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>p(n,e,a),mauticConf:e,setMauticConf:a,isLoading:r,setIsLoading:m,setSnackbar:s}),t.jsx(v,{edit:!0,saveConfig:x,disabled:e.field_map.length<1,isLoading:r,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{J as default};
