import{j as e,_ as c}from"./main.2.8.10.js";import{u as k,e as j,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as S}from"./BackIcn.BFDZx8No.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{S as M}from"./Steps.B84Ui3GU.js";import{I as v,g as Z}from"./Integrations.BFhED4ck.js";import H from"./ZohoMarketingHubAuthorization.7rFZP6B7.js";import{s as N,h as _,c as w}from"./ZohoMarketingHubCommonFunc.D9HOH5FN.js";import{Z as y}from"./ZohoMarketingHubIntegLayout.CdjRCQLh.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function U({formFields:g,setFlow:u,flow:f,allIntegURL:d}){const h=k(),{formID:n}=j(),[r,i]=a.useState(!1),[s,l]=a.useState(1),[b,o]=a.useState({show:!1}),[t,m]=a.useState({name:"Zoho Marketing Automation(Zoho Marketing Hub)",type:"Zoho Marketing Automation(Zoho Marketing Hub)",clientId:"",clientSecret:"",list:"",field_map:[{formField:"",zohoFormField:""}]});a.useEffect(()=>{window.opener&&N()},[]);const x=p=>{{if(!w(t)){o({show:!0,msg:c("Please map mandatory fields","bit-integrations")});return}t.list!==""&&t.table!==""&&t.field_map.length>0&&l(p)}};return e.jsxs("div",{children:[e.jsx(I,{snack:b,setSnackbar:o}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(M,{step:3,active:s})}),e.jsx(H,{formID:n,marketingHubConf:t,setMarketingHubConf:m,step:s,setstep:l,isLoading:r,setIsLoading:i,setSnackbar:o}),e.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto"},children:[e.jsx(y,{formID:n,formFields:g,handleInput:p=>_(p,n,t,m,i,o),marketingHubConf:t,setMarketingHubConf:m,isLoading:r,setIsLoading:i,setSnackbar:o}),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(v,{step:s,saveConfig:()=>Z(f,u,d,t,h,"","",i),isLoading:r})]})}export{U as default};
