var W=Object.defineProperty;var f=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var b=(i,e,t)=>e in i?W(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,g=(i,e)=>{for(var t in e||(e={}))_.call(e,t)&&b(i,t,e[t]);if(f)for(var t of f(e))G.call(e,t)&&b(i,t,e[t]);return i};import{_ as s,j as a}from"./main.2.8.10.js";import{u as I,e as q,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as w}from"./SnackMsg.7BjcJK1j.js";import{S as A}from"./Steps.B84Ui3GU.js";import{I as F,s as P}from"./Integrations.BFhED4ck.js";import{G as E,h as L,c as T}from"./GiveWpIntegLayout.CwvcbfkY.js";import D from"./GiveWpAuthorization.CqEZpRQJ.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./BackIcn.BFDZx8No.js";import"./TutorialLink.D6K_DiHL.js";function ie({formFields:i,setFlow:e,flow:t,allIntegURL:d,isInfo:v,edit:h}){const x=I(),{formID:k}=q(),[r,p]=c.useState(!1),[l,u]=c.useState(1),[y,o]=c.useState({show:!1}),j=[{key:"1",label:s("Create a donar","bit-integrations")}],S=[{key:"email",label:s("Email","bit-integrations"),required:!0},{key:"name",label:s("Name","bit-integrations"),required:!1},{key:"first_name",label:s("First Name","bit-integrations"),required:!1},{key:"last_name",label:s("Last Name","bit-integrations"),required:!1},{key:"purchase_value",label:s("Purchase Value","bit-integrations"),required:!1},{key:"purchase_count",label:s("Purchase Count","bit-integrations"),required:!1}],[n,m]=c.useState({name:"GiveWp",type:"GiveWp",mainAction:"",field_map:[{formField:"",giveWpFormField:""}],allActions:j,giveWpFields:S,actions:{}}),C=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!T(n)){o({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}n.mainAction!==""&&u(3)};return a.jsxs("div",{children:[a.jsx(w,{snack:y,setSnackbar:o}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(A,{step:3,active:l})}),a.jsx(D,{formID:k,giveWpConf:n,setGiveWpConf:m,step:l,setStep:u,isLoading:r,setIsLoading:p,setSnackbar:o}),a.jsxs("div",{className:"btcd-stp-page",style:g({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:i,handleInput:N=>L(N,n,m),giveWpConf:n,setGiveWpConf:m,isLoading:r,setIsLoading:p,setSnackbar:o,allIntegURL:d,isInfo:v,edit:h}),a.jsxs("button",{onClick:()=>C(),disabled:!n.mainAction||r,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[s("Next","bit-integrations")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(F,{step:l,saveConfig:()=>P({flow:t,setFlow:e,allIntegURL:d,navigate:x,conf:n,setIsLoading:p,setSnackbar:o}),isLoading:r,dataConf:n,setDataConf:m,formFields:i})]})}export{ie as default};
