import{u as b,k as C,d as m,r as o,h as I,j as t}from"./main-406.js";import{$ as _,g as w,h as v,d as y,_ as r,i as F,I as N,W as k,s as E}from"./bi.394.85.js";import{h as c,c as f}from"./bi.945.899.js";import{S as L}from"./bi.177.900.js";function A({allIntegURL:g}){const p=b();C();const[n,P]=m(_),[e,a]=m(w),[u,x]=o.useState(!1),[h,d]=o.useState({}),[j,s]=o.useState({show:!1}),l=I(v),S=()=>{if(!f(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="lead"&&!e.selectedCRMPipeline){k.error("Please select a pipeline");return}E({flow:n,allIntegURL:g,conf:e,navigate:p,edit:1,setLoading:d,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(y,{snack:j,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>c(i,e,a),name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(F,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:n.triggered_entity_id,formFields:l,handleInput:i=>c(i,e,a),salesmateConf:e,setSalesmateConf:a,loading:h,setLoading:d,setIsLoading:x,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:S,disabled:!f(e),isLoading:u,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{A as default};
