import{h as l,g as j,$ as C,k as I,i as w,j as s,_ as r}from"./main.2.9.0.js";import{u as _,e as S,b as c}from"./react-router.DMwpH23k.js";import{S as v}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as N,s as k}from"./Integrations.DL8wqGct.js";import{h as f,c as F}from"./ZohoCampaignsCommonFunc.D2GsA_ed.js";import{Z as E}from"./ZohoCampaignsIntegLayout.CZSGqHIC.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:g}){const x=_(),{id:$,formID:n}=S(),[t,e]=l(j),[m,h]=l(C),[p,i]=c.useState(!1),[u,a]=c.useState({show:!1}),d=I(w),b=()=>{if(!F(t)){a({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}k({flow:m,setFlow:h,allIntegURL:g,conf:t,navigate:x,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:d,handleInput:o=>f(o,n,t,e,i,a),campaignsConf:t,setCampaignsConf:e,isLoading:p,setIsLoading:i,setSnackbar:a}),s.jsx(N,{edit:!0,saveConfig:b,disabled:t.list===""||t.table===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:e,formFields:d})]})}export{J as default};
