import{u as j,k as b,d as c,r as o,h as I,j as t}from"./main-333.js";import{$ as _,g as w,h as P,d as v,_ as r,i as y,I as F,V as N,s as S}from"./bi.636.93.js";import{h as m,c as f}from"./bi.118.908.js";import{C as k}from"./bi.165.909.js";function A({allIntegURL:g}){const p=j();b();const[n,E]=c(_),[e,a]=c(w),[h,L]=o.useState(!1),[u,d]=o.useState({}),[x,s]=o.useState({show:!1}),l=I(P),C=()=>{if(!f(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="lead"&&!e.selectedCRMPipeline){N.error("Please select a pipeline");return}S({flow:n,allIntegURL:g,conf:e,navigate:p,edit:1,setLoading:d,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:x,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=>m(i,e,a),name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(y,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(k,{formID:n.triggered_entity_id,formFields:l,handleInput:i=>m(i,e,a),clinchPadConf:e,setClinchPadConf:a,loading:u,setLoading:d,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:C,disabled:!f(e),isLoading:h,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{A as default};
