import{j as t,_ as l}from"./main.2.8.10.js";import{u as j,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as R}from"./BackIcn.BFDZx8No.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{I as C,g as I}from"./Integrations.BFhED4ck.js";import M from"./UserRegistrationMembershipAuthorization.BOXKSfVu.js";import{c as f}from"./UserRegistrationMembershipCommonFunc.CI64HSvP.js";import{U}from"./UserRegistrationMembershipIntegLayout.BkEdTL8O.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 G({formFields:p,setFlow:d,flow:u,allIntegURL:x}){const b=j(),[o,a]=r.useState(!1),[s,c]=r.useState(1),[h,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(!f(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:h,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&&"500px"},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:!f(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,d,x,e,b,"","",a),isLoading:o,dataConf:e,setDataConf:n,formFields:p})]})}export{G as default};
