import{j as t,_ as d}from"./main.2.9.0.js";import{u as P,e as S,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as M}from"./BackIcn._8Wofmn2.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{I as W,g as C}from"./Integrations.DL8wqGct.js";import k from"./MainWPAuthorization.9UHhJF2b.js";import{c as u}from"./MainWPCommonFunc.e0JBbT1d.js";import{M as v}from"./MainWPIntegLayout.EyZjPmLg.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CHf_DzPf.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.B6YI8w_n.js";function K({formFields:c,setFlow:g,flow:x,allIntegURL:b}){const h=P(),{formID:p}=S(),[n,o]=a.useState(!1),[e,l]=a.useState(1),[j,i]=a.useState({show:!1}),[s,r]=a.useState({name:"MainWP",type:"MainWP",field_map:[],actions:{},mainAction:"",mainWPFields:[],selectedSite:"",allSites:[],utilities:{}}),f=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m===3){if(!u(s)){i({show:!0,msg:d("Please map all required fields to continue.","bit-integrations")});return}s.name!==""&&l(m)}else l(m)};return t.jsxs("div",{children:[t.jsx(I,{snack:j,setSnackbar:i}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(k,{formID:p,mainWPConf:s,setMainWPConf:r,step:e,nextPage:f,isLoading:n,setIsLoading:o,setSnackbar:i}),t.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[t.jsx(v,{formID:p,formFields:c,mainWPConf:s,setMainWPConf:r,setSnackbar:i,isLoading:n,setIsLoading:o}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>f(3),disabled:!u(s),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations"),t.jsx(M,{className:"ml-1 rev-icn"})]})]}),t.jsx(W,{step:e,saveConfig:()=>C(x,g,b,s,h,"","",o),isLoading:n,dataConf:s,setDataConf:r,formFields:c})]})}export{K as default};
