import{b as l,$ as S,h as j,k as I,i as _,j as e,_ as s,z as o}from"./main.2.8.1.js";import{u as C,d as m}from"./react-router-dom.9mCuUg3q.js";import{S as w}from"./SnackMsg.S8DrwLlT.js";import{S as k,I as y,s as F}from"./Integrations.D2bgBas2.js";import{h as c,c as v}from"./SureMembersCommonFunc.DBuWtYQU.js";import{S as M}from"./SureMembersIntegLayout.XcJb5zSk.js";import"./Note.BeM7sN-p.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function H({allIntegURL:f}){const p=C(),[i,N]=l(S),[t,a]=l(j),[u,E]=m.useState(!1),[g,x]=m.useState({auth:!1,groups:!1}),[b,r]=m.useState({show:!1}),d=I(_),h=()=>{if(!t.selectedTask){o.error(s("Please select a task!","bit-integrations"));return}if(!v(t)){o.error(s("Please map mandatory fields!","bit-integrations"));return}if(!t.selectedGroup){o.error(s("Please select a group!","bit-integrations"));return}F({flow:i,allIntegURL:f,conf:t,navigate:p,edit:1,setSnackbar:r})};return e.jsxs("div",{style:{width:900},children:[e.jsx(w,{snack:b,setSnackbar:r}),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:n=>c(n,t,a),name:"name",defaultValue:t.name||"",type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(k,{entity:i.triggered_entity,setSnackbar:r}),e.jsx(M,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>c(n,t,a),sureMembersConf:t,setSureMembersConf:a,loading:g,setLoading:x,setSnackbar:r}),e.jsx(y,{edit:!0,saveConfig:h,isLoading:u,dataConf:t,setDataConf:a,formFields:d}),e.jsx("br",{})]})}export{H as default};
