import{u as b,k as I,d as c,r as o,h as _,j as t}from"./main-406.js";import{$ as w,g as S,h as v,d as y,_ as r,i as F,I as N,W as g,s as P}from"./bi.394.85.js";import{h as m,c as f}from"./bi.926.853.js";import{A as k}from"./bi.249.854.js";function D({allIntegURL:p}){const u=b();I();const[n,A]=c(w),[e,a]=c(S),[x,R]=o.useState(!1),[h,d]=o.useState({}),[j,s]=o.useState({show:!1}),l=_(v),C=()=>{if(!f(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="deal"){if(!e.selectedCRMPipeline){g.error("Please select a pipeline");return}if(!e.selectedCRMPipelineStages){g.error("Please select a pipeline stage");return}}P({flow:n,allIntegURL:p,conf:e,navigate:u,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=>m(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(k,{formID:n.triggered_entity_id,formFields:l,handleInput:i=>m(i,e,a),agiledConf:e,setAgiledConf:a,loading:h,setLoading:d,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:C,disabled:!f(e),isLoading:x,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{D as default};
