import{j as s,_ as f}from"./main.2.8.10.js";import{u as b,e as j,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as P}from"./BackIcn.BFDZx8No.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{I as k,g as v}from"./Integrations.BFhED4ck.js";import N from"./SeoPressAuthorization.BjzIfLc5.js";import{S as y,c as C}from"./SeoPressIntegLayout.m5ab2Ez6.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function K({formFields:d,setFlow:g,flow:u,allIntegURL:x}){const S=b(),{formID:m}=j(),[r,a]=i.useState(!1),[e,p]=i.useState(1),[h,o]=i.useState({show:!1}),[t,c]=i.useState({name:"SEOPress",type:"SeoPress",field_map:[{formField:"",seoPressField:""}],actions:{},mainAction:""}),l=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n!==3&&p(n),!C(t)){o({show:!0,msg:f("Please map all required fields to continue.","bit-integrations")});return}t.name!==""&&t.field_map.length>0&&p(n)};return s.jsxs("div",{children:[s.jsx(I,{snack:h,setSnackbar:o}),s.jsx("div",{className:"txt-center mt-2"}),s.jsx(N,{formID:m,seoPressConf:t,setSeoPressConf:c,step:e,nextPage:l,isLoading:r,setIsLoading:a,setSnackbar:o}),s.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[s.jsx(y,{formID:m,formFields:d,seoPressConf:t,setSeoPressConf:c,setSnackbar:o,setIsLoading:a,isLoading:r}),s.jsx("br",{}),s.jsx("br",{}),s.jsx("br",{}),s.jsxs("button",{onClick:()=>l(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[f("Next","bit-integrations"),s.jsx(P,{className:"ml-1 rev-icn"})]})]}),s.jsx(k,{step:e,saveConfig:()=>v(u,g,x,t,S,"","",a),isLoading:r})]})}export{K as default};
