var j=Object.defineProperty,S=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var f=(t,e,s)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,g=(t,e)=>{for(var s in e||(e={}))y.call(e,s)&&f(t,s,e[s]);if(c)for(var s of c(e))N.call(e,s)&&f(t,s,e[s]);return t},u=(t,e)=>S(t,M(e));import{_ as n,j as i}from"./main.2.8.10.js";import{u as _,b as d}from"./react-router.DMwpH23k.js";import{S as k}from"./StepPage.Dcszwd6s.js";import{S as C}from"./Steps.B84Ui3GU.js";import{I as E}from"./Integrations.BFhED4ck.js";import F from"./MoosendAuthorization.wZQlU9vi.js";import{n as I,c as L}from"./MoosendCommonFunc.DTOVV7sr.js";import{M as q}from"./MoosendIntegLayout.Bz4CtfuM.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import"./SnackMsg.7BjcJK1j.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./GlobalIntegrationHelper.Belqr4OT.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function Z({formFields:t,setFlow:e,flow:s,allIntegURL:b}){const h=_(),[a,p]=d.useState(1),[r,m]=d.useState({auth:!1,list:!1,page:!1}),[o,l]=d.useState({name:"Moosend",type:"Moosend",authKey:"",field_map:[{formFields:"",moosendFormFields:""}],listId:"",method:"",actions:{},moosendFields:[],basicFields:[{key:"Email",label:n("Email","bit-integrations"),required:!0},{key:"Name",label:n("Name","bit-integrations"),required:!1},{key:"Mobile",label:n("Mobile","bit-integrations"),required:!1}]}),x=v=>{m(u(g({},r),{page:v}))};return i.jsxs("div",{children:[i.jsx("div",{className:"txt-center mt-2",children:i.jsx(C,{step:3,active:a})}),i.jsx(F,{moosendConf:o,setMoosendConf:l,loading:r,setLoading:m,step:a,setStep:p}),i.jsxs(k,{step:a,stepNo:2,style:{width:900,height:"auto",overflow:"visible"},children:[i.jsx(q,{moosendConf:o,setMoosendConf:l,formFields:t,loading:r,setLoading:m}),(o==null?void 0:o.method)&&i.jsxs("button",{onClick:()=>I(o,p,3),disabled:o.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[n("Next")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),o.method&&i.jsx(E,{step:a,saveConfig:()=>L(s,e,b,o,h,x),isLoading:r.page,dataConf:o,setDataConf:l,formFields:t})]})}export{Z as default};
