import{b as m,$ as v,h as C,k as _,i as b,j as t,_ as s,z as r}from"./main.2.8.1.js";import{u as j,d}from"./react-router-dom.9mCuUg3q.js";import{S}from"./SnackMsg.S8DrwLlT.js";import{S as T,I,s as k}from"./Integrations.D2bgBas2.js";import{T as w}from"./TheEventsCalendarIntegLayout.BPNhjpvP.js";import{h as c,T as N,c as y}from"./theEventsCalendarCommonFunctions.V_9ePTS9.js";import"./Note.BeM7sN-p.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function B({allIntegURL:f}){const p=j(),[i,F]=m(v),[e,a]=m(C),[g,L]=d.useState(!1),[u,h]=d.useState({auth:!1,events:!1}),[x,n]=d.useState({show:!1}),l=_(b),E=()=>{if(!e.selectedTask){r.error(s("Please select a task!","bit-integrations"));return}if(e.selectedTask===N.NEW_ATTENDEE&&!e.selectedEvent){r.error(s("Please select a event!","bit-integrations"));return}if(!y(e)){r.error(s("Please map mandatory fields!","bit-integrations"));return}k({flow:i,allIntegURL:f,conf:e,navigate:p,edit:1,setSnackbar:n})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:x,setSnackbar:n}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>c(o,e,a),name:"name",defaultValue:e.name||"",type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(T,{entity:i.triggered_entity,setSnackbar:n}),t.jsx(w,{formID:i.triggered_entity_id,formFields:l,handleInput:o=>c(o,e,a),theEventsCalendarConf:e,setTheEventsCalendarConf:a,loading:u,setLoading:h,setSnackbar:n}),t.jsx(I,{edit:!0,saveConfig:E,isLoading:g,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{B as default};
