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