import{v as I,w,r as s,j as e,S as R,_ as v}from"./main-40.js";/* empty css          */import{S as b}from"./bf-679-136.js";import{s as y,b as Z}from"./bf-132-75.js";import{I as _}from"./bf-94-335.js";import{N as k}from"./bf-504-404.js";import N from"./bf-410-263.js";import{h as P,c as C}from"./bf-314-355.js";import{Z as E}from"./bf-801-356.js";import"./bf-860-126.js";import"./bf-892-199.js";import"./bf-141-80.js";import"./bf-586-70.js";import"./bf-541-403.js";import"./bf-190-73.js";import"./bf-200-122.js";import"./bf-689-131.js";function V({formFields:d,setIntegration:l,integrations:u,allIntegURL:f}){const h=I(),{formID:i}=w(),[m,r]=s.useState(!1),[o,c]=s.useState(1),[g,a]=s.useState({show:!1}),[p,x]=s.useState(0),[t,n]=s.useState({name:"Zoho Recruit API",type:"Zoho Recruit",clientId:"",clientSecret:"",module:"",field_map:[{formField:"",zohoFormField:""}],relatedlists:[],actions:{}});s.useEffect(()=>{window.opener&&y("zohoRecruit")},[]);const S=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!C(t)){a({show:!0,msg:v("Please map mandatory fields")});return}t.module!==""&&t.field_map.length>0&&c(3)};return e.jsxs("div",{children:[e.jsx(R,{snack:g,setSnackbar:a}),e.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:e.jsx(b,{step:3,active:o})}),e.jsx(N,{formID:i,recruitConf:t,setRecruitConf:n,step:o,setstep:c,isLoading:m,setisLoading:r,setSnackbar:a}),e.jsxs("div",{className:"btcd-stp-page",style:{width:o===2&&900,height:o===2&&"100%"},children:[e.jsx(E,{tab:p,settab:x,formID:i,formFields:d,handleInput:j=>P(j,p,t,n,i,r,a),recruitConf:t,setRecruitConf:n,isLoading:m,setisLoading:r,setSnackbar:a}),e.jsx(k,{nextPageHandler:()=>S(),disabled:t.module===""||t.field_map.length<1})]}),e.jsx(_,{step:o,saveConfig:()=>Z(u,l,f,t,h)})]})}export{V as default};
