var v=Object.defineProperty;var f=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var b=(s,e,t)=>e in s?v(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,d=(s,e)=>{for(var t in e||(e={}))j.call(e,t)&&b(s,t,e[t]);if(f)for(var t of f(e))N.call(e,t)&&b(s,t,e[t]);return s};import{u as q,k as S,r as n,j as a}from"./main-406.js";import{d as w,I as G,_ as I,s as _}from"./bi.394.85.js";import{S as A}from"./bi.68.941.js";import{s as F}from"./bi.93.731.js";import L from"./bi.963.274.js";import{c as z}from"./bi.41.807.js";import{G as E}from"./bi.467.808.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";function Q({formFields:s,setFlow:e,flow:t,allIntegURL:g}){const k=q(),{flowID:m}=S(),[l,u]=n.useState(!1),[i,p]=n.useState(1),[y,r]=n.useState({show:!1}),h=[{key:"1",label:"Create a contact"},{key:"2",label:"Update a contact"}],x=[{key:"phoneNumber",label:"Phone Number",required:!0},{key:"name",label:"First Name",required:!0},{key:"lastName",label:"Last Name",required:!0},{key:"biographies",label:"Biographies",required:!1},{key:"nickname",label:"Nickname",required:!1},{key:"city",label:"City",required:!1},{key:"country",label:"Country",required:!1},{key:"locations",label:"Locations",required:!1},{key:"email",label:"email",required:!1},{key:"occupation",label:"Occupation",required:!1},{key:"organization",label:"Organization",required:!1}],[o,c]=n.useState({name:"Google Contacts",type:"Google Contacts",mainAction:"",clientId:"",clientSecret:"",field_map:[{formField:"",googleContactsFormField:""}],default:x,allActions:h,actions:{}});n.useEffect(()=>{window.opener&&F("googleContacts")},[]);const C=()=>{_({flow:t,setFlow:e,allIntegURL:g,conf:o,navigate:k,setIsLoading:u,setSnackbar:r})};return a.jsxs("div",{children:[a.jsx(w,{snack:y,setSnackbar:r}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(A,{step:3,active:i})}),a.jsx(L,{flowID:m,googleContactsConf:o,setGoogleContactsConf:c,step:i,setStep:p,isLoading:l,setIsLoading:u,setSnackbar:r}),a.jsx("div",{className:"btcd-stp-page",style:d({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsx(E,{flowID:m,formFields:s,googleContactsConf:o,setGoogleContactsConf:c})}),a.jsx(G,{step:i,saveConfig:()=>C(),isLoading:l,dataConf:o,setDataConf:c,formFields:s}),a.jsx("div",{className:"btcd-stp-page",style:d({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsxs("button",{onClick:()=>p(3),disabled:!z(o==null?void 0:o.field_map)||o.mainAction===""||l,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",children:[I("Next","bit-integrations"),a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})})]})}export{Q as default};
