var v=Object.defineProperty;var u=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var p=(s,e,t)=>e in s?v(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,f=(s,e)=>{for(var t in e||(e={}))j.call(e,t)&&p(s,t,e[t]);if(u)for(var t of u(e))q.call(e,t)&&p(s,t,e[t]);return s};import{u as C,r as o,j as a}from"./main-406.js";import{_,I as N,s as S,c as G}from"./bi.394.85.js";import{S as I}from"./bi.68.941.js";import w from"./bi.21.252.js";import{G as E,h as F,c as L}from"./bi.321.774.js";import"./bi.46.744.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";function O({formFields:s,setFlow:e,flow:t,allIntegURL:g}){const b=C(),[d,r]=o.useState(!1),[l,m]=o.useState(1),[P,y]=o.useState({show:!1}),h=[{key:"name",label:"Name",required:!1},{key:"email",label:"Email",required:!0},{key:"phone",label:"Phone",required:!1},{key:"gender",label:"Gender",required:!1},{key:"country",label:"Country",required:!1},{key:"city",label:"City",required:!1},{key:"company_name",label:"Company Name",required:!1},{key:"industry",label:"Industry",required:!1},{key:"job_title",label:"Job Title",required:!1},{key:"last_name",label:"Last Name",required:!1},{key:"postal_code",label:"Postal Code",required:!1},{key:"state",label:"State",required:!1}],[i,n]=o.useState({name:"Getgist",type:"Getgist",api_key:"",field_map:[{formField:"",getgistFormField:""}],actions:{},gistFields:h}),k=()=>{r(!0),S({flow:t,setFlow:e,allIntegURL:g,conf:i,navigate:b,setIsLoading:r,setSnackbar:y})},x=c=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!L(i)){G.error("Please map mandatory fields");return}i.field_map.length>0&&m(c)};return a.jsxs("div",{children:[a.jsx("div",{className:"txt-center mt-2",children:a.jsx(I,{step:3,active:l})}),a.jsx(w,{getgistConf:i,setGetgistConf:n,step:l,setstep:m,isLoading:d,setIsLoading:r}),a.jsxs("div",{className:"btcd-stp-page",style:f({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:s,handleInput:c=>F(c,i,n),getgistConf:i,setGetgistConf:n,isLoading:d,setIsLoading:r}),a.jsxs("button",{onClick:()=>x(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[_("Next","bit-integrations")," "," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(N,{step:l,saveConfig:()=>k(),isLoading:d,dataConf:i,setDataConf:n,formFields:s})]})}export{O as default};
