import{b as l,h as C,$ as _,k as I,i as w,j as e,_ as m}from"./main.2.8.1.js";import{u as S,h as y,d}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as N,I as k,s as F}from"./Integrations.D2bgBas2.js";import{h as f,c as R}from"./ZohoCRMCommonFunc.1o3GTILx.js";import{Z as E}from"./ZohoCRMIntegLayout.Cio4f41u.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./CheckBox.Dg5Lw38s.js";import"./TitleModal.OGRirA3t.js";import"./EditIcn.VNtuoqcJ.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function Q({allIntegURL:g}){const u=S(),{id:M}=y(),[t,a]=l(C),[o,h]=l(_),[p,i]=d.useState(!1),[x,s]=d.useState({show:!1}),[n,b]=d.useState(0),c=I(w),j=()=>{if(!R(t)){s({show:!0,msg:m("Please map mandatory fields","bit-integrations")});return}F({flow:o,setFlow:h,allIntegURL:g,conf:t,navigate:u,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(v,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 ",children:m("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>f(r,n,t,a),name:"name",value:t.name,type:"text",placeholder:m("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(N,{entity:o.triggered_entity,setSnackbar:s}),e.jsx(E,{tab:n,settab:b,formID:o.triggered_entity_id,formFields:c,handleInput:r=>f(r,n,t,a,i,s),crmConf:t,setCrmConf:a,isLoading:p,setIsLoading:i,setSnackbar:s}),e.jsx(k,{edit:!0,saveConfig:j,disabled:t.module===""||t.layout===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:a,formFields:c}),e.jsx("br",{})]})}export{Q as default};
