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