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.9.0.js";import{u as I,e as q,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as w}from"./SnackMsg.DYSD96P4.js";import{S as A}from"./Steps.BYe8zHkm.js";import{I as F,s as P}from"./Integrations.DL8wqGct.js";import{G as E,h as L,c as T}from"./GiveWpIntegLayout.Gc31rgLv.js";import D from"./GiveWpAuthorization.B5-NUtiA.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./BackIcn._8Wofmn2.js";import"./TutorialLink.CFG7bS5c.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};
