import{b as m,$ as C,h as j,k as y,i as S,j as e,_ as s,q as _}from"./main.2.8.1.js";import{u as w,h as I,d as i}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as F,I as N,s as k}from"./Integrations.D2bgBas2.js";import{h as E,c as d}from"./CompanyHubCommonFunc.CGm8nZRA.js";import{C as H}from"./CompanyHubIntegLayout.DwExfPXp.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function J({allIntegURL:c}){const l=w(),{id:L}=I(),[n,$]=m(C),[t,o]=m(j),[f,p]=i.useState(!1),[g,u]=i.useState({}),[x,a]=i.useState({show:!1}),r=y(S),b=()=>{if(!d(t)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="deal"&&!t.selectedStage){_.error(s("Please select a Deal Stage","bit-integrations"));return}k({flow:n,allIntegURL:c,conf:t,navigate:l,edit:1,setSnackbar:a})};return e.jsxs("div",{style:{width:900},children:[e.jsx(v,{snack:x,setSnackbar:a}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:h=>E(h,t,o),name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(F,{entity:n.triggered_entity,setSnackbar:a}),e.jsx(H,{formID:n.triggered_entity_id,formFields:r,companyHubConf:t,setCompanyHubConf:o,loading:g,setLoading:u,setIsLoading:p,setSnackbar:a}),e.jsx(N,{edit:!0,saveConfig:b,disabled:!d(t),isLoading:f,dataConf:t,setDataConf:o,formFields:r}),e.jsx("br",{})]})}export{J as default};
