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