File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/assets/bi.24.308.js
import{u as k,o as j,r as n,j as e}from"./main-685.js";import"./bi.451.455.js";import{B as S}from"./bi.788.791.js";import{_ as c}from"./bi.878.0.js";import{S as I}from"./bi.674.13.js";import{S as M}from"./bi.347.1012.js";import{I as Z,g as v}from"./bi.776.3.js";import H from"./bi.173.182.js";import{s as N,h as _,c as w,r as y}from"./bi.543.769.js";import{Z as C}from"./bi.771.770.js";import"./bi.327.9.js";import"./bi.601.11.js";import"./bi.825.14.js";import"./bi.703.796.js";import"./bi.768.751.js";import"./bi.666.752.js";function U({formFields:f,setFlow:g,flow:u,allIntegURL:d}){const h=k(),{formID:r}=j(),[p,a]=n.useState(!1),[i,l]=n.useState(1),[b,s]=n.useState({show:!1}),[t,m]=n.useState({name:"Zoho Marketing Automation(Zoho Marketing Hub)",type:"Zoho Marketing Automation(Zoho Marketing Hub)",clientId:"",clientSecret:"",list:"",field_map:[{formField:"",zohoFormField:""}]});n.useEffect(()=>{window.opener&&N()},[]);const x=o=>{if(o===3){if(!w(t)){s({show:!0,msg:c("Please map mandatory fields","bit-integrations")});return}t.list!==""&&t.table!==""&&t.field_map.length>0&&l(o)}else l(o),o===2&&!t.list&&y(r,t,m,a,s)};return e.jsxs("div",{children:[e.jsx(I,{snack:b,setSnackbar:s}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(M,{step:3,active:i})}),e.jsx(H,{formID:r,marketingHubConf:t,setMarketingHubConf:m,step:i,setstep:l,isLoading:p,setIsLoading:a,setSnackbar:s}),e.jsxs("div",{className:"btcd-stp-page",style:{width:i===2&&900,height:i===2&&"auto"},children:[e.jsx(C,{formID:r,formFields:f,handleInput:o=>_(o,r,t,m,a,s),marketingHubConf:t,setMarketingHubConf:m,isLoading:p,setIsLoading:a,setSnackbar:s}),e.jsxs("button",{onClick:()=>x(3),disabled:t.list===""||t.table===""||t.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[c("Next","bit-integrations"),e.jsx(S,{className:"ml-1 rev-icn"})]})]}),e.jsx(Z,{step:i,saveConfig:()=>v(u,g,d,t,h,"","",a),isLoading:p})]})}export{U as default};