var y=Object.defineProperty;var p=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var b=(a,t,e)=>t in a?y(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,f=(a,t)=>{for(var e in t||(t={}))C.call(t,e)&&b(a,e,t[e]);if(p)for(var e of p(t))N.call(t,e)&&b(a,e,t[e]);return a};import{u as _,k as w,r as m,j as s}from"./main-406.js";import{d as E,_ as F,I as L,s as T,N as D}from"./bi.394.85.js";import{S as M}from"./bi.68.941.js";import P from"./bi.533.267.js";import{h as q,c as h}from"./bi.838.791.js";import{A as z}from"./bi.273.790.js";import"./bi.46.744.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";import"./bi.209.734.js";function Y({formFields:a,setFlow:t,flow:e,allIntegURL:x}){const g=_(),{formID:d}=w(),[l,o]=m.useState(!1),[c,u]=m.useState(1),[A,n]=m.useState({show:!1}),j=[{key:"1",label:"Add/Update Subscriber"},{key:"2",label:"Delete Subscriber"}],v=[{key:"email",label:"Email",required:!0}],[i,r]=m.useState({name:"Acumbamail",type:"Acumbamail",mainAction:"",listId:"",auth_token:"",field_map:[{formField:"",acumbamailFormField:"EMAIL"}],addSubsCriberFields:v,allActions:j,address_field:[],actions:{}}),I=`
  <h4>This integration can only be accessed by the payed users of Acumbamail</h4>`,S=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!h(i)){n({show:!0,msg:"Please map fields to continue."});return}i.listId!==""&&u(3)};return s.jsxs("div",{children:[s.jsx(E,{snack:A,setSnackbar:n}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(M,{step:3,active:c})}),s.jsx(P,{formID:d,acumbamailConf:i,setAcumbamailConf:r,step:c,setstep:u,isLoading:l,setIsLoading:o,setSnackbar:n}),s.jsxs("div",{className:"btcd-stp-page",style:f({},c===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(z,{formFields:a,handleInput:k=>q(k,i,r,o,n,d),acumbamailConf:i,setAcumbamailConf:r,isLoading:l,setIsLoading:o,setSnackbar:n}),s.jsxs("button",{onClick:()=>S(),disabled:!i.mainAction||!h(i),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[F("Next","bit-integrations")," "," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(L,{step:c,saveConfig:()=>T({flow:e,setFlow:t,allIntegURL:x,navigate:g,conf:i,setIsLoading:o,setSnackbar:n}),isLoading:l,dataConf:i,setDataConf:r,formFields:a}),s.jsx(D,{note:I})]})}export{Y as default};
