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