import{j as s,_ as d}from"./main.2.8.1.js";import{u as j,h as P,d as r}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as M}from"./BackIcn._kGL_vVw.js";import{S}from"./SnackMsg.S8DrwLlT.js";import{I,g as k}from"./Integrations.D2bgBas2.js";import v from"./MailerPressAuthorization._i3t0yy1.js";import{M as N,c as _}from"./MailerPressIntegLayout.BSu7G7hS.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./ProUtilHelpers.fQlR3mWW.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";import"./GlobalIntegrationHelper.CgnhJgll.js";function K({formFields:f,setFlow:g,flow:u,allIntegURL:x}){const h=j(),{formID:m}=P(),[a,o]=r.useState(!1),[e,l]=r.useState(1),[b,i]=r.useState({show:!1}),[t,p]=r.useState({name:"MailerPress",type:"MailerPress",field_map:[{formField:"",mailerPressField:""}],lists:[],tags:[],actions:{},mainAction:""}),c=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n===3){if(!_(t)){i({show:!0,msg:d("Please map all required fields to continue.","bit-integrations")});return}t.name!==""&&t.field_map.length>0&&l(n)}else l(n)};return s.jsxs("div",{children:[s.jsx(S,{snack:b,setSnackbar:i}),s.jsx("div",{className:"txt-center mt-2"}),s.jsx(v,{formID:m,mailerPressConf:t,setMailerPressConf:p,step:e,nextPage:c,isLoading:a,setIsLoading:o,setSnackbar:i}),s.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"200px"},children:[s.jsx(N,{formID:m,formFields:f,mailerPressConf:t,setMailerPressConf:p,setSnackbar:i,setIsLoading:o,isLoading:a}),s.jsx("br",{}),s.jsx("br",{}),s.jsx("br",{}),s.jsxs("button",{onClick:()=>c(3),disabled:t.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations"),s.jsx(M,{className:"ml-1 rev-icn"})]})]}),s.jsx(I,{step:e,saveConfig:()=>k(u,g,x,t,h,"","",o),isLoading:a})]})}export{K as default};
