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