import{h as m,$ as b,g as v,k as _,i as w,j as t,_ as o}from"./main.2.9.0.js";import{u as C,e as I,b as n}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as F,s as N}from"./Integrations.DL8wqGct.js";import{h as k,c as d}from"./GravitecCommonFunc.CPnGVxOv.js";import{G as E}from"./GravitecIntegLayout.Dj2Lwfip.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({allIntegURL:c}){const l=C(),{id:G}=I(),[a,L]=m(b),[e,i]=m(v),[p,f]=n.useState(!1),[g,x]=n.useState({}),[u,s]=n.useState({show:!1}),r=_(w),h=()=>{if(!d(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:f,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:h,disabled:!d(e),isLoading:p,dataConf:e,setDataConf:i,formFields:r}),t.jsx("br",{})]})}export{O as default};
