import{u as b,d as l,r as i,h as _,j as e}from"./main-406.js";import{$ as v,g as w,h as C,d as I,_ as o,i as y,I as F,W as S,s as D}from"./bi.394.85.js";import{h as E,c}from"./bi.259.907.js";import{D as N}from"./bi.464.908.js";function P({allIntegURL:m}){const f=b(),[a,k]=l(v),[t,n]=l(w),[g,r]=i.useState(!1),[p,x]=i.useState({}),[u,s]=i.useState({show:!1}),d=_(C),h=()=>{if(!c(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!t.selectedEvent){S.error("Please select a Event");return}D({flow:a,allIntegURL:m,conf:t,navigate:f,edit:1,setIsLoading:r,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(I,{snack:u,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:j=>E(j,t,n),name:"name",value:t.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(y,{entity:a.triggered_entity,setSnackbar:s}),e.jsx(N,{formID:a.triggered_entity_id,formFields:d,demioConf:t,setDemioConf:n,loading:p,setLoading:x,setIsLoading:r,setSnackbar:s}),e.jsx(F,{edit:!0,saveConfig:h,disabled:!c(t),isLoading:g,dataConf:t,setDataConf:n,formFields:d}),e.jsx("br",{})]})}export{P as default};
