import{b as l,h as j,$ as C,k as I,i as w,j as s,_ as r}from"./main.2.8.1.js";import{u as _,h as S,d as c}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as N,s as k}from"./Integrations.D2bgBas2.js";import{h as f,c as F}from"./ZohoCampaignsCommonFunc.D_VFP2u1.js";import{Z as E}from"./ZohoCampaignsIntegLayout.DJmedo6z.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:g}){const h=_(),{id:$,formID:n}=S(),[t,e]=l(j),[m,x]=l(C),[d,i]=c.useState(!1),[u,a]=c.useState({show:!1}),p=I(w),b=()=>{if(!F(t)){a({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}k({flow:m,setFlow:x,allIntegURL:g,conf:t,navigate:h,edit:1,setIsLoading:i,setSnackbar:a})};return s.jsxs("div",{style:{width:900},children:[s.jsx(v,{snack:u,setSnackbar:a}),s.jsxs("div",{className:"flx mt-3",children:[s.jsx("b",{className:"wdt-100 d-in-b",children:r("Integration Name:","bit-integrations")}),s.jsx("input",{className:"btcd-paper-inp w-7",onChange:o=>f(o,n,t,e),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),s.jsx("br",{}),s.jsx("br",{}),s.jsx(y,{entity:m.triggered_entity,setSnackbar:a}),s.jsx(E,{formID:n,formFields:p,handleInput:o=>f(o,n,t,e,i,a),campaignsConf:t,setCampaignsConf:e,isLoading:d,setIsLoading:i,setSnackbar:a}),s.jsx(N,{edit:!0,saveConfig:b,disabled:t.list===""||t.table===""||t.field_map.length<1,isLoading:d,dataConf:t,setDataConf:e,formFields:p})]})}export{H as default};
