var j=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var p=(o,e,t)=>e in o?j(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,v=(o,e)=>{for(var t in e||(e={}))S.call(e,t)&&p(o,t,e[t]);if(f)for(var t of f(e))D.call(e,t)&&p(o,t,e[t]);return o};import{u as G,k,r as i,j as s}from"./main-333.js";import{d as w,_ as C,I,s as N}from"./bi.636.93.js";import{S as _}from"./bi.563.969.js";import{s as y}from"./bi.864.754.js";import L from"./bi.219.245.js";import{G as E}from"./bi.523.780.js";import"./bi.603.779.js";import"./bi.318.783.js";function H({formFields:o,setFlow:e,flow:t,allIntegURL:u}){const x=G(),{flowID:c}=k(),[l,g]=i.useState(!1),[a,m]=i.useState(1),[b,r]=i.useState({show:!1}),[n,d]=i.useState({name:"Google Drive",type:"Google Drive",clientId:"",clientSecret:"",field_map:[{formField:"",googleDriveFormField:""}],foldersList:[],actions:{}});i.useEffect(()=>{window.opener&&y("googleDrive")},[]);const h=()=>{N({flow:t,setFlow:e,allIntegURL:u,conf:n,navigate:x,setIsLoading:g,setSnackbar:r})};return s.jsxs("div",{children:[s.jsx(w,{snack:b,setSnackbar:r}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(_,{step:3,active:a})}),s.jsx(L,{flowID:c,googleDriveConf:n,setGoogleDriveConf:d,step:a,setStep:m,isLoading:l,setIsLoading:g,setSnackbar:r}),s.jsxs("div",{className:"btcd-stp-page",style:v({},a===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(E,{flowID:c,formFields:o,googleDriveConf:n,setGoogleDriveConf:d}),s.jsxs("button",{onClick:()=>m(3),disabled:n.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[C("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(I,{step:a,saveConfig:()=>h(),isLoading:l})]})}export{H as default};
