import{h as d,$ as j,g as C,k as I,i as _,j as t,_ as i,q as w}from"./main.2.8.10.js";import{u as v,e as y,b as r}from"./react-router.DMwpH23k.js";import{S as F}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as N,I as k,s as E}from"./Integrations.BFhED4ck.js";import{h as l,c}from"./SalesmateCommonFunc.B4Ku-olc.js";import{S as L}from"./SalesmateIntegLayout.CmDDXj1D.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";function K({allIntegURL:p}){const f=v(),{id:P}=y(),[n,R]=d(j),[e,a]=d(C),[g,u]=r.useState(!1),[x,h]=r.useState({}),[S,s]=r.useState({show:!1}),m=I(_),b=()=>{if(!c(e)){s({show:!0,msg:i("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="lead"&&!e.selectedCRMPipeline){w.error(i("Please select a pipeline","bit-integrations"));return}E({flow:n,allIntegURL:p,conf:e,navigate:f,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(F,{snack:S,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:i("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,e,a),name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(N,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:n.triggered_entity_id,formFields:m,handleInput:o=>l(o,e,a),salesmateConf:e,setSalesmateConf:a,loading:x,setLoading:h,setIsLoading:u,setSnackbar:s}),t.jsx(k,{edit:!0,saveConfig:b,disabled:!c(e),isLoading:g,dataConf:e,setDataConf:a,formFields:m}),t.jsx("br",{})]})}export{K as default};
