import{j as t,_ as l}from"./main.2.8.1.js";import{u as j,d as r}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as R}from"./BackIcn._kGL_vVw.js";import{S}from"./SnackMsg.S8DrwLlT.js";import{I as C,g as I}from"./Integrations.D2bgBas2.js";import M from"./UserRegistrationMembershipAuthorization.BI2Dnn7q.js";import{c as d}from"./UserRegistrationMembershipCommonFunc.H9RriRxj.js";import{U}from"./UserRegistrationMembershipIntegLayout.DUfCHLqA.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 G({formFields:p,setFlow:f,flow:u,allIntegURL:x}){const h=j(),[o,a]=r.useState(!1),[s,c]=r.useState(1),[b,i]=r.useState({show:!1}),[e,n]=r.useState({name:"User Registration & Membership",type:"User Registration & Membership",field_map:[{formField:"",userRegistrationField:""}],actions:{},mainAction:""}),g=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m===3){if(!d(e)){i({show:!0,msg:l("Please map all required fields to continue.","bit-integrations")});return}e.name!==""&&e.field_map.length>0&&c(m)}else c(m)};return t.jsxs("div",{children:[t.jsx(S,{snack:b,setSnackbar:i}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(M,{userRegistrationConf:e,setUserRegistrationConf:n,step:s,nextPage:g,isLoading:o,setIsLoading:a,setSnackbar:i}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"200px"},children:[t.jsx(U,{userRegistrationConf:e,setUserRegistrationConf:n,setSnackbar:i,setIsLoading:a,isLoading:o,formFields:p}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>g(3),disabled:!d(e),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),t.jsx(R,{className:"ml-1 rev-icn"})]})]}),t.jsx(C,{step:s,saveConfig:()=>I(u,f,x,e,h,"","",a),isLoading:o,dataConf:e,setDataConf:n,formFields:p})]})}export{G as default};
